`
rankingsDiv.setAttribute('class','widget-content widget-content-area text-left mb-3');
menuLeft.insertBefore(rankingsDiv, firstLeftChild);
const equipmentDiv = document.createElement('div');
equipmentDiv.innerHTML = equipmentDivContent
equipmentDiv.setAttribute('class','widget mb-3');
menuRight.insertBefore(equipmentDiv, firstRightChild);
const rankingsEle = await superfetch('ajax/rankings.php?type=char_elepower')
const rankingsPower = await superfetch('ajax/rankings.php?type=char_power')
const rankingsChaos = await superfetch('ajax/rankings.php?type=char_chaos')
const rankingsMr = await superfetch('ajax/rankings.php?type=char_maxRage')
if (rankingsEle == "error"){
document.querySelector("#homeTilesContainer").innerHTML = 'Alert tiles not available via trustee'
return;
};
const arrayEle = rankingsEle.match(/\{"id":"[0-9]+","name":"[^"]*","pic":"[^"]*","stat":[0-9]+,/g)
const arrayPower = rankingsPower.match(/\{"id":"[0-9]+","name":"[^"]*","stat":"[0-9]+","pic":"[^"]*",/g)
const arrayChaos = rankingsChaos.match(/\{"id":"[0-9]+","name":"[^"]*","pic":"[^"]*","stat":[0-9]+/g)
const arrayMr = rankingsMr.match(/"id":"[0-9]+","name":"[^"]*","stat":[0-9]+,"pic":"[^"]*"/g)
let tableEle = ''
let tablePower = ''
let tableChaos = ''
let tableMr = ''
for (let i = 0; i < 10; i++) {
const obj = arrayEle[i];
const id = obj.match(/"id":"([0-9]+)"/i)[1]
const pic = obj.match(/"pic":"([^"]*)"/i)[1]
const name = i == 0 ? `${obj.match(/"name":"([^"]*)"/i)[1]}
` : obj.match(/"name":"([^"]*)"/i)[1]
const stat = parseInt(obj.match(/"stat":([0-9]+)/i)[1]).toLocaleString()
if (obj.match(/"name":"([^"]*)"/i)[1] == charName){
tableEle += `
`);
};
await Promise.all(array.map(tableRows));
document.querySelector("#mvRgaSelectDiv").innerHTML = `
`
document.querySelector("#mvStart").addEventListener('click', async function(){
const rows = document.querySelectorAll('.rga-selected');
const array = [];
if (rows.length == 0){
alert ('Please select at least 1 RGA');
} else {
this.outerHTML = '
(.*?)<\/td> | (.*?)<\/td> | (.*?)<\/td> | .*?<\/td><\/tr>/i)
const profileData = await superfetchProfile(`profile?id=${string[1]}`);
const character = profileData.name;
const level = profileData.level;
rgas.push([`rg_sess_id=${string[2]}&suid=${string[1]}&serverid=${serverNo}`,string[3],string[1],character,level]);
});
if (rows.length == 1){
GM_addStyle(`.mv-rga-cell{display:none;}`)
};
await mv(rgas);
};
});
};
const rows = document.querySelectorAll('table.mv-rga-select-table tbody tr');
rows.forEach(tr => {
tr.addEventListener('click', async function (){
this.classList.toggle('rga-selected');
});
});
async function mv(rgas){
document.querySelector("#blankOverlay").outerHTML = `
`
var heightHeader = document.querySelector("#mvHeader").clientHeight + 10;
document.querySelector("#mvContent").setAttribute('style',`top:${heightHeader}px`)
const open = document.querySelectorAll(".open-btn")
open.forEach(function(button){
button.addEventListener('click',async function(){
const alt = this.outerHTML.match(/alt="([^"]*)"/i)[1];
var currentPosition = document.getElementById(`div-${alt}`).getBoundingClientRect();
document.getElementById(`div-${alt}`).style.top = currentPosition.top + 200 + 'px';
var heightDiv = document.getElementById(`div-${alt}`).clientHeight;
document.querySelector("#mvContent").style.top = heightDiv + 10 + 'px';
await new Promise(resolve => setTimeout(resolve, 500));
const vh = window.innerHeight;
document.querySelector('#mvContent').style.height = '';
});
});
const close = document.querySelectorAll(".close-btn")
close.forEach(function(button){
button.addEventListener('click',async function(){
const div = this.parentElement.parentElement.outerHTML.match(/id="([^"]*)"/i)[1];
var currentPosition = document.getElementById(div).getBoundingClientRect();
document.getElementById(div).style.top = currentPosition.top - 200 + 'px';
var heightHeader = document.querySelector("#mvHeader").clientHeight + 10;
document.querySelector("#mvContent").style.top = heightHeader + "px";
const vh = window.innerHeight;
document.querySelector('#mvContent').style.height = vh - heightHeader - 10 + 'px';
});
});
document.querySelector("#character-overview").addEventListener('click', async function(){
await mvCharacterOverview(rgas)
});
document.querySelector("#character-stats").addEventListener('click', async function(){
await mvCharacterStats(rgas)
});
document.querySelector("#character-factions").addEventListener('click', async function(){
await mvCharacterFactions(rgas)
});
document.querySelector("#character-collections").addEventListener('click', async function(){
await mvCharacterCollections(rgas)
});
document.querySelector("#character-skills").addEventListener('click', async function(){
await mvCharacterSkills(rgas)
});
document.querySelector("#character-underlings").addEventListener('click', async function(){
await mvCharacterUnderlings(rgas)
});
document.querySelector("#character-god-slayer").addEventListener('click', async function(){
await mvCharacterGodSlayer(rgas)
});
document.querySelector("#character-codex").addEventListener('click', async function(){
await mvCharacterCodex(rgas)
});
document.querySelector("#equipment-equipped").addEventListener('click', async function(){
await mvEquipmentEquipped(rgas)
});
const slots = Array.from(document.querySelectorAll(".eq-slot"));
for (let i = 0; i < slots.length; i++) {
slots[i].addEventListener('click',async function(){
const slot = this.innerHTML.toLowerCase();
await mvEquipmentSlot(rgas,slot);
});
};
document.querySelector("#equipment-chaos-gem").addEventListener('click', async function(){
await mvEquipmentChaosGem(rgas)
});
document.querySelector("#equipment-badge").addEventListener('click',async function(){
await mvEquipmentBadge(rgas)
});
document.querySelector("#equipment-orbs").addEventListener('click',async function(){
await mvEquipmentOrbs(rgas)
});
document.querySelector("#equipment-rune").addEventListener('click',async function(){
await mvEquipmentRune(rgas)
});
document.querySelector("#equipment-booster").addEventListener('click',async function(){
await mvEquipmentBooster(rgas)
});
document.querySelector("#equipment-crests").addEventListener('click',async function(){
await mvEquipmentCrests(rgas)
});
document.querySelector("#equipment-augments").addEventListener('click',async function(){
await mvEquipmentAugments(rgas)
});
document.querySelector("#storage-backpack").addEventListener('click', async function(){
await mvStorageBackpack(rgas)
});
const bpType = Array.from(document.querySelectorAll(".bp-tab"));
for (let i = 0; i < bpType.length; i++) {
bpType[i].addEventListener('click', async function(){
const tab = this.outerHTML.match(/alt="([^"]*)"/i)[1];
await mvStorageItems(rgas,tab);
});
};
document.querySelector("#storage-equipment").addEventListener('click', async function(){
await mvStorageEquipment(rgas)
});
document.querySelector("#storage-vault").addEventListener('click', async function(){
await mvStorageVault(rgas)
});
document.querySelector("#storage-augments").addEventListener('click', async function(){
await mvStorageAugments(rgas)
});
const tabs = Array.from(document.querySelectorAll(".mv-plus"));
for (let i = 0; i < tabs.length; i++) {
tabs[i].addEventListener('click',async function(){
const string = await mmplus('AuthCheck|rganame');
const tab = this.outerHTML.match(/id="plus-([^"]*)"/i)[1];
if (tab == "events"){
const events = Array.from(document.querySelectorAll(".woz-top"));
for (let i = 0; i < events.length; i++) {
events[i].addEventListener('click',async function(){
const event = this.innerHTML;
await mvEvents(rgas,event,string);
});
};
document.querySelector("#plus-events-halloween").addEventListener('click', async function(){ await mvHalloween(rgas,string) });
document.querySelector("#plus-events-christmas").addEventListener('click', async function(){ await mvChristmas(rgas,string) });
}
else if (tab == "item-slotting"){
await mvItemSlotting(rgas,string);
}
else if (tab == "max-rage"){
await mvMaxRage(rgas,string);
}
else if (tab == "augment-data"){
await mvAugmentData(rgas,string);
};
});
};
};
};
async function mvCharacterOverview(rgas){
const endpoints = ['profile','supplies'];
const array = await mvFetch(rgas,endpoints);
let totMr = 0;
let totPower = 0;
let totEle = 0;
let totChaos = 0;
let totRpt = 0;
let totSupplies = 0;
const rows = [];
const table = async (i) => {
const charclass = i.profile.class;
const crew = i.profile.crewname;
const rage = i.profile.currentrage.toLocaleString();
const exp = i.profile.exp.toLocaleString();
const tolvl = i.profile.tolevel.toLocaleString();
const today = i.profile.growthtoday.toLocaleString();
const yesterday = i.profile.growthyesterday.toLocaleString();
const strength = i.profile.strength;
const supplies = parseInt(i.supplies.replace(/\s/g,'').match(/([0-9]+)%<\/td>/i)[1])
const gold = i.profile.gold.toLocaleString();
rows.push(`${i.static}${charclass} | ${crew} | ${rage} | ${exp} | ${tolvl} | ${today} | ${yesterday} | ${strength} | ${supplies} | ${gold} | `);
totMr += i.profile.maxrage;
totPower += i.profile.power;
totEle += i.profile.elemental;
totChaos += i.profile.chaos;
totRpt += i.profile.rageperturn;
totSupplies += parseInt(i.supplies.replace(/\s/g,'').match(/([0-9]+)%<\/td>/i)[1])
};
await Promise.all(array.map(table));
const avgSupplies = (totSupplies/array.length).toFixed(2);
document.querySelector("#mvContent").innerHTML = `
TOTAL POWER |
TOTAL ELEMENTAL |
TOTAL CHAOS |
TOTAL RPT |
TOTAL MAX RAGE |
SUPPLIES (MAX ALL) |
${totPower.toLocaleString()} |
${totEle.toLocaleString()} |
${totChaos.toLocaleString()} |
${totRpt.toLocaleString()} |
${totMr.toLocaleString()} |
${avgSupplies}% |
char | | rga | lvl | class | crew | rage | experience | to level | growth today | yesterday | strength | supplies | gold |
${rows.join('')}
`
document.querySelector("#maxAllSuppliesLink").addEventListener('click', async function(){
const loadingDiv = document.createElement("div");
loadingDiv.innerHTML = `loading ⧖`
loadingDiv.id = "loadingDiv"
document.body.appendChild(loadingDiv);
const maxAllSupplies = async (i) => {
const string = i.static.match(/href="profile\?(rg_sess_id=[A-Za-z0-9]+&suid=[0-9]+&serverid=[0-9]+)"/i)[1];
await fetch(`supplies?${string}`, {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({'buymax': 'Buy Max',})})
};
await Promise.all(array.map(maxAllSupplies));
document.querySelector("#avgSupplies").innerHTML = "MAXED"
document.querySelector("#loadingDiv").remove();
});
await sortableTables();
document.querySelector("#loadingDiv").remove();
};
async function mvCharacterStats(rgas){
const endpoints = ['profile','home'];
const array = await mvFetch(rgas,endpoints);
const rows = [];
const table = async (i) => {
const mr = i.profile.maxrage.toLocaleString();
const power = i.profile.power.toLocaleString();
const ele = i.profile.elemental.toLocaleString();
const atk = i.profile.attack.toLocaleString();
const hp = i.profile.hp.toLocaleString();
const chaos = i.profile.chaos.toLocaleString();
const res1 = i.home.holyresist;
const res2 = i.home.arcaneresist;
const res3 = i.home.shadowresist;
const res4 = i.home.fireresist;
const res5 = i.home.kineticresist;
const rpt = i.profile.rageperturn.toLocaleString();
const ept = i.profile.expperturn.toLocaleString();
const ramp = i.profile.rampage.toLocaleString();
const wilderness = i.profile.wilderness.toLocaleString();
const mrrptratio = i.profile.maxrage/i.profile.rageperturn
rows.push(`
${i.static}
${mr} |
${power} |
${ele} |
${atk} |
${hp} |
${chaos} |
${res1} |
${res2} |
${res3} |
${res4} |
${res5} |
${rpt} |
${ramp}% |
${mrrptratio.toFixed(1)} |
${ept} |
${wilderness} |
`);
};
await Promise.all(array.map(table));
document.querySelector("#mvContent").innerHTML = `
char | | rga | lvl | max rage | power | ele | atk | hp | chaos | res | res | res | res | res | rpt | ramp | mr:rpt | ept | wilderness |
${rows.join('')}
`
await sortableTables();
document.querySelector("#loadingDiv").remove();
};
async function mvCharacterFactions(rgas){
const endpoints = ['profile','home'];
const array = await mvFetch(rgas,endpoints);
const rows = [];
const table = async (i) => {
const faction = i.profile.faction;
const a = i.home.alvar;
const d = i.home.delruk;
const v = i.home.vordyn;
const c = i.home.codex;
const t = a + d + v
rows.push(`
${i.static}
${faction} |
${a} |
${d} |
${v} |
${t} |
${c} |
`);
};
await Promise.all(array.map(table));
document.querySelector("#mvContent").innerHTML = `
char | | rga | lvl | current faction | alvar loyalty | delruk loyalty | vordyn loyalty | total loyalty | codex level |
${rows.join('')}
`
await sortableTables();
document.querySelector("#loadingDiv").remove();
};
async function mvCharacterSkills(rgas){
const endpoints = ['home','cast_skills?C=7','profile'];
const array = await mvFetch(rgas,endpoints);
const rows = [];
const table = async (i) => {
const wall = i.skills.match(/alt="Shield Wall"/i) ? "X" : "";
const slayer = i.skills.match(/alt="God Slayer"/i) ? "X" : "";
const grind = i.skills.match(/alt="Daily Grind"/i) ? "X" : "";
const influence = i.skills.match(/alt="Triworld Influence"/i) ? "X" : "";
const skillclass = i.home.skillclass;
const skillpoints = i.home.skillpoints;
const active = i.profile.skills.images;
rows.push(`${i.static}${skillclass} | ${skillpoints} | ${wall} | ${slayer} | ${grind} | ${influence} | ${active.join('')} | `);
};
await Promise.all(array.map(table));
document.querySelector("#mvContent").innerHTML = `
char | | rga | lvl | class | skill points |  |  |  |  | active skills |
${rows.join('')}
`
await sortableTables();
document.querySelector("#loadingDiv").remove();
};
async function mvCharacterUnderlings(rgas){
const endpoints = ['profile','home'];
const array = await mvFetch(rgas,endpoints);
const rows = [];
const table = async (i) => {
const lings = i.profile.underlings;
const loyalty = i.home.underlingloyalty * 10;
const allLings = i.profile.underlingids;
let allLingsAtk = 0;
let allLingsHp = 0;
let allLingsPower = 0;
let allLingsExp = 0;
if (allLings){
const lingLoop = async (lingid) => {
const id = lingid
const lingProfile = await superfetchProfile(`profile?id=${id}`);
allLingsAtk += lingProfile.attack;
allLingsHp += lingProfile.hp;
allLingsPower += lingProfile.power;
allLingsExp += lingProfile.exp;
};
await Promise.all(allLings.map(lingLoop));
}
const maxAtk = allLingsAtk >= 11236 ? "100%" : (allLingsAtk/11236*100).toFixed(1) + "%"
const maxHp = allLingsHp >= 25545 ? "100%" : (allLingsHp/25545*100).toFixed(1) + "%"
rows.push(`${i.static}${lings} | ${allLingsExp.toLocaleString()} | ${allLingsPower.toLocaleString()} | ${loyalty} | ${maxAtk} | ${maxHp} | `);
};
await Promise.all(array.map(table));
document.querySelector("#mvContent").innerHTML = `
char | | rga | lvl | lings | total experience | total power | loyalty enhancement | ATK % MAXED BUFF | HP % MAXED BUFF |
${rows.join('')}
`
await sortableTables();
document.querySelector("#loadingDiv").remove();
};
async function mvCharacterGodSlayer(rgas){
const endpoints = ['profile'];
const array = await mvFetch(rgas,endpoints);
const allgods = await info("All gods data");
const rows = [];
const table = async (i) => {
const crew = i.profile.crewname;
const completed = i.profile.completedgodslayer.split(',');
const allgodsnames = allgods.map(god => god.name.replace(',',''));
const needed = allgodsnames.filter(god => !completed.includes(god));
const list = needed.map(god => god.replace(/(,| ,| the|The).*/gi, ''));
rows.push(`${i.static}${crew} | ${i.profile.godslayer} | ${list.join(', ')} | `);
};
await Promise.all(array.map(table));
document.querySelector("#mvContent").innerHTML = `
`
await filterTables();
await sortableTables();
document.querySelector("#loadingDiv").remove();
};
async function mvCharacterCollections(rgas){
const endpoints = ['collections'];
const array = await mvFetch(rgas,endpoints);
const rows = [];
const table = async (i) => {
const parser = new DOMParser()
const x = parser.parseFromString(i.collections, 'text/html');
const anjou = (x.querySelector("#divCollections > div.row > div:nth-child(1) > div > div > div.user-info.w-100.pr-3 > ul").innerHTML.match(/img/g) || []).length + " / 3"
const reikar = (x.querySelector("#divCollections > div.row > div:nth-child(2) > div > div > div.user-info.w-100.pr-3 > ul").innerHTML.match(/img/g) || []).length + " / 3"
const lorren = (x.querySelector("#divCollections > div.row > div:nth-child(3) > div > div > div.user-info.w-100.pr-3 > ul").innerHTML.match(/img/g) || []).length + " / 3"
const lucile = (x.querySelector("#divCollections > div.row > div:nth-child(4) > div > div > div.user-info.w-100.pr-3 > ul").innerHTML.match(/img/g) || []).length + " / 3"
const weima = (x.querySelector("#divCollections > div.row > div:nth-child(5) > div > div > div.user-info.w-100.pr-3 > ul").innerHTML.match(/img/g) || []).length + " / 3"
const souma = (x.querySelector("#divCollections > div.row > div:nth-child(6) > div > div > div.user-info.w-100.pr-3 > ul").innerHTML.match(/img/g) || []).length + " / 3"
const vanisha = (x.querySelector("#divCollections > div.row > div:nth-child(7) > div > div > div.user-info.w-100.pr-3 > ul").innerHTML.match(/img/g) || []).length + " / 3"
const drolba = (x.querySelector("#divCollections > div.row > div:nth-child(8) > div > div > div.user-info.w-100.pr-3 > ul").innerHTML.match(/img/g) || []).length + " / 3"
const quibel = (x.querySelector("#divCollections > div.row > div:nth-child(9) > div > div > div.user-info.w-100.pr-3 > ul").innerHTML.match(/img/g) || []).length + " / 3"
rows.push(`${i.static}${anjou} | ${reikar} | ${lorren} | ${lucile} | ${weima} | ${souma} | ${vanisha} | ${drolba} | ${quibel} | `);
};
await Promise.all(array.map(table));
document.querySelector("#mvContent").innerHTML = `
char | | rga | lvl | anjou | reikar | lorren | lucile | weima | souma | vanisha | drolba | quibel |
${rows.join('')}
`
await sortableTables();
document.querySelector("#loadingDiv").remove();
};
async function mvCharacterCodex(rgas){
const endpoints = ['changefaction'];
const array = await mvFetch(rgas,endpoints);
const rows = [];
const table = async (i) => {
const completed = (i.changefaction.match(/Triworld Codex Chapter [0-9]+ /g) || ['0']).map(i => parseInt(i.match(/[0-9]+/i)))
const incomplete = [];
for (let i = 1; i <= 50; i++) {
if (!completed.includes(i)) { incomplete.push(i) };
};
rows.push(`${i.static}${completed.length} | ${incomplete.join(',')} | `);
};
await Promise.all(array.map(table));
document.querySelector("#mvContent").innerHTML = `
`
await filterTables();
await sortableTables();
document.querySelector("#loadingDiv").remove();
};
async function mvEquipmentEquipped(rgas,slot){
const endpoints = ['profile'];
const array = await mvFetch(rgas,endpoints);
const rows = [];
const table = async (i) => {
const slotsize = 'height:35px;width:35px'
const mr = i.profile.maxrage.toLocaleString();
const power = i.profile.power.toLocaleString();
const ele = i.profile.elemental.toLocaleString();
const core = ` `
const head = ` `
const neck = ` `
const weapon = ` `
const body = ` `
const shield = ` `
const belt = ` `
const pants = ` `
const ring = ` `
const foot = ` `
const chaosgem = ` `
const badge = ` `
const rune = ` `
const orb1 = ` `
const orb2 = ` `
const orb3 = ` `
rows.push(`${i.static}${power} | ${ele} | ${mr.toLocaleString()} | ${core} | ${head} | ${neck} | ${weapon} | ${body} | ${shield} | ${belt} | ${pants} | ${ring} | ${foot} | ${chaosgem} | ${badge} | ${rune} | ${orb1} | ${orb2} | ${orb3} | `);
};
await Promise.all(array.map(table));
document.querySelector("#mvContent").innerHTML = `
char | | rga | lvl | POW | ELE | MR | COR | HED | NCK | WEP | BDY | SHD | BELT | PNT | RNG | FOT | GEM | BDG | RNE | ORB | ORB | ORB |
${rows.join('').replace(/onclick="[^"]*"/g,'')}
`
await sortableTables();
document.querySelector("#loadingDiv").remove();
};
async function mvEquipmentSlot(rgas,slot){
const endpoints = ['profile'];
const array = await mvFetch(rgas,endpoints);
const rows = [];
const table = async (i) => {
const itemid = i.profile[slot].id;
const itemData = await superfetchItem(itemid);
rows.push(`
${i.static}
${itemData.name} |
 |
${itemData.augs} |
${itemData.gems} |
${itemData.atk.toLocaleString()} |
${itemData.hp.toLocaleString()} |
${itemData.ele.toLocaleString()} |
${itemData.chaosdmg} |
${itemData.resist} |
${itemData.chaosres} |
${itemData.vile} |
${itemData.rpt.toLocaleString()} |
${itemData.ept.toLocaleString()} |
${itemData.rampage}% |
${itemData.critical}% |
${itemData.maxrage.toLocaleString()} |
${itemData.block}% |
${itemData.eleblock}% |
${itemData.ps} |
`);
};
await Promise.all(array.map(table));
document.querySelector("#mvContent").innerHTML = `
char | | rga | lvl | name | img | augs | gem | atk | hp | ele | chs | res | res | vle | rpt | ept | rmp | crt | mr | blk | blk | ps |
${rows.join('')}
`
await sortableTables();
document.querySelector("#loadingDiv").remove();
};
async function mvEquipmentChaosGem(rgas){
const endpoints = ['profile'];
const array = await mvFetch(rgas,endpoints);
const rows = [];
const table = async (i) => {
const itemid = i.profile.gem.id;
const itemData = await superfetchItem(itemid);
rows.push(`
${i.static}
${itemData.name} |
 |
${itemData.chaosdmg.toLocaleString()} |
${itemData.rampage}% |
${itemData.critical}% |
${itemData.maxrage.toLocaleString()} |
`);
};
await Promise.all(array.map(table));
document.querySelector("#mvContent").innerHTML = `
char | | rga | lvl | name | img | chaos | rampage | critical | max rage |
${rows.join('')}
`
await sortableTables();
document.querySelector("#loadingDiv").remove();
};
async function mvEquipmentBadge(rgas){
const endpoints = ['profile'];
const array = await mvFetch(rgas,endpoints);
const rows = [];
const table = async (i) => {
const itemid = i.profile.badge.id;
const itemData = await superfetchItem(itemid);
rows.push(`
${i.static}
${itemData.name} |
 |
${itemData.atk.toLocaleString()} |
${itemData.hp.toLocaleString()} |
${itemData.ele.toLocaleString()} |
`);
};
await Promise.all(array.map(table));
document.querySelector("#mvContent").innerHTML = `
char | | rga | lvl | name | img | atk | hp | elemental |
${rows.join('')}
`
await sortableTables();
document.querySelector("#loadingDiv").remove();
};
async function mvEquipmentOrbs(rgas){
const endpoints = ['profile'];
const array = await mvFetch(rgas,endpoints);
const rows = [];
const table = async (i) => {
const orb1id = i.profile.orb1.id;
const orb2id = i.profile.orb2.id;
const orb3id = i.profile.orb3.id;
const orb1Data = await superfetchItem(orb1id);
const orb2Data = await superfetchItem(orb2id);
const orb3Data = await superfetchItem(orb3id);
rows.push(`
${i.static}
 |
 |
 |
${orb1Data.name} |
${orb2Data.name} |
${orb3Data.name} |
${(orb1Data.maxrage + orb2Data.maxrage + orb3Data.maxrage).toLocaleString()} |
${(orb1Data.ele + orb2Data.ele + orb3Data.ele).toLocaleString()} |
${(orb1Data.atk + orb2Data.atk + orb3Data.atk).toLocaleString()} |
${(orb1Data.hp + orb2Data.hp + orb3Data.hp).toLocaleString()} |
${(orb1Data.rpt + orb2Data.rpt + orb3Data.rpt).toLocaleString()} |
${(orb1Data.ept + orb2Data.ept + orb3Data.ept).toLocaleString()} |
${(orb1Data.chaosdmg + orb2Data.chaosdmg + orb3Data.chaosdmg).toLocaleString()} |
`);
};
await Promise.all(array.map(table));
document.querySelector("#mvContent").innerHTML = `
char | | rga | lvl | img | img | img | orb 1 | orb 2 | orb 3 | mr | ele | atk | hp | rpt | ept | chaos |
${rows.join('')}
`
await sortableTables();
document.querySelector("#loadingDiv").remove();
};
async function mvEquipmentRune(rgas){
const endpoints = ['profile','ajax/backpackcontents.php?tab=quest'];
const array = await mvFetch(rgas,endpoints);
const rows = [];
const table = async (i) => {
const fusers = (i.quest.match(/data-name="Elemental Fuser" data-itemqty="([0-9]+)"/i) || [0,0])[1];
const itemid = i.profile.rune.id;
const itemData = await superfetchItem(itemid);
rows.push(`
${i.static}
${itemData.name} |
 |
${itemData.ele.toLocaleString()} |
${fusers} |
`);
};
await Promise.all(array.map(table));
document.querySelector("#mvContent").innerHTML = `
char | | rga | lvl | name | img | elemental |  |
${rows.join('')}
`
await sortableTables();
document.querySelector("#loadingDiv").remove();
};
async function mvEquipmentBooster(rgas){
const endpoints = ['profile'];
const array = await mvFetch(rgas,endpoints);
const rows = [];
const table = async (i) => {
const itemid = i.profile.booster.id;
const itemData = await superfetchItem(itemid);
rows.push(`
${i.static}
${itemData.name} |
 |
`);
};
await Promise.all(array.map(table));
document.querySelector("#mvContent").innerHTML = `
char | | rga | lvl | booster | img |
${rows.join('')}
`
await sortableTables();
document.querySelector("#loadingDiv").remove();
};
async function mvEquipmentCrests(rgas){
const endpoints = ['profile'];
const array = await mvFetch(rgas,endpoints);
const rows = [];
const table = async (i) => {
const crest1 = await superfetchItem(i.profile.ccrest.id);
const crest2 = await superfetchItem(i.profile.pcrest.id);
const crest3 = await superfetchItem(i.profile.fcrest.id);
const crest4 = await superfetchItem(i.profile.acrest.id);
rows.push(
`
${i.static}
 |
 |
 |
 |
${crest1.name} |
${crest3.name} |
${crest2.name} |
${crest4.name} |
`
);
};
await Promise.all(array.map(table));
document.querySelector("#mvContent").innerHTML = `
char | | rga | lvl | img | img | img | img | class | ferocity | preservation | affliction |
${rows.join('')}
`
await sortableTables();
document.querySelector("#loadingDiv").remove();
};
async function mvEquipmentAugments(rgas){
const endpoints = ['profile'];
const array = await mvFetch(rgas,endpoints);
const rows = [];
let totalOpen = 0;
const table = async (i) => {
const core = await superfetchItem(i.profile.core.id);
const head = await superfetchItem(i.profile.head.id);
const neck = await superfetchItem(i.profile.neck.id);
const weapon = await superfetchItem(i.profile.weapon.id);
const body = await superfetchItem(i.profile.body.id);
const shield = await superfetchItem(i.profile.shield.id);
const belt = await superfetchItem(i.profile.belt.id);
const pants = await superfetchItem(i.profile.pants.id);
const ring = await superfetchItem(i.profile.ring.id);
const foot = await superfetchItem(i.profile.foot.id);
const allaugs = core.augs + head.augs + neck.augs + weapon.augs + body.augs + shield.augs + belt.augs + pants.augs + ring.augs + foot.augs
const augcount = (allaugs.match(/itempopup\(event,'[0-9]+_[0-9]+'\)/g) || []).length
totalOpen += core.openaugs + head.openaugs + neck.openaugs + weapon.openaugs + body.openaugs + shield.openaugs + belt.openaugs + pants.openaugs + ring.openaugs + foot.openaugs
rows.push(`${i.static}${augcount} | ${allaugs} | `)
};
await Promise.all(array.map(table));
document.querySelector("#mvContent").innerHTML = `
TOTAL OPEN AUG SLOTS |
${totalOpen} |
char | | rga | lvl | count | slotted augments |
${rows.join('')}
`
await sortableTables();
document.querySelector("#loadingDiv").remove();
};
async function mvStorageUtility(rgas){
const endpoints = ['ajax/backpackcontents.php?tab=utility'];
const array = await mvFetch(rgas,endpoints);
const rows = [];
const table = async (i) => {
const bpCapacity = parseInt(i.utility.match(/data-maxval="([0-9]+)"/i)[1]);
const bpCount = parseInt(i.utility.match(/data-curitemct="([0-9]+)"/i)[1]);
const bpOpen = bpCapacity-bpCount;
const match = i.utility.replace(/\s+/g, ' ').replace(/[\n\r]/g,'').match(/src="[^"]*" alt="[^"]*" ONMOUSEOVER="itempopup\(event,'[0-9]+'\)"/g) || [];
const items = match.length < 250 ? match.map(i => ` `) : ['Too many items to display'];
rows.push(`
${i.static}
${bpCount} |
${bpCapacity} |
${bpOpen} |
${items.join('')} |
`);
};
await Promise.all(array.map(table));
document.querySelector("#mvContent").innerHTML = `
char | | rga | lvl | count | capacity | open slots | backpack items |
${rows.join('')}
`
const selectable = document.querySelectorAll('img.mv-selectable');
for (var i = 0; i < selectable.length; i++){
const item = selectable[i];
item.addEventListener('click', async function(){
item.classList.toggle('mv-backpack-selected')
})
}
await sortableTables();
document.querySelector("#loadingDiv").remove();
};
async function mvStorageBackpack(rgas){
const endpoints = ['ajax/backpackcontents.php?tab=regular'];
const array = await mvFetch(rgas,endpoints);
const rows = [];
const table = async (i) => {
const bpCapacity = parseInt(i.regular.match(/data-maxval="([0-9]+)"/i)[1]);
const bpCount = parseInt(i.regular.match(/data-curitemct="([0-9]+)"/i)[1]);
const bpOpen = bpCapacity-bpCount;
const match = i.regular.replace(/\s+/g, ' ').replace(/[\n\r]/g,'').match(/src="[^"]*" alt="[^"]*" ONMOUSEOVER="itempopup\(event,'[0-9]+'\)"/g) || [];
const items = match.length < 250 ? match.map(i => ` `) : ['Too many items to display'];
rows.push(`
${i.static}
${bpCount} |
${bpCapacity} |
${bpOpen} |
${items.join('')} |
`);
};
await Promise.all(array.map(table));
document.querySelector("#mvContent").innerHTML = `
char | | rga | lvl | count | capacity | open slots | backpack items |
${rows.join('')}
`
const selectable = document.querySelectorAll('img.mv-selectable');
for (var i = 0; i < selectable.length; i++){
const item = selectable[i];
item.addEventListener('click', async function(){
item.classList.toggle('mv-backpack-selected')
})
}
await sortableTables();
document.querySelector("#loadingDiv").remove();
};
async function mvStorageItems(rgas,tab){
const endpoints = [`ajax/backpackcontents.php?tab=${tab}`];
const array = await mvFetch(rgas,endpoints);
const headerArray = [];
const itemsList = async (i) => {
const itemsParse = i[tab].replace(/\s+/g, ' ').replace(/[\n\r]/g,'').replace(/'/g,'').match(/src="[^"]*" alt="[^"]*"/g);
if (itemsParse){
for (let n = 0; n < itemsParse.length; n++) {
headerArray.push(itemsParse[n]);
};
};
};
await Promise.all(array.map(itemsList));
headerArray.sort((a, b) => {
const altA = a.match(/alt="([^"]*)"/)[1];
const altB = b.match(/alt="([^"]*)"/)[1];
return altA.localeCompare(altB);
});
const header = ([...new Set(headerArray)]).map(i => `![]() | `);
const noOfTables = Math.ceil(header.length/18);
const headers = []
const rows = []
for (let i = 0; i < noOfTables; i++) {
const slicedHeader = header.slice(i*18,(i+1)*18);
headers[i+1] = slicedHeader;
const row = []
const table = async (a) => {
const names = slicedHeader.join('').match(/event,'[^']*'/g).map(p => p.match(/'([^']*)'/)[1]);
const item = a[tab].replace(/\s+/g, ' ').replace(/[\n\r]/g,'').replace(/'/g,'');
let cells = a.static;
for (let n = 0; n < names.length; n++) {
const regex = new RegExp(`data-itemidqty="[0-9]+" data-name="${names[n]}"`);
const count = (item.match(regex) || ['itemidqty="0"']).map(m => m.match(/itemidqty="([0-9]+)"/)[1]);
cells += '' + count + ' | ';
};
row.push('' + cells + ' ');
};
await Promise.all(array.map(table));
rows[i+1] = row;
};
document.querySelector("#mvContent").innerHTML = `
char | | rga | lvl | ${headers[1].join('')}
${rows[1].join('')}
`
if (noOfTables > 1){
const tableLinks = [];
for (let i = 0; i < noOfTables; i++) {
tableLinks.push(`${i+1}`)
};
document.querySelector("#tableNoSpan").innerHTML = `${tableLinks.join('')}`
for (let i = 0; i < noOfTables; i++) {
document.querySelector(`#items-table-${i+1}`).addEventListener('click', async function(){
document.querySelector("#mv-table-container").innerHTML = `
char | | rga | lvl | ${headers[i+1].join('')}
${rows[i+1].join('')}
`
await sortableTables();
});
};
};
await sortableTables();
document.querySelector("#loadingDiv").remove();
}
async function mvStorageEquipment(rgas){
const endpoints = ['augmentequip'];
const array = await mvFetch(rgas,endpoints);
const rows = [];
let tableMsg = ''
const table = async (i) => {
if (i.augmentequip.match(/ |