MoxxiMod

one click at a time

当前为 2022-06-20 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         MoxxiMod
// @namespace    https://studiomoxxi.com/
// @description  one click at a time
// @author       Ben
// @match        *.outwar.com/*
// @version      4.4
// @grant        GM_xmlhttpRequest
// @license      MIT
// @grant        GM_getResourceText
// @grant        GM_addStyle
// @require      http://code.jquery.com/jquery-3.6.0.min.js
// ==/UserScript==


// moxximod raid results menu and styling

if (document.URL.indexOf("crew_raidresults") != -1 ) {
document.querySelector("#content-header-row > table > tbody > tr > td > form > p > input:nth-child(3)").setAttribute("value", "MoxxiMod raid results");
};

if (document.URL.indexOf("crew_raidresults.php?most_recent=MoxxiMod") != -1 ) {
GM_addStyle ( `#content-header-row > table > tbody > tr > td > div > center > div > table{background:#0B0B0B !important;}
td:nth-of-type(3){display: none;}
td:nth-of-type(4){display: none;}
td:nth-of-type(5){display: none;}
`);

var changeHeader0 = document.querySelector("#content-header-row > table > tbody > tr > td > div > center > div > table")
changeHeader0.rows[0].cells[0].innerHTML = `<a onmouseover="popup\(event,'Raid time'\)" onmouseout="kill\(\)"><font color=#c2c2c2><b>TIME`

var changeHeader1 = document.querySelector("#content-header-row > table > tbody > tr > td > div > center > div > table")
changeHeader1.rows[0].cells[1].innerHTML = `<a onmouseover="popup\(event,'Raid god, mob or boss'\)" onmouseout="kill\(\)"><font color=#c2c2c2><b>RAID`

// moxximod raid results header row

function insertAfter2(newNode, existingNode) {
existingNode.parentNode.insertBefore(newNode, existingNode.nextSibling);
}

let rrHead11 = document.querySelector("#content-header-row > table > tbody > tr > td > div > center > div > table > tbody > tr");
let tdHead11 = document.createElement('td');
tdHead11.innerHTML = `<a onmouseover="popup\(event,'Total chars in the raid<br>(number of chars who died)'\)" onmouseout="kill\(\)"><font color=#c2c2c2><b>CHARS`;
insertAfter2(tdHead11, rrHead11.lastElementChild);

let rrHead1 = document.querySelector("#content-header-row > table > tbody > tr > td > div > center > div > table > tbody > tr");
let tdHead1 = document.createElement('td');
tdHead1.innerHTML = `<a onmouseover="popup\(event,'Total amount of attack damage<br>Mouseover to see details'\)" onmouseout="kill\(\)"><font color=#c2c2c2><b>DAMAGE`;
insertAfter2(tdHead1, rrHead1.lastElementChild);

let rrHead2 = document.querySelector("#content-header-row > table > tbody > tr > td > div > center > div > table > tbody > tr");
let tdHead2 = document.createElement('td');
tdHead2.innerHTML = `<a onmouseover="popup\(event,'Average amount of attack damage per char'\)" onmouseout="kill\(\)"><font color=#c2c2c2><b>AVG`;
insertAfter2(tdHead2, rrHead2.lastElementChild);

let rrHead6 = document.querySelector("#content-header-row > table > tbody > tr > td > div > center > div > table > tbody > tr");
let tdHead6 = document.createElement('td');
tdHead6.innerHTML = `<a onmouseover="popup\(event,'Average block rate of all chars'\)" onmouseout="kill\(\)"><font color="ff9e00"><b>BLOCK`;
insertAfter2(tdHead6, rrHead6.lastElementChild);

let rrHead7 = document.querySelector("#content-header-row > table > tbody > tr > td > div > center > div > table > tbody > tr");
let tdHead7 = document.createElement('td');
tdHead7.innerHTML = `<a onmouseover="popup\(event,'Average ele block rate of all chars'\)" onmouseout="kill\(\)"><font color="00ff0b"><b>BLOCK`;
insertAfter2(tdHead7, rrHead7.lastElementChild);

let rrHead13 = document.querySelector("#content-header-row > table > tbody > tr > td > div > center > div > table > tbody > tr");
let tdHead13 = document.createElement('td');
tdHead13.innerHTML = `<a onmouseover="popup\(event,'Average ele shield rate of all chars'\)" onmouseout="kill\(\)"><font color=#c2c2c2><b>SHIELD`;
insertAfter2(tdHead13, rrHead13.lastElementChild);

let rrHead14 = document.querySelector("#content-header-row > table > tbody > tr > td > div > center > div > table > tbody > tr");
let tdHead14 = document.createElement('td');
tdHead14.innerHTML = `<a onmouseover="popup\(event,'Total number of individual attacks executed'\)" onmouseout="kill\(\)"><font color=#c2c2c2><b>ATKS`;
insertAfter2(tdHead14, rrHead14.lastElementChild);

let rrHead10 = document.querySelector("#content-header-row > table > tbody > tr > td > div > center > div > table > tbody > tr");
let tdHead10 = document.createElement('td');
tdHead10.innerHTML = `<a onmouseover="popup\(event,'Total number of rounds'\)" onmouseout="kill\(\)"><font color=#c2c2c2><b>RNDS`;
insertAfter2(tdHead10, rrHead10.lastElementChild);

let rrHead12 = document.querySelector("#content-header-row > table > tbody > tr > td > div > center > div > table > tbody > tr");
let tdHead12 = document.createElement('td');
tdHead12.innerHTML = `<a onmouseover="popup\(event,'Was SIN applied during the raid?'\)" onmouseout="kill\(\)"><font color=#c2c2c2><b>SIN`;
insertAfter2(tdHead12, rrHead12.lastElementChild);

let rrHead5 = document.querySelector("#content-header-row > table > tbody > tr > td > div > center > div > table > tbody > tr");
let tdHead5 = document.createElement('td');
tdHead5.innerHTML = `<a onmouseover="popup\(event,'Remaining health of the mob'\)" onmouseout="kill\(\)"><font color=#c2c2c2><b>HEALTH`;
insertAfter2(tdHead5, rrHead5.lastElementChild);

let rrHead4 = document.querySelector("#content-header-row > table > tbody > tr > td > div > center > div > table > tbody > tr");
let tdHead4 = document.createElement('td');
tdHead4.innerHTML = `<a onmouseover="popup\(event,'Items dropped from raid'\)" onmouseout="kill\(\)"><font color=#c2c2c2><b>LOOT`;
insertAfter2(tdHead4, rrHead4.lastElementChild);

// moxximod raid results data scrape

var rrTable = document.querySelector("#content-header-row > table > tbody > tr > td > div > center > div > table");
var rrRowCount = 1+rrTable.rows.length;


for (let rownum = 2; rownum < rrRowCount; rownum++) {

let raidLink11 = '';
if (document.querySelector("#content-header-row > table > tbody > tr > td > div > center > div > table > tbody > tr:nth-child("+rownum+") > td:nth-child(5) > a") != null)
raidLink11 = document.querySelector("#content-header-row > table > tbody > tr > td > div > center > div > table > tbody > tr:nth-child("+rownum+") > td:nth-child(5) > a");

let row11 = document.querySelector("#content-header-row > table > tbody > tr > td > div > center > div > table > tbody > tr:nth-child("+rownum+")")
let chars11 = document.querySelector("#content-header-row > table > tbody > tr > td > div > center > div > table > tbody > tr:nth-child("+rownum+") > td:nth-child(3)").innerHTML;

let raidNameCell = document.querySelector("#content-header-row > table > tbody > tr > td > div > center > div > table > tbody > tr:nth-child("+rownum+") > td:nth-child(2)");
let raidName = '';
if (raidNameCell != null)
raidNameCell.innerHTML = '<a href='+raidLink11+'>'+raidNameCell.innerHTML.replaceAll(/,.*/g,"").replaceAll(/of.*/g,"").replaceAll("The","").replaceAll(/the.*/g,"").replaceAll(/the.*/g,"")+'</a>';

let timeStampCell = document.querySelector("#content-header-row > table > tbody > tr > td > div > center > div > table > tbody > tr:nth-child("+rownum+") > td:nth-child(1)");
let timeStampName = '';
if (timeStampCell != null)
timeStampCell.innerHTML = timeStampCell.innerHTML.replaceAll(/[0-9]+-[0-9]+-[0-9]+/g,"");

GM_xmlhttpRequest ( {
    method:     'GET',
    url:        raidLink11,
    onload:     function (responseDetails) {

var raidDmg11 = /Damage: ([0-9,]*)/;
var printDmg11 = raidDmg11.exec(responseDetails.responseText);

var raidDrops11 = /<a href="#" onmouseover="popup\(event,'([^']*)'\)" onmouseout="kill\(\)">[0-9]+ items<\/a>/i;
var printDrops11 = raidDrops11.exec(responseDetails.responseText);

var drops11 = '';
if (printDrops11 == null)
drops11 = `<b>No items found`
if (printDrops11 != null)
drops11 = printDrops11[1]

var raidHealth11 = /([0-9]+)%<\/span><\/div>.*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r]<span id=/i;
var printHealth11 = raidHealth11.exec(responseDetails.responseText);

var health11 = '';
if (printHealth11[1] < 1)
health11 = `<font color=#02B602><b>`+printHealth11[1]+`%</font>`
if (printHealth11[1] > 0)
health11 = `<font color=#FF0000><b>`+printHealth11[1]+`%</font>`

fetch(raidLink11)
   .then(response => response.text())
   .then((response) => {

var attacks11 = response.match(/Base: [0-9]+/g).length;
var blocks11 = response.match(/images\/block\.jpg/g);
var eleblocks11 = response.match(/images\/block2\.jpg/g);
var shields11 = response.match(/_ele_shield\.jpg/g);
var dead11 = response.match(/images\/dead\.jpg/g);
var rounds11 = response.match(/\/img\/skin\/Bar_separator_little\.png/g).length;
var sincheck11 = response.match(/color:#CC0000;"><b>(.*)<\/b>/i);

const reducer = (accumulator, curr) => accumulator + curr

var BaseDmgArray = [];
var BaseMatch = response.matchAll(/onmouseover="popup\(event,.*Base: (.*)<div/g);
for (const BaseMatchLoop of BaseMatch) {
let BaseObj = [parseInt(BaseMatchLoop[1].replace(",",""))];
for (const BaseDmg of BaseObj) {
BaseDmgArray.push(BaseDmg);}}
var BaseNumbers = BaseDmgArray.map(Number)
var BaseDmgCheck = '';
if (BaseNumbers != "")
BaseDmgCheck = BaseNumbers
if (BaseNumbers == "")
BaseDmgCheck = [0]
var SumOfBase = BaseDmgCheck.reduce(reducer).toLocaleString("en-US");
var printBase = "<font color=#FFFFFF><b>+"+SumOfBase+" base<br>"

var FireDmgArray = [];
var FireMatch = response.matchAll(/onmouseover="popup\(event,.*\+(.*) fire/g);
for (const FireMatchLoop of FireMatch) {
let FireObj = [parseInt(FireMatchLoop[1].replace(",",""))];
for (const FireDmg of FireObj) {
FireDmgArray.push(FireDmg);}}
var FireNumbers = FireDmgArray.map(Number)
var FireDmgCheck = '';
if (FireNumbers != "")
FireDmgCheck = FireNumbers
if (FireNumbers == "")
FireDmgCheck = [0]
var SumOfFire = FireDmgCheck.reduce(reducer).toLocaleString("en-US");
var printFire = "<font color=#ff0000><b>+"+SumOfFire+" fire<br>"

var ShadowDmgArray = [];
var ShadowMatch = response.matchAll(/onmouseover="popup\(event,.*\+(.*) shadow/g);
for (const ShadowMatchLoop of ShadowMatch) {
let ShadowObj = [parseInt(ShadowMatchLoop[1].replace(",",""))];
for (const ShadowDmg of ShadowObj) {
ShadowDmgArray.push(ShadowDmg);}}
var ShadowNumbers = ShadowDmgArray.map(Number)
var ShadowDmgCheck = '';
if (ShadowNumbers != "")
ShadowDmgCheck = ShadowNumbers
if (ShadowNumbers == "")
ShadowDmgCheck = [0]
var SumOfShadow = ShadowDmgCheck.reduce(reducer).toLocaleString("en-US");
var printShadow = "<font color=#9f02d3><b>+"+SumOfShadow+" shadow<br>"

var HolyDmgArray = [];
var HolyMatch = response.matchAll(/onmouseover="popup\(event,.*\+(.*) holy/g);
for (const HolyMatchLoop of HolyMatch) {
let HolyObj = [parseInt(HolyMatchLoop[1].replace(",",""))];
for (const HolyDmg of HolyObj) {
HolyDmgArray.push(HolyDmg);}}
var HolyNumbers = HolyDmgArray.map(Number)
var HolyDmgCheck = '';
if (HolyNumbers != "")
HolyDmgCheck = HolyNumbers
if (HolyNumbers == "")
HolyDmgCheck = [0]
var SumOfHoly = HolyDmgCheck.reduce(reducer).toLocaleString("en-US");
var printHoly = "<font color=#00FFFF><b>+"+SumOfHoly+" holy<br>"

var ArcaneDmgArray = [];
var ArcaneMatch = response.matchAll(/onmouseover="popup\(event,.*\+(.*) arcane/g);
for (const ArcaneMatchLoop of ArcaneMatch) {
let ArcaneObj = [parseInt(ArcaneMatchLoop[1].replace(",",""))];
for (const ArcaneDmg of ArcaneObj) {
ArcaneDmgArray.push(ArcaneDmg);}}
var ArcaneNumbers = ArcaneDmgArray.map(Number)
var ArcaneDmgCheck = '';
if (ArcaneNumbers != "")
ArcaneDmgCheck = ArcaneNumbers
if (ArcaneNumbers == "")
ArcaneDmgCheck = [0]
var SumOfArcane = ArcaneDmgCheck.reduce(reducer).toLocaleString("en-US");
var printArcane = "<font color=#FFFF00><b>+"+SumOfArcane+" arcane<br>"

var KineticDmgArray = [];
var KineticMatch = response.matchAll(/onmouseover="popup\(event,.*\+(.*) kinetic/g);
for (const KineticMatchLoop of KineticMatch) {
let KineticObj = [parseInt(KineticMatchLoop[1].replace(",",""))];
for (const KineticDmg of KineticObj) {
KineticDmgArray.push(KineticDmg);}}
var KineticNumbers = KineticDmgArray.map(Number)
var KineticDmgCheck = '';
if (KineticNumbers != "")
KineticDmgCheck = KineticNumbers
if (KineticNumbers == "")
KineticDmgCheck = [0]
var SumOfKinetic = KineticDmgCheck.reduce(reducer).toLocaleString("en-US");
var printKinetic = "<font color=#00FF00><b>+"+SumOfKinetic+" kinetic<br>"

var VileDmgArray = [];
var VileMatch = response.matchAll(/onmouseover="popup\(event,.*\+(.*) vile/g);
for (const VileMatchLoop of VileMatch) {
let VileObj = [parseInt(VileMatchLoop[1].replace(",",""))];
for (const VileDmg of VileObj) {
VileDmgArray.push(VileDmg);}}
var VileNumbers = VileDmgArray.map(Number)
var VileDmgCheck = '';
if (VileNumbers != "")
VileDmgCheck = VileNumbers
if (VileNumbers == "")
VileDmgCheck = [0]
var SumOfVile = VileDmgCheck.reduce(reducer).toLocaleString("en-US");
var printVile = "<font color=#cccccc><b>+"+SumOfVile+" vile energy<br>"

var ChaosDmgArray = [];
var ChaosMatch = response.matchAll(/onmouseover="popup\(event,.*\+(.*) chaos/g);
for (const ChaosMatchLoop of ChaosMatch) {
let ChaosObj = [parseInt(ChaosMatchLoop[1].replace(",",""))];
for (const ChaosDmg of ChaosObj) {
ChaosDmgArray.push(ChaosDmg);}}
var ChaosNumbers = ChaosDmgArray.map(Number)
var ChaosDmgCheck = '';
if (ChaosNumbers != "")
ChaosDmgCheck = ChaosNumbers
if (ChaosNumbers == "")
ChaosDmgCheck = [0]
var SumOfChaos = ChaosDmgCheck.reduce(reducer).toLocaleString("en-US");
var printChaos = "<font color=#f441be><b>+"+SumOfChaos+" chaos"

var totdead11 = '';
if (dead11 != null)
totdead11 = (dead11.length).toFixed(0)
if (dead11 == null)
totdead11 += "0"

var shieldrate11 = '';
if (shields11 != null)
shieldrate11 = (shields11.length/attacks11*100).toFixed(1)
if (shields11 == null)
shieldrate11 += "0.0"

var sin11 = '';
if (sincheck11[1] != "0")
sin11 += "No"
if (sincheck11[1] == "0")
sin11 += "Yes"

var blockrate11 = '';
if (blocks11 != null)
blockrate11 += (blocks11.length/attacks11*100).toFixed(1)
if (blocks11 == null)
blockrate11 += "0.0"

var eleblockrate11 = '';
if (eleblocks11 != null)
eleblockrate11 = (eleblocks11.length/attacks11*100).toFixed(1)
if (eleblocks11 == null)
eleblockrate11 += "0.0"

let td112 = document.createElement('td');
td112.innerHTML = chars11+" (<span>&#128369;</span>"+totdead11+")";
insertAfter2(td112, row11.lastElementChild);

var damage11 = printDmg11[1];

let td11 = document.createElement('td');
td11.innerHTML = `<span class="dmgbox-text" onmouseover="popup(event,'</center>`+printBase+printFire+printShadow+printHoly+printArcane+printKinetic+printVile+printChaos+`');" onmouseout="kill();">`+damage11;
insertAfter2(td11, row11.lastElementChild);

var cells11 = row11.getElementsByTagName("td");

let td12 = document.createElement('td');
var td12comma = Math.floor(printDmg11[1].replace(/,/g, '')/cells11[2].innerText);
td12.textContent = td12comma.toLocaleString("en-US");
insertAfter2(td12, row11.lastElementChild);

let td61 = document.createElement('td');
td61.innerHTML = blockrate11+"%";
insertAfter2(td61, row11.lastElementChild);

let td71 = document.createElement('td');
td71.innerHTML = eleblockrate11+"%";
insertAfter2(td71, row11.lastElementChild);

let td111 = document.createElement('td');
td111.innerHTML = shieldrate11+"%";
insertAfter2(td111, row11.lastElementChild);

let td13 = document.createElement('td');
td13.innerHTML = attacks11;
insertAfter2(td13, row11.lastElementChild);

let td91 = document.createElement('td');
td91.innerHTML = rounds11;
insertAfter2(td91, row11.lastElementChild);

let td101 = document.createElement('td');
td101.innerHTML = sin11;
insertAfter2(td101, row11.lastElementChild);

let td51 = document.createElement('td');
td51.innerHTML = health11;
insertAfter2(td51, row11.lastElementChild);

let td41 = document.createElement('td');
td41.innerHTML = drops11.replaceAll(/Amulet Chest \(.*\),/g,"").replaceAll(/,/g,"<br>");
insertAfter2(td41, row11.lastElementChild);

});}})}}

// world

function doc_keyUp(e) {
    if (e.key === '1') {
            document.querySelector("#roomDetails > ul > li:nth-child(1) > div > div.ml-3.d-block.align-self-center > a > img").click();}
    if (e.key === '2') {
            document.querySelector("#roomDetails > ul > li:nth-child(2) > div > div.ml-3.d-block.align-self-center > a > img").click();}
    if (e.key === '3') {
            document.querySelector("#roomDetails > ul > li:nth-child(3) > div > div.ml-3.d-block.align-self-center > a > img").click();}
    if (e.key === '4') {
            document.querySelector("#roomDetails > ul > li:nth-child(4) > div > div.ml-3.d-block.align-self-center > a > img").click();}
    if (e.key === '5') {
            document.querySelector("#roomDetails > ul > li:nth-child(5) > div > div.ml-3.d-block.align-self-center > a > img").click();}
    if (e.key === '6') {
            document.querySelector("#roomDetails > ul > li:nth-child(6) > div > div.ml-3.d-block.align-self-center > a > img").click();}
    if (e.key === '7') {
            document.querySelector("#roomDetails > ul > li:nth-child(7) > div > div.ml-3.d-block.align-self-center > a > img").click();}
    if (e.key === '8') {
            document.querySelector("#roomDetails > ul > li:nth-child(8) > div > div.ml-3.d-block.align-self-center > a > img").click();}
    if (e.key === '9') {
            document.querySelector("#roomDetails > ul > li:nth-child(9) > div > div.ml-3.d-block.align-self-center > a > img").click();}}

document.addEventListener('keyup', doc_keyUp, false);

if ( document.URL.indexOf("world") != -1 ) {
let observer = new MutationObserver(mutationRecords => {
  attackframe()
});
observer.observe(roomid_display, {
  childList: true,
  subtree: true,
  characterDataOldValue: true
});

function attackframe(){
$('a[target="_blank"]').prop("target", "attack");
};}

if (document.URL.indexOf("plrattack") != -1 ) {
$("#sidebar").hide()
$("body > center > div.sub-header-container").hide()
$("body > center > div.header-container.fixed-top").hide()
$("#ranks-filters > form > div").hide()
GM_addStyle ( `
#container{background:#0B0B0B !important;}
#content > div.layout-px-spacing{margin-top: -50px !important;background:#0B0B0B !important;}
.mr-3, .mx-3 {margin-right: 0rem!important;}
#content-header-row > center{zoom: 90% !important;}
` );}

if ( document.URL.indexOf("world") != -1 ) {
var theImage8;
theImage8 = document.querySelector("#content-header-row > div.col-xl-5.col-lg-12.col-md-6.col-sm-12.col-12.layout-spacing.px-1 > div > div.widget-content > div.room-top")
theImage8.innerHTML =
'<iframe src="" name="attack" style="border:0px #ffffff none;" scrolling="no" frameborder="0" height="450px" width="750px"></iframe>'}

if ( document.URL.indexOf("world") != -1 ) {
GM_addStyle ( `
#roomDetails > ul > li > div > div.mr-3 > img {display:none !important;}
#ranks > li > div > div.mr-3 > div > div.rank-row-image > a{width: 0px !important;}
#ranks > li > div > div.media-body{text-align: left !important;}

.mr-3, .mx-3 {margin-right: 0rem!important;}
#content-header-row > div.col-xl-5.col-lg-12.col-md-6.col-sm-12.col-12.layout-spacing.px-1 > div > div.widget-content > div.room-middle{display:none !important;}
.spawnRow{padding-top:0px !important;padding-bottom:0px !important;}
#roomDetails > ul > li {
display: block !important;
list-style-type: disc !important;
margin-block-start: 0em !important;
margin-block-end: 0em !important;
margin-inline-start: 0px !important;
margin-inline-end: 0px !important;
padding-inline-start: 0px !important;
}
` );}

// redefined

if ( document.URL.indexOf("scratch_ticket") != -1 ) {
var theImage2;
theImage2 = document.querySelector("#content > div.layout-px-spacing")
theImage2.innerHTML = '<div id="contentframe" style="position:fixed; top: 100px; left: -65px;">' +
'<iframe src="https://www.redefined.ro/?Quests" style="border:0px #ffffff none;" name="redefined" scrolling="yes" frameborder="0" marginheight="0px" marginwidth="0px" height="800px" width="1600px" allowfullscreen></iframe>' +
'</div>'}

// sess id

var byptlink = document.querySelector("#accordionExample > a");
var sessid = byptlink.href.replace(/https:\/\/rampidgaming.outwar.com\/stripe_buy\?game=ow&outwar=0&wsrv=\$subDomain&lvl=\$user\[level]&rg_sess_id=/, ' ');
var bypplink = document.querySelector("#components > li:nth-child(12) > a")

// custom side menu

var theImage;
theImage = document.querySelector("#sidebar");
theImage.innerHTML = '<div class="sidebar-wrapper sidebar-theme">'+
'<nav id="sidebar">'+
'<div class="shadow-bottom"></div>'+
'<ul class="list-unstyled menu-categories ps" id="accordionExample">'+

'<li class="menu">'+
'<a href="/home" class="dropdown-toggle">'+
'<div class="">'+
'<i class="fa fa-home"></i>'+
'<span> HOME</span>'+
'</div>'+
'</a>'+
'</li>'+

'<li class="menu">'+
'<a href="#components" data-toggle="collapse" aria-expanded="false" class="dropdown-toggle">'+
'<div class="">'+
'<i class="fas fa-user fa-fw"></i>'+
'<span> CHARACTER</span>'+
'</div>'+
'<div>'+
'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-right"><polyline points="9 18 15 12 9 6"></polyline></svg>'+
'</div>'+
'</a>'+
'<ul class="collapse submenu list-unstyled" id="components" data-parent="#accordionExample">'+

'<li><a href="/profile"> PROFILE</a></li>'+
'<li><a href="/ow_messagecenter"> MESSAGE CENTER</a></li>'+
'<li><a href="/cast_skills"> SKILLS</a></li>'+
'<li><a href="/allies"> MY ALLIES</a></li>'+
'<li><a href="/underlings"> UNDERLINGS</a></li>'+
'<li><a href="/user_preferences"> PREFERENCES</a></li>'+
'</ul>'+
'</li>'+

'<li class="menu">'+
'<a href="#server" data-toggle="collapse" aria-expanded="false" class="dropdown-toggle">'+
'<div class="">'+
'<i class="fas fa-server fa-fw"></i>'+
'<span> SERVER</span>'+
'</div>'+
'<div>'+
'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-right"><polyline points="9 18 15 12 9 6"></polyline></svg>'+
'</div>'+
'</a>'+
'<ul class="collapse submenu list-unstyled" id="server" data-parent="#accordionExample">'+
'<li><a href="/attack_search"> SEARCH</a></li>'+
'<li><a href="/newrankings"> RANKINGS</a></li>'+
'<li><a href="/gladiator"> GLADIATORS</a></li>'+
'<li><a href="/event?eventid=woz"> WAR OF ZHUL</a></li>'+
'<li><a href="/event?eventid=top"> TRIAL OF POWER</a></li>'+
'<li><a href="/kotw"> KOTW</a></li>'+
'<li><a href="/news"> NEWS</a></li>'+
'</ul>'+
'</li>'+

'<li class="menu">'+
'<a href="#elements" data-toggle="collapse" aria-expanded="false" class="dropdown-toggle">'+
'<div class="">'+
'<i class="fa fa-shopping-cart fa-fw"></i>'+
'<span> ECONOMY</span>'+
'</div>'+
'<div>'+
'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-right"><polyline points="9 18 15 12 9 6"></polyline></svg>'+
'</div>'+
'</a>'+
'<ul class="collapse submenu list-unstyled" id="elements" data-parent="#accordionExample">'+
'<li><a href="/treasury?type=-1"> BUY ITEMS</a></li>'+
'<li><a href="/mytreasury"> SELL ITEMS</a></li>'+
'<li><a href="/supplies"> SUPPLIES</a></li>'+
'<li><a href="/pointtransfer"> TRANSFER PNTS</a></li>'+
'<li><a href="' + bypplink.href +'">PREFERRED PLAYER</a></li>'+
'<li><a href="/metamask"> METAMASK NFT</a></li>'+
'</ul>'+
'</li>'+

'<li class="menu">'+
'<a href="#forms" data-toggle="collapse" aria-expanded="false" class="dropdown-toggle">'+
'<div class="">'+
'<i class="fas fa-shield fa-fw"></i>'+
'<span> CREW</span>'+
'</div>'+
'<div>'+
'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-right"><polyline points="9 18 15 12 9 6"></polyline></svg>'+
'</div>'+
'</a>'+
'<ul class="collapse submenu list-unstyled" id="forms" data-parent="#accordionExample">'+
'<li><a href="/crew_home"> CREW HOME</a></li>'+
'<li><a href="/crew_profile"> CREW PROFILE</a></li>'+
'<li><a href="/crew_bossspawns"> RAID BOSSES</a></li>'+
'<li><a href="/crew_vault"> CREW VAULT</a></li>'+
'<li><a href="/godstatus"> GOD STATUS</a></li>'+
'<li><a href="/crewinvites"> CREW INVITES</a></li>'+
'<li><a href="/crew_leavecrew"> LEAVE CREW</a></li>'+
'</ul>'+
'</li>'+

'<li class="menu">'+
'<a href="#pvp" data-toggle="collapse" aria-expanded="false" class="dropdown-toggle">'+
'<div class="">'+
'<i class="fas fa-shield-alt fa-fw"></i>'+
'<span> PVP</span>'+
'</div>'+
'<div>'+
'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-right"><polyline points="9 18 15 12 9 6"></polyline></svg>'+
'</div>'+
'</a>'+
'<ul class="collapse submenu list-unstyled" id="pvp" data-parent="#accordionExample">'+
'<li><a href="/attacklog"> ATTACK LOG</a></li>'+
'<li><a href="/pvptourney"> OPEN TOURNEY</a></li>'+
'<li><a href="/closedpvp"> PVP BRAWL</a></li>'+
'<li><a href="/crew_hitlist"> HITLIST</a></li>'+
'</ul>'+
'</li>'+

'<li class="menu">'+
'<a href="#datatables" data-toggle="collapse" aria-expanded="false" class="dropdown-toggle">'+
'<div class="">'+
'<i class="fas fa-shopping-bag fa-fw"></i>'+
'<span> ITEMS</span>'+
'</div>'+
'<div>'+
'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-right"><polyline points="9 18 15 12 9 6"></polyline></svg>'+
'</div>'+
'</a>'+
'<ul class="collapse submenu list-unstyled" id="datatables" data-parent="#accordionExample">'+
'<li><a href="/vault"> VAULT</a></li>'+
'<li><a href="/blacksmith"> BLACKSMITH</a></li>'+
'<li><a href="/augmentequip"> ADD AUGMENTS</a></li>'+
'<li><a href="/itemtransfer"> ITEM TRANSFER</a></li>'+
'<li><a href="/cauldron"> CAULDRON</a></li>'+
'<li><a href="/challenge"> CHALLENGE SETS</a></li>'+
'</ul>'+
'</li>'+

'<li class="menu">'+
'<a href="#resources" data-toggle="collapse" aria-expanded="false" class="dropdown-toggle">'+
'<div class="">'+
'<i class="fas fa-book fa-fw"></i>'+
'<span> QUESTS</span>'+
'</div>'+
'<div>'+
'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-right"><polyline points="9 18 15 12 9 6"></polyline></svg>'+
'</div>'+
'</a>'+
'<ul class="collapse submenu list-unstyled" id="resources" data-parent="#accordionExample">'+
'<li><a href="/scratch_ticket"> REDEFINED</a></li>'+
'<li><a href="/weeklyquests"> BOOSTERS</a></li>'+
'<li><a href="/questlog"> QUEST LOG</a></li>'+
'<li><a href="/dungeons"> DUNGEONS</a></li>'+
'<li><a href="/collections"> COLLECTIONS</a></li>'+
'<li><a href="/challenge"> CHALLENGES</a></li>'+
'</ul>'+
'</li>'+

'<li class="menu">'+
'<a href="#rga" data-toggle="collapse" aria-expanded="false" class="dropdown-toggle">'+
'<div class="">'+
'<i class="fa fa-address-card"></i>'+
'<span> RGA</span>'+
'</div>'+
'<div>'+
'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-right"><polyline points="9 18 15 12 9 6"></polyline></svg>'+
'</div>'+
'</a>'+
'<ul class="collapse submenu list-unstyled" id="rga" data-parent="#accordionExample">'+
'<input type="text" value='+sessid+' maxlength="18" size="18" id="sessidbox">'+
'<li><a href="/myaccount.php?ac_serverid=2"> TORAX CHARS</a></li>'+
'<li><a href="/myaccount.php?ac_serverid=1"> SIGIL CHARS</a></li>'+
'<li><a href="/accountinfo.php"> ACCOUNT</a></li>'+
'<li><a href="/support.php"> OW SUPPORT</a></li>'+
'<li><a href="?cmd=logout"> LOGOUT</a></li>'+
'</ul>'+
'</li>'+

'<li class="menu">'+
'<a href="/world" class="dropdown-toggle">'+
'<div class="">'+
'<i class="fas fa-globe fa-fw"></i>'+
'<span> WORLD</span>'+
'</div>'+
'</a>'+
'</li>' +

'<p><br>' +

'<div class=search>' +
'<form method="post" action="playersearch.php" target="_parent">' +
'<div class="col-12 px-2">' +
'<input id="t-text" type="text" name="search" placeholder="player search" class="form-control" required="">' +
'</div>' +
'</form>' +
'</div>' +
'<div class="row mt-4">' +
'</div>'+
'<form method="post" action="crewsearch.php" target="_parent">' +
'<div class="col-12 px-2">' +
'<input id="t-text" type="text" name="search" placeholder="crew search" class="form-control" required="">' +
'</div>' +
'</form>' +
'<p><br><a href=/crew_apply>MoxxiMod v4.4</a>' +
'</div>' +
'<div class="row mt-4">' +
'</div></div>' +
'</p></div>'



var servername = window.location.hostname.split(".")[0];
setTimeout(function() {
$("span:contains('SERVER')").text(servername);
}, 10);


// currency toolbar

GM_xmlhttpRequest ( {
    method:     'GET',
    url:        'https://torax.outwar.com/ajax/backpackcontents.php?tab=quest',
    onload:     function (responseDetails) {
const ammyID = /Amulet of Achievement" data-itemqty="([0-9]*)"/g;
const ammyRes = ammyID.exec(responseDetails.responseText);
const badgeID = /Badge Reputation" data-itemqty="([0-9]*)"/g;
const badgeRes = badgeID.exec(responseDetails.responseText);

var ammyPrint = '';
if (ammyRes != null)
ammyPrint = ammyRes[1]

var badgePrint = '';
if (badgeRes != null)
badgePrint = badgeRes[1]

var ammyCnt = "0"+ammyPrint

var ammy = ammyCnt;

var badgeCnt = "0"+badgePrint

var badge = '';
if (badgeCnt < 15)
badge = badgeCnt
if (badgeCnt > 14)
badge = '<font color=#00CC00>'+badgeCnt+'</font>'

var goldPrint = document.body.innerHTML.match(/<tr><td><b>Gold:<\/b><\/td><td>(.*)<\/td><\/tr>/i);
var pbPrint = document.body.innerHTML.match(/<tr><td><b>Points:<\/b><\/td><td><font size=2 color=#00FF00>(.*)<\/font><\/td><\/tr>/i);
var prPrint = document.body.innerHTML.match(/<tr><td><b>Premium:<\/b><\/td><td><font size=2 color=#00FF00>(.*)\.<\/font>/i);
var tkPrint = document.body.innerHTML.match(/<tr><td><b>Tokens:<\/b><\/td><td><font size=2 color=#00FF00>(.*)<\/font>/i);
var skPrint = document.body.innerHTML.match(/<tr><td><b>Skill:<\/b><\/td><td>(.*)<\/td><\/tr>/i);

const theImage = document.querySelector("body > center > div.sub-header-container > header > ul.navbar-nav.flex-row.mr-auto.toolbar-nav > li:nth-child(4)");
theImage.innerHTML = `<div class="dropdown"><a href="`+byptlink.href+`" onmouseover="statspopup(event,'<table><tr><td><b>Points:</b></td><td>`+pbPrint[1]+`</td></tr><tr><td><b>Premium:</b></td><td>`+prPrint[1]+`</td></tr><tr><td><b>Tokens:</b></td><td>`+tkPrint[1]+`</td></tr><tr><td><b>Skill Points:</b></td><td>`+skPrint[1]+`</td></tr><tr><td><b>Badge Reps:</b></td><td>`+badge+`</td></tr><tr><td><b>Amulets:</b></td><td>`+ammy+`</td></tr><tr><td><b>Gold:</b></td><td>`+goldPrint[1]+`</td></tr></table><p><font color=#FFF000><center>click to buy points')" onmouseout="kill()"><button class="dropbtn"><font size=1>$$$</button></a></div>`
                }
} );

function insertAfter2(newNode, existingNode) {
existingNode.parentNode.insertBefore(newNode, existingNode.nextSibling);
}

let menu = document.querySelector("body > center > div.sub-header-container > header > ul.navbar-nav.flex-row.mr-auto.toolbar-nav");

let li = document.createElement('li');
li.textContent = '';
insertAfter2(li, menu.children[2]);


// moxximod page

if ( document.URL.indexOf("crew_apply") != -1 ) {
var theImage11;
theImage11 = document.querySelector("#content")
theImage11.innerHTML =
'<div id=moxxi_mod_page>' +
'<img src=https://studiomoxxi.com/ow_themes/custom_jobs/classic_01/mm_logo.png width=50% padding=20px><p>' +
'<a href=https://discord.com/invite/f35cccbWU8?utm_source=Discord%20Widget&utm_medium=Connect target=_blank><img src=https://studiomoxxi.com/moxximod/discord.png width=30%></a><p>' +
'MoxxiMod is a userscript written to improve the gaming user interface and player experience<p>' +
'The code is a combination of CSS (cascading style sheets) and JS (javascript)<p>' +
'<b>MoxxiMod is 100% free</b><p>' +
'If you want to support, please send points to <font color=A30020>Moxxi</font><p>' +
'For help with setup or to report a bug, join our Discord server<p>' +
'<a href=https://studiomoxxi.com/moxximod/ target=_blank>Click Here</a> for the latest scripts</div>' +
'<div id=moxxi_mod_tys>' +
'<p>BIG THANK YOU FOR THE TECHNICAL DEV SUPPORT<p>Beast666007, Bello, CarminT' +
'<p>AND THANK YOU TO THE BETA TESTERS<p>Rhino, Andreas, Brillo, Dkgoon<br>StarFox, Kevin, Kriminal, Shawn<br>Tyler, Xafloc, Jalek, Rodeo<br>StarPower, TeddyPain, TheStud'+
'</div>'
}

// extra

if (document.URL.indexOf("726169") != -1 ) {
GM_addStyle ( `
   #divProfile > div:nth-child(2) > div > div > div.col-xl-4.col-md-5 > div > div:nth-child(2) > div > div > div:nth-child(2) > img{content: url("https://studiomoxxi.com/ow_themes/custom_jobs/classic_01/disa_head.png") !important;}` );
};



// server switch link

var server = window.location.href;

var server2 = server.replace(/\.outwar\.com.*/, '');
var server3 = server2.replace(/http.*:\/\//, '');

GM_xmlhttpRequest ( {
    method:     'GET',
    url:        'https://torax.outwar.com/myaccount.php?ac_serverid=2',
    onload:     function (responseDetails) {
const toraxGet = /https:\/\/torax\.outwar\.com\/world\?suid=[0-9]+&serverid=2/i;
const toraxGetPrint = toraxGet.exec(responseDetails.responseText);

GM_xmlhttpRequest ( {
    method:     'GET',
    url:        'https://torax.outwar.com/myaccount.php?ac_serverid=1',
    onload:     function (responseDetails) {
const sigilGet = /https:\/\/sigil\.outwar\.com\/world\?suid=[0-9]+&serverid=1/i;
const sigilGetPrint = sigilGet.exec(responseDetails.responseText);

var torax = "torax";
var sigil = "sigil";

var servSwitch = '';
if (server3 != torax)
servSwitch += toraxGetPrint+"#";
if (server3 != sigil)
servSwitch += sigilGetPrint+"#";

let serverGo1 = servSwitch.replace("null", "");
let serverGo2 = serverGo1.replace("world", "home");

var otherServ = '';
if (server3 != torax)
otherServ = torax;
if (server3 != sigil)
otherServ = sigil;

// toolbar skills

GM_xmlhttpRequest ( {
    method:     'GET',
    url:        'https://torax.outwar.com/profile',
    onload:     function (responseDetails) {

        const skill0 = /<img align="absmiddle" border="0" src="\/images\/skills\/skill_2952\.gif" hspace="2" width="25" height="25" alt="Underlings" onmouseover="popup\(event,'<b>Level 1 Underlings<\/b><br \/><br \/>[0-9]+ [a-zA-Z]+ .*/i;
        const lingloy = skill0.exec(responseDetails.responseText);
        const skill1 = /<img align="absmiddle" border="0" src="\/images\/skills\/circumspect\.png" hspace="2" width="25" height="25" alt="Circumspect" onmouseover="popup\(event,'<b>Level [0-9]+ Circumspect<\/b><br \/>Your heart beat steadies\. You become careful, and alert when attacking your targets\.<br \/> Rage costs of mobs in DC are lowered by [0-9]+%<br \/>[0-9]+ [a-zA-Z]+ .*/i;
        const circ = skill1.exec(responseDetails.responseText);
        const skill2 = /<img align="absmiddle" border="0" src="\/images\/skills\/markdown\.png" hspace="2" width="25" height="25" alt="Markdown" onmouseover="popup\(event,'<b>Level [0-9]+ Markdown<\/b><br \/>You become more focused and alert for battle\. Decreases cost by [0-9]+% to form\/join raids\.<br \/>[0-9]+ [a-zA-Z]+ .*/i;
        const markdown = skill2.exec(responseDetails.responseText);
        const skill3 = /<img align="absmiddle" border="0" src="\/images\/skills\/hitman\.png" hspace="2" width="25" height="25" alt="Hitman" onmouseover="popup\(event,'<b>Level [0-9]+ Hitman<\/b><br \/>You put extra effort into your kills when there is money on the line\. Double strip and gain XP from players\.<br \/>[0-9]+ [a-zA-Z]+ .*/i;
        const hitman = skill3.exec(responseDetails.responseText);
        const skill4 = /<img align="absmiddle" border="0" src="\/images\/skills\/haste\.png" hspace="2" width="25" height="25" alt="Haste" onmouseover="popup\(event,'<b>Level [0-9]+ Haste<\/b><br \/>Your actions become lightning fast, time speeds up with your every move\.<br \/> Respawn times on DC mobs are reduced by [0-9]+%\.<br \/>[0-9]+ [a-zA-Z]+ .*/i;
        const haste = skill4.exec(responseDetails.responseText);
        const skill5 = /<img align="absmiddle" border="0" src="\/images\/skills\/streetsmarts\.png" hspace="2" width="25" height="25" alt="Street Smarts" onmouseover="popup\(event,'<b>Level [0-9]+ Street Smarts<\/b><br \/>Your experience can not be stripped\.<br \/>[0-9]+ [a-zA-Z]+ .*/i;
        const street = skill5.exec(responseDetails.responseText);
        const skill6 = /<img align="absmiddle" border="0" src="\/images\/skills\/onguard\.png" hspace="2" width="25" height="25" alt="On Guard" onmouseover="popup\(event,'<b>Level [0-9]+ On Guard<\/b><br \/>You never tire\. Your strength cannot be stolen in battle\.<br \/>[0-9]+ [a-zA-Z]+ .*/i;
        const onguard = skill6.exec(responseDetails.responseText);
        const skill7 = /<img align="absmiddle" border="0" src="\/images\/skills\/\.\.\/items\/itemz80\.gif" hspace="2" width="25" height="25" alt="Quest Experience Potion" onmouseover="popup\(event,'<b>Level 1 Quest Experience Potion<\/b><br \/>Increases quest EXP rewards by 50% for characters lvl 84 and below\.<br \/>[0-9]+ [a-zA-Z]+ .*/i;
        const questexp = skill7.exec(responseDetails.responseText);

        var skills = '';
        if (lingloy != null)
        skills += lingloy;
        if (circ != null)
        skills += circ;
        if (markdown != null)
        skills += markdown;
        if (hitman != null)
        skills += hitman;
        if (haste != null)
        skills += haste;
        if (street != null)
        skills += street;
        if (onguard != null)
        skills += onguard;
        if (questexp != null)
        skills += questexp;

// toolbar supplies notification

GM_xmlhttpRequest ( {
    method:     'GET',
    url:        'https://outwar.com/supplies',
    onload:     function (responseDetails) {
const supplies = /<img border="0" src="images\/suppliestriangle\.gif" width="11" height="11">[\n\r](.*)%<\/td>/i;
const suppliesPrint = supplies.exec(responseDetails.responseText);

let result;
if (suppliesPrint[1] < 100) {
    result = 'positive';
  } else {
    result = null;
  }
        var suppliesPOP = '';
        if (result != null)
        suppliesPOP += `<a href=/supplies><img src=https://studiomoxxi.com/ow_themes/custom_jobs/classic_01/suppliespop.png width=25px height=25px onmouseover="popup(event,'<b><font color=#FFFFFF>SUPPLIES: `+suppliesPrint[1]+`%<br></b><font color=#fff000>(click to buy more)')" onmouseout="kill()"></a>`;

// toolbar strength notification

GM_xmlhttpRequest ( {
    method:     'GET',
    url:        'https://outwar.com/profile',
    onload:     function (responseDetails) {
const strength = /event,'Strength: ([0-9]+)'/i;
const strengthPrint = strength.exec(responseDetails.responseText);


let resultStr;
if (strengthPrint[1] < 100) {
    resultStr = 'positive';
  } else {
    resultStr = null;
  }

        var strengthtb = '';
        if (resultStr != null)
        strengthtb += `<img src=https://torax.outwar.com/images/items/pot6.jpg width=25px height=25px onmouseover="popup(event,'<b><font color=#FFFFFF>STRENGTH: `+strengthPrint[1]+`%<br></b>')" onmouseout="kill()">`;

// toolbar gladiator notification

fetch('/gladiator?mobid=4391')
   .then(response => response.text())
   .then((response) => {

var vorkCheck = response.match(/Will retreat in/i);

        var vork = '';
        if (vorkCheck != null)
        vork += `<a href=/gladiator?mobid=4391><img src=https://outwar.com/images/mobs/velgladiator.jpg width=25px height=25px onmouseover="popup(event,'<b>Vork is Available</b><br>Click to view Leaderboard')" onmouseout="kill()"></a>`;

fetch('/gladiator?mobid=3991')
   .then(response => response.text())
   .then((response) => {

var zerxCheck = response.match(/Will retreat in/i);

        var zerx = '';
        if (zerxCheck != null)
        zerx += `<a href=/gladiator?mobid=3991><img src=https://outwar.com/images/mobs/velgladiator.jpg width=25px height=25px onmouseover="popup(event,'<b> Zerx is Available</b><br><font color=#FFF000>(click to view Leaderboard)')" onmouseout="kill()"></a>`;

// toolbar brawl notification

GM_xmlhttpRequest ( {
    method:     'GET',
    url:        'https://outwar.com/closedpvp',
    onload:     function (responseDetails) {
const brawlCheck = /BRAWL IS ACTIVE/i;
const brawlPrint = brawlCheck.exec(responseDetails.responseText);

        var brawl = '';
        if (brawlPrint != null)
        brawl += `<a href=/closedpvp><img src=https://images.emojiterra.com/google/android-pie/512px/1f94a.png width=25px height=25px onmouseover="popup(event,'<b>PVP Brawl is Active</b><br><font color=#FFF000>(Click to view)')" onmouseout="kill()"></a>`;


// toolbar boss notification

fetch('/crew_bossspawns')
   .then(response => response.text())
   .then((response) => {

        const cosmos = response.match(/images\/CosmosGreatAllBeing\.jpg/i);
        const death = response.match(/images\/DeathReaperOfSouls\.jpg/i);
        const maekrix = response.match(/images\/MaekrixDreadedStriker\.jpg/i);
        const blackhand = response.match(/images\/BlackhandReborn\.png/i);
        const zyrak = response.match(/images\/velserverboss\.jpg/i);

        const cosmosh = response.match(/Cosmos, Great All Being.*[\n\r].*[\n\r].*[\n\r].*[\n\r].*p class="card-user_occupation"> (.*)/i);
        const deathh = response.match(/Death, Reaper of Souls.*[\n\r].*[\n\r].*[\n\r].*[\n\r].*p class="card-user_occupation"> (.*)/i);
        const maekrixh = response.match(/Maekrix, Dreaded Striker.*[\n\r].*[\n\r].*[\n\r].*[\n\r].*p class="card-user_occupation"> (.*)/i);
        const blackhandh = response.match(/Blackhand Reborn.*[\n\r].*[\n\r].*[\n\r].*[\n\r].*p class="card-user_occupation"> (.*)/i);
        const zyrakh = response.match(/Zyrak, Vision of Madness.*[\n\r].*[\n\r].*[\n\r].*[\n\r].*p class="card-user_occupation"> (.*)/i);

        const cosmoss = response.match(/Cosmos, Great All Being.*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*(<a href="boss_stats\.php\?spawnid=[0-9]+">)\(stats\)<\/a>/i);
        const deaths = response.match(/Death, Reaper of Souls.*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*(<a href="boss_stats\.php\?spawnid=[0-9]+">)\(stats\)<\/a>/i);
        const maekrixs = response.match(/Maekrix, Dreaded Striker.*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*(<a href="boss_stats\.php\?spawnid=[0-9]+">)\(stats\)<\/a>/i);
        const blackhands = response.match(/Blackhand Reborn.*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*(<a href="boss_stats\.php\?spawnid=[0-9]+">)\(stats\)<\/a>/i);
        const zyraks = response.match(/Zyrak, Vision of Madness.*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*(<a href="boss_stats\.php\?spawnid=[0-9]+">)\(stats\)<\/a>/i);

        var boss = '';
        if (cosmos != null)
        boss += cosmoss[1]+`<img src="http://www.outwar.com/`+cosmos+`" width="25px" height="25px" onmouseover="popup(event,'<b>Cosmos, Great All Being</b><br>Health: `+cosmosh[1]+`<br><font color=#FFF000>(click for stats)')" onmouseout="kill()"></a>`;
        if (death != null)
        boss += deaths[1]+`<img src="http://www.outwar.com/`+death+`" width="25px" height="25px" onmouseover="popup(event,'<b>Death, Reaper of Souls</b><br>Health: `+deathh[1]+`<br><font color=#FFF000>(click for stats)')" onmouseout="kill()"></a>`;
        if (maekrix != null)
        boss += maekrixs[1]+`<img src="http://www.outwar.com/`+maekrix+`" width="25px" height="25px" onmouseover="popup(event,'<b>Maekrix, Dreaded Striker</b><br>Health: `+maekrixh[1]+`<br><font color=#FFF000>(click for stats)')" onmouseout="kill()"></a>`;
        if (blackhand != null)
        boss += blackhands[1]+`<img src="http://www.outwar.com/`+blackhand+`" width="25px" height="25px" onmouseover="popup(event,'<b>Blackhand Reborn</b><br>Health: `+blackhandh[1]+`<br><font color=#FFF000>(click for stats)')" onmouseout="kill()"></a>`;
        if (zyrak != null)
        boss += zyraks[1]+`<img src="http://www.outwar.com/`+zyrak+`" width="25px" height="25px" onmouseover="popup(event,'<b>Zyrak, Vision of Madness</b><br>Health: `+zyrakh[1]+`<br><font color=#FFF000>(click for stats)')" onmouseout="kill()"></a>`;

// toolbar god notification

fetch('/raidtools')
   .then(response => response.text())
   .then((response) => {

	    const god1imgPRINT = response.match(/onclick="sendTeleportRequest.*(images.*)" border.*/i);
        const god1txtPRINT = response.match(/onclick="sendTeleportRequest.*[\n\r].*Teleport to (.*)<\/font>/i);
        const god2imgPRINT = response.match(/onclick="sendTeleportRequest.*[\n\r].*[\n\r].*(images.*)" border.*/i);
        const god2txtPRINT = response.match(/onclick="sendTeleportRequest.*[\n\r].*[\n\r].*[\n\r].*Teleport to (.*)<\/font>/i);
        const god3imgPRINT = response.match(/onclick="sendTeleportRequest.*[\n\r].*[\n\r].*[\n\r].*[\n\r].*(images.*)" border.*/i);
        const god3txtPRINT = response.match(/onclick="sendTeleportRequest.*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*Teleport to (.*)<\/font>/i);
        const god4imgPRINT = response.match(/onclick="sendTeleportRequest.*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*(images.*)" border.*/i);
        const god4txtPRINT = response.match(/onclick="sendTeleportRequest.*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*Teleport to (.*)<\/font>/i);
        const god5imgPRINT = response.match(/onclick="sendTeleportRequest.*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*(images.*)" border.*/i);
        const god5txtPRINT = response.match(/onclick="sendTeleportRequest.*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*Teleport to (.*)<\/font>/i);
        const god6imgPRINT = response.match(/onclick="sendTeleportRequest.*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*(images.*)" border.*/i);
        const god6txtPRINT = response.match(/onclick="sendTeleportRequest.*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*Teleport to (.*)<\/font>/i);
        const god7imgPRINT = response.match(/onclick="sendTeleportRequest.*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*(images.*)" border.*/i);
        const god7txtPRINT = response.match(/onclick="sendTeleportRequest.*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*Teleport to (.*)<\/font>/i);

        var gods = '';
        if (god1imgPRINT != null)
        gods += `<img src="http://www.outwar.com/`+god1imgPRINT[1]+`" width="25px" height="25px" onmouseover="popup(event,'<b>`+god1txtPRINT[1]+` has spawned!</b>')" onmouseout="kill()">`;
        if (god2imgPRINT != null)
        gods += `<img src="http://www.outwar.com/`+god2imgPRINT[1]+`" width="25px" height="25px" onmouseover="popup(event,'<b>`+god2txtPRINT[1]+` has spawned!</b>')" onmouseout="kill()">`;
        if (god3imgPRINT != null)
        gods += `<img src="http://www.outwar.com/`+god3imgPRINT[1]+`" width="25px" height="25px" onmouseover="popup(event,'<b>`+god3txtPRINT[1]+` has spawned!</b>')" onmouseout="kill()">`;
        if (god4imgPRINT != null)
        gods += `<img src="http://www.outwar.com/`+god4imgPRINT[1]+`" width="25px" height="25px" onmouseover="popup(event,'<b>`+god4txtPRINT[1]+` has spawned!</b>')" onmouseout="kill()">`;
        if (god5imgPRINT != null)
        gods += `<img src="http://www.outwar.com/`+god5imgPRINT[1]+`" width="25px" height="25px" onmouseover="popup(event,'<b>`+god5txtPRINT[1]+` has spawned!</b>')" onmouseout="kill()">`;
        if (god6imgPRINT != null)
        gods += `<img src="http://www.outwar.com/`+god6imgPRINT[1]+`" width="25px" height="25px" onmouseover="popup(event,'<b>`+god6txtPRINT[1]+` has spawned!</b>')" onmouseout="kill()">`;
        if (god7imgPRINT != null)
        gods += `<img src="http://www.outwar.com/`+god7imgPRINT[1]+`" width="25px" height="25px" onmouseover="popup(event,'<b>`+god7txtPRINT[1]+` has spawned!</b>')" onmouseout="kill()">`;

// all toolbar

document.querySelector("body > center > div.sub-header-container > header > ul.navbar-nav.flex-row.mr-auto.toolbar-nav > li.nav-item.more-dropdown.little-space.hide-on-mob.progress-top").innerHTML =

'<table><tr>'+
'<td><div id=toolbar1>toolbar1</div></td>'+
'<td><div id=toolbar2>toolbar2</div></td>'+
'<td><div id=toolbar3>toolbar3</div></td>'+
'</tr></table>'

document.querySelector("#toolbar1").innerHTML =

'<table><tr><td>' +
`<div class="dropdown"><a href=`+serverGo2+` onmouseover="popup(event,'switch to `+otherServ+`')" onmouseout="kill()"><button class="dropbtn"><font size=1>SERVER</button></a></div>` +
    '</td><td>'+

'</td><td>'+
'<div class="dropdown">' +
'<button class="dropbtn"><font size=1>FAST TRAVEL</button></a>' +
'<div class="dropdown-content">' +
    '<a href="/world.php?room=26137">ASTRAL RIFT</a>' +
    '<a href="/world.php?room=25989">CHALLENGES</a>' +
    '<a href="/world.php?room=24284">DEATHBAT GRAVEYARD</a>' +
    '<a href="/world.php?room=4249">EOB SANDS</a>' +
    '<a href="/world.php?room=42550">MADNESS VAULT</a>' +
    '<a href="/world.php?room=23311">MOUNTAIN CAVE</a>' +
    '<a href="/world.php?room=23471">PRISTINE DEPTHS</a>' +
    '<a href="/world.php?room=11">ROOM 11</a>' +
    '<a href="/world.php?room=6640">SCIENTIFIC DISTRICT</a>' +
    '<a href="/world.php?room=17321">UNDERGROUND Q SEC BASE</a>' +
    '<a href="/world.php?room=10697">VALLEY OF DEATH</a>' +
    '<a href="/world.php?room=25994">WARDENS SANCTUARY</a>' +
    '<a href="/wilderness">WILDERNESS</a>' +
    '</div>' +
    '</div>' +
'</td></tr></table>'

document.querySelector("#toolbar2").innerHTML =

    '<div id=toolbaralerts>'+
    '<center>NOTIFICATIONS<br>'+
    gods+boss+zerx+vork+suppliesPOP+strengthtb+brawl+
    '</div>'

document.querySelector("#toolbar3").innerHTML =

    '<div id=toolbarskills>'+
    '<center>SKILLS<br>'+
    skills+
    '</div>'

})})}})})})}})}})}})}})}});

// homepage rankings

if ( document.URL.indexOf("outwar.com/home") != -1 ) {

function insertBefore(newNode, existingNode) {
let sp2 = document.querySelector("#content-header-row > div.bio.col-lg-8.col-md-8.col-sm-12.col-12.layout-spacing.layout-spacing > div.widget-content.widget-content-area.text-left > div > div > div:nth-child(2) > div > div:nth-child(1)");
existingNode.parentNode.insertBefore(newNode, sp2);
}

let menu = document.querySelector("#content-header-row > div.bio.col-lg-8.col-md-8.col-sm-12.col-12.layout-spacing.layout-spacing > div.widget-content.widget-content-area.text-left > div > div > div:nth-child(2) > div")

var homepageEQ =
'<div id="char_rankings"><table><tr>' +
'<td>CHAR: POWER<div id="rankings_home"></div></td>' +
'<td>CHAR: ELE DMG<div id="rankings_charele"></div></td>' +
'<td>CHAR: CHAOS DMG<div id="rankings_charchaos"></div></td>'+
'<td>CHAR: GROWTH<div id="rankings_chargrowth"></div></td></tr></table></div>' +
'<p><div id="crew_rankings"><table><tr>' +
'<td>CREW: POWER<div id="rankings_crewpow"></div></td>' +
'<td>CREW: ELE DMG<div id="rankings_crewele"></div></td>' +
'<td>CREW: CHAOS DMG<div id="rankings_crewchaos"></div></td>' +
'<td>CREW: BOSS DMG<div id="rankings_crewboss"></div></td></tr></table></div>'

let div = document.createElement('div');
div.innerHTML += homepageEQ;
insertBefore(div, menu.children[0]);

}

GM_xmlhttpRequest ( {
    method:     'GET',
    url:        'https://torax.outwar.com/ajax/rankings?type=crew_power',
    onload:     function (responseDetails) {
const EQ = /\{.*/i;
const EQprint = EQ.exec(responseDetails.responseText);

        var isLoading = false;

        function selectCategory(category, title, isCrew) {
            if(isLoading)
                return;

            $('#rank-title').html(title);
            $('#ranks').hide();
            $('#ranks').html('');
            $('#last-updated').html('');
            isLoading = true;

           $.getJSON('/ajax/rankings.php?type=' + category, function(data) {

                var isOdd = true;
                $.each(data.results, function(key, value) {

                    if(isCrew) {
                        var imgurl = data.baseimageurl + "/" + value.pic;
                        var profileUrl = 'crew_profile?id=' + value.id;
                    }
                    else {
                        var imgurl = data.baseimageurl + "/uploaded/" + value.pic;
                        var profileUrl = 'characters/' + value.id;
                    }

                    if(value.pic == ''  || value.pic == null)
                        imgurl = '/images/gangster1.jpg';

                    var rowClass = isOdd ? 'rank-row-odd' : 'rank-row-even';

                    var stat = '0';

                    if(value.stat ) {
                        stat = value.stat.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")
                    }

                    var html = '<li class="list-group-item list-group-item-action ranksulli">'
                    + '<div class="media">'
                    + '<div class="mr-3">'
                    + '<div class="rank-row top">'
                    + ' <div class="rank-row-number"><span>' + value.rank + '</span></div>'
                    + '<div class="rank-row-image">'
                    + '<a href="' + profileUrl + '">'
                    + '</a>'
                    + '</div></div></div>'
                    + '<div class="media-body">'
                    + '<h5 class="tx-inverse"><a href="' + profileUrl + '">' + value.name + '</a></h5>'
                    + '<p class="mg-b-0">' + stat + '</p>'
                    + '</div>'
                    + '</li>'


                    $('#rankings_home').append(html);

                    isOdd = !isOdd;

                });

                isLoading = false;
                $('#last-updated').html('<br>Last updated: ' + data.timestamp);
                $('#ranks').show();
            }, "json");
        }

        $( document ).ready(function() {

            var selO = $('option[value="char_power"]');selectCategory('char_power', selO.html());
            $( ".rank-sel2" ).change(function() {

                if($( this ).val() == '')
                    return;

                var isCrew = $( this ).attr('iscrew') == '1';
                selectCategory($( this ).val(), $(this).find("option:selected").text(), isCrew);

            });
        });

GM_xmlhttpRequest ( {
    method:     'GET',
    url:        'https://torax.outwar.com/ajax/rankings?type=char_elepower',
    onload:     function (responseDetails) {
const EQ = /\{.*/i;
const EQprint = EQ.exec(responseDetails.responseText);

        var isLoading = false;

        function selectCategory(category, title, isCrew) {
            if(isLoading)
                return;

            $('#rank-title').html(title);
            $('#ranks').hide();
            $('#ranks').html('');
            $('#last-updated').html('');
            isLoading = true;

           $.getJSON('/ajax/rankings.php?type=char_elepower', function(data) {

                var isOdd = true;
                $.each(data.results, function(key, value) {

                    if(isCrew) {
                        var imgurl = data.baseimageurl + "/" + value.pic;
                        var profileUrl = 'crew_profile?id=' + value.id;
                    }
                    else {
                        var imgurl = data.baseimageurl + "/uploaded/" + value.pic;
                        var profileUrl = 'characters/' + value.id;
                    }

                    if(value.pic == ''  || value.pic == null)
                        imgurl = '/images/gangster1.jpg';

                    var rowClass = isOdd ? 'rank-row-odd' : 'rank-row-even';

                    var stat = '0';

                    if(value.stat ) {
                        stat = value.stat.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")
                    }

                    var html = '<li class="list-group-item list-group-item-action ranksulli">'
                    + '<div class="media">'
                    + '<div class="mr-3">'
                    + '<div class="rank-row top">'
                    + ' <div class="rank-row-number"><span>' + value.rank + '</span></div>'
                    + '<div class="rank-row-image">'
                    + '<a href="' + profileUrl + '">'
                    + '</a>'
                    + '</div></div></div>'
                    + '<div class="media-body">'
                    + '<h5 class="tx-inverse"><a href="' + profileUrl + '">' + value.name + '</a></h5>'
                    + '<p class="mg-b-0">' + stat + '</p>'
                    + '</div>'
                    + '</li>'


                    $('#rankings_charele').append(html);

                    isOdd = !isOdd;

                });

                isLoading = false;
                $('#last-updated').html('<br>Last updated: ' + data.timestamp);
                $('#ranks').show();
            }, "json");
        }

        $( document ).ready(function() {

            var selO = $('option[value="char_power"]');selectCategory('char_power', selO.html());
            $( ".rank-sel2" ).change(function() {

                if($( this ).val() == '')
                    return;

                var isCrew = $( this ).attr('iscrew') == '1';
                selectCategory($( this ).val(), $(this).find("option:selected").text(), isCrew);

            });
        });

GM_xmlhttpRequest ( {
    method:     'GET',
    url:        'https://torax.outwar.com/ajax/rankings?type=crew_power',
    onload:     function (responseDetails) {
const EQ = /\{.*/i;
const EQprint = EQ.exec(responseDetails.responseText);

        var isLoading = false;

        function selectCategory(category, title, isCrew) {
            if(isLoading)
                return;

            $('#rank-title').html(title);
            $('#ranks').hide();
            $('#ranks').html('');
            $('#last-updated').html('');
            isLoading = true;

           $.getJSON('/ajax/rankings.php?type=crew_power', function(data) {

                var isOdd = true;
                $.each(data.results, function(key, value) {

                    if(isCrew) {
                        var imgurl = data.baseimageurl + "/" + value.pic;
                        var profileUrl = 'crew_profile?id=' + value.id;
                    }
                    else {
                        var imgurl = data.baseimageurl + "/uploaded/" + value.pic;
                        var profileUrl = 'crew_profile?id=' + value.id;
                    }

                    if(value.pic == ''  || value.pic == null)
                        imgurl = '/images/gangster1.jpg';

                    var rowClass = isOdd ? 'rank-row-odd' : 'rank-row-even';

                    var stat = '0';

                    if(value.stat ) {
                        stat = value.stat.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")
                    }

                    var html = '<li class="list-group-item list-group-item-action ranksulli">'
                    + '<div class="media">'
                    + '<div class="mr-3">'
                    + '<div class="rank-row top">'
                    + ' <div class="rank-row-number"><span>' + value.rank + '</span></div>'
                    + '<div class="rank-row-image">'
                    + '<a href="' + profileUrl + '">'
                    + '</a>'
                    + '</div></div></div>'
                    + '<div class="media-body">'
                    + '<h5 class="tx-inverse"><a href="' + profileUrl + '">' + value.name + '</a></h5>'
                    + '<p class="mg-b-0">' + stat + '</p>'
                    + '</div>'
                    + '</li>'


                    $('#rankings_crewpow').append(html);

                    isOdd = !isOdd;

                });

                isLoading = false;
                $('#last-updated').html('<br>Last updated: ' + data.timestamp);
                $('#ranks').show();
            }, "json");
        }

        $( document ).ready(function() {

            var selO = $('option[value="char_power"]');selectCategory('char_power', selO.html());
            $( ".rank-sel2" ).change(function() {

                if($( this ).val() == '')
                    return;

                var isCrew = $( this ).attr('iscrew') == '1';
                selectCategory($( this ).val(), $(this).find("option:selected").text(), isCrew);

            });
        });

GM_xmlhttpRequest ( {
    method:     'GET',
    url:        'https://torax.outwar.com/ajax/rankings?type=crew_elepower',
    onload:     function (responseDetails) {
const EQ = /\{.*/i;
const EQprint = EQ.exec(responseDetails.responseText);

        var isLoading = false;

        function selectCategory(category, title, isCrew) {
            if(isLoading)
                return;

            $('#rank-title').html(title);
            $('#ranks').hide();
            $('#ranks').html('');
            $('#last-updated').html('');
            isLoading = true;

           $.getJSON('/ajax/rankings.php?type=crew_elepower', function(data) {

                var isOdd = true;
                $.each(data.results, function(key, value) {

                    if(isCrew) {
                        var imgurl = data.baseimageurl + "/" + value.pic;
                        var profileUrl = 'crew_profile?id=' + value.id;
                    }
                    else {
                        var imgurl = data.baseimageurl + "/uploaded/" + value.pic;
                        var profileUrl = 'crew_profile?id=' + value.id;
                    }

                    if(value.pic == ''  || value.pic == null)
                        imgurl = '/images/gangster1.jpg';

                    var rowClass = isOdd ? 'rank-row-odd' : 'rank-row-even';

                    var stat = '0';

                    if(value.stat ) {
                        stat = value.stat.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")
                    }

                    var html = '<li class="list-group-item list-group-item-action ranksulli">'
                    + '<div class="media">'
                    + '<div class="mr-3">'
                    + '<div class="rank-row top">'
                    + ' <div class="rank-row-number"><span>' + value.rank + '</span></div>'
                    + '<div class="rank-row-image">'
                    + '<a href="' + profileUrl + '">'
                    + '</a>'
                    + '</div></div></div>'
                    + '<div class="media-body">'
                    + '<h5 class="tx-inverse"><a href="' + profileUrl + '">' + value.name + '</a></h5>'
                    + '<p class="mg-b-0">' + stat + '</p>'
                    + '</div>'
                    + '</li>'


                    $('#rankings_crewele').append(html);

                    isOdd = !isOdd;

                });

                isLoading = false;
                $('#last-updated').html('<br>Last updated: ' + data.timestamp);
                $('#ranks').show();
            }, "json");
        }

        $( document ).ready(function() {

            var selO = $('option[value="char_power"]');selectCategory('char_power', selO.html());
            $( ".rank-sel2" ).change(function() {

                if($( this ).val() == '')
                    return;

                var isCrew = $( this ).attr('iscrew') == '1';
                selectCategory($( this ).val(), $(this).find("option:selected").text(), isCrew);

            });
        });

GM_xmlhttpRequest ( {
    method:     'GET',
    url:        'https://torax.outwar.com/ajax/rankings?type=char_chaos',
    onload:     function (responseDetails) {
const EQ = /\{.*/i;
const EQprint = EQ.exec(responseDetails.responseText);

        var isLoading = false;

        function selectCategory(category, title, isCrew) {
            if(isLoading)
                return;

            $('#rank-title').html(title);
            $('#ranks').hide();
            $('#ranks').html('');
            $('#last-updated').html('');
            isLoading = true;

           $.getJSON('/ajax/rankings.php?type=char_chaos', function(data) {

                var isOdd = true;
                $.each(data.results, function(key, value) {

                    if(isCrew) {
                        var imgurl = data.baseimageurl + "/" + value.pic;
                        var profileUrl = 'crew_profile?id=' + value.id;
                    }
                    else {
                        var imgurl = data.baseimageurl + "/uploaded/" + value.pic;
                        var profileUrl = 'characters/' + value.id;
                    }

                    if(value.pic == ''  || value.pic == null)
                        imgurl = '/images/gangster1.jpg';

                    var rowClass = isOdd ? 'rank-row-odd' : 'rank-row-even';

                    var stat = '0';

                    if(value.stat ) {
                        stat = value.stat.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")
                    }

                    var html = '<li class="list-group-item list-group-item-action ranksulli">'
                    + '<div class="media">'
                    + '<div class="mr-3">'
                    + '<div class="rank-row top">'
                    + ' <div class="rank-row-number"><span>' + value.rank + '</span></div>'
                    + '<div class="rank-row-image">'
                    + '<a href="' + profileUrl + '">'
                    + '</a>'
                    + '</div></div></div>'
                    + '<div class="media-body">'
                    + '<h5 class="tx-inverse"><a href="' + profileUrl + '">' + value.name + '</a></h5>'
                    + '<p class="mg-b-0">' + stat + '</p>'
                    + '</div>'
                    + '</li>'


                    $('#rankings_charchaos').append(html);

                    isOdd = !isOdd;

                });

                isLoading = false;
                $('#last-updated').html('<br>Last updated: ' + data.timestamp);
                $('#ranks').show();
            }, "json");
        }

        $( document ).ready(function() {

            var selO = $('option[value="char_power"]');selectCategory('char_power', selO.html());
            $( ".rank-sel2" ).change(function() {

                if($( this ).val() == '')
                    return;

                var isCrew = $( this ).attr('iscrew') == '1';
                selectCategory($( this ).val(), $(this).find("option:selected").text(), isCrew);

            });
        });

GM_xmlhttpRequest ( {
    method:     'GET',
    url:        'https://torax.outwar.com/ajax/rankings?type=char_yesterdaygrowth',
    onload:     function (responseDetails) {
const EQ = /\{.*/i;
const EQprint = EQ.exec(responseDetails.responseText);

        var isLoading = false;

        function selectCategory(category, title, isCrew) {
            if(isLoading)
                return;

            $('#rank-title').html(title);
            $('#ranks').hide();
            $('#ranks').html('');
            $('#last-updated').html('');
            isLoading = true;

           $.getJSON('/ajax/rankings.php?type=char_yesterdaygrowth', function(data) {

                var isOdd = true;
                $.each(data.results, function(key, value) {

                    if(isCrew) {
                        var imgurl = data.baseimageurl + "/" + value.pic;
                        var profileUrl = 'crew_profile?id=' + value.id;
                    }
                    else {
                        var imgurl = data.baseimageurl + "/uploaded/" + value.pic;
                        var profileUrl = 'characters/' + value.id;
                    }

                    if(value.pic == ''  || value.pic == null)
                        imgurl = '/images/gangster1.jpg';

                    var rowClass = isOdd ? 'rank-row-odd' : 'rank-row-even';

                    var stat = '0';

                    if(value.stat ) {
                        stat = value.stat.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")
                    }

                    var html = '<li class="list-group-item list-group-item-action ranksulli">'
                    + '<div class="media">'
                    + '<div class="mr-3">'
                    + '<div class="rank-row top">'
                    + ' <div class="rank-row-number"><span>' + value.rank + '</span></div>'
                    + '<div class="rank-row-image">'
                    + '<a href="' + profileUrl + '">'
                    + '</a>'
                    + '</div></div></div>'
                    + '<div class="media-body">'
                    + '<h5 class="tx-inverse"><a href="' + profileUrl + '">' + value.name + '</a></h5>'
                    + '<p class="mg-b-0">' + stat + '</p>'
                    + '</div>'
                    + '</li>'


                    $('#rankings_chargrowth').append(html);

                    isOdd = !isOdd;

                });

                isLoading = false;
                $('#last-updated').html('<br>Last updated: ' + data.timestamp);
                $('#ranks').show();
            }, "json");
        }

        $( document ).ready(function() {

            var selO = $('option[value="char_power"]');selectCategory('char_power', selO.html());
            $( ".rank-sel2" ).change(function() {

                if($( this ).val() == '')
                    return;

                var isCrew = $( this ).attr('iscrew') == '1';
                selectCategory($( this ).val(), $(this).find("option:selected").text(), isCrew);

            });
        });

GM_xmlhttpRequest ( {
    method:     'GET',
    url:        'https://torax.outwar.com/ajax/rankings?type=crew_chaos',
    onload:     function (responseDetails) {
const EQ = /\{.*/i;
const EQprint = EQ.exec(responseDetails.responseText);

        var isLoading = false;

        function selectCategory(category, title, isCrew) {
            if(isLoading)
                return;

            $('#rank-title').html(title);
            $('#ranks').hide();
            $('#ranks').html('');
            $('#last-updated').html('');
            isLoading = true;

           $.getJSON('/ajax/rankings.php?type=crew_chaos', function(data) {

                var isOdd = true;
                $.each(data.results, function(key, value) {

                    if(isCrew) {
                        var imgurl = data.baseimageurl + "/" + value.pic;
                        var profileUrl = 'crew_profile?id=' + value.id;
                    }
                    else {
                        var imgurl = data.baseimageurl + "/uploaded/" + value.pic;
                        var profileUrl = 'crew_profile?id=' + value.id;
                    }

                    if(value.pic == ''  || value.pic == null)
                        imgurl = '/images/gangster1.jpg';

                    var rowClass = isOdd ? 'rank-row-odd' : 'rank-row-even';

                    var stat = '0';

                    if(value.stat ) {
                        stat = value.stat.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")
                    }

                    var html = '<li class="list-group-item list-group-item-action ranksulli">'
                    + '<div class="media">'
                    + '<div class="mr-3">'
                    + '<div class="rank-row top">'
                    + ' <div class="rank-row-number"><span>' + value.rank + '</span></div>'
                    + '<div class="rank-row-image">'
                    + '<a href="' + profileUrl + '">'
                    + '</a>'
                    + '</div></div></div>'
                    + '<div class="media-body">'
                    + '<h5 class="tx-inverse"><a href="' + profileUrl + '">' + value.name + '</a></h5>'
                    + '<p class="mg-b-0">' + stat + '</p>'
                    + '</div>'
                    + '</li>'


                    $('#rankings_crewchaos').append(html);

                    isOdd = !isOdd;

                });

                isLoading = false;
                $('#last-updated').html('<br>Last updated: ' + data.timestamp);
                $('#ranks').show();
            }, "json");
        }

        $( document ).ready(function() {

            var selO = $('option[value="char_power"]');selectCategory('char_power', selO.html());
            $( ".rank-sel2" ).change(function() {

                if($( this ).val() == '')
                    return;

                var isCrew = $( this ).attr('iscrew') == '1';
                selectCategory($( this ).val(), $(this).find("option:selected").text(), isCrew);

            });
        });

GM_xmlhttpRequest ( {
    method:     'GET',
    url:        'https://torax.outwar.com/ajax/rankings?type=crew_bossdamage',
    onload:     function (responseDetails) {
const EQ = /\{.*/i;
const EQprint = EQ.exec(responseDetails.responseText);

        var isLoading = false;

        function selectCategory(category, title, isCrew) {
            if(isLoading)
                return;

            $('#rank-title').html(title);
            $('#ranks').hide();
            $('#ranks').html('');
            $('#last-updated').html('');
            isLoading = true;

           $.getJSON('/ajax/rankings.php?type=crew_bossdamage', function(data) {

                var isOdd = true;
                $.each(data.results, function(key, value) {

                    if(isCrew) {
                        var imgurl = data.baseimageurl + "/" + value.pic;
                        var profileUrl = 'crew_profile?id=' + value.id;
                    }
                    else {
                        var imgurl = data.baseimageurl + "/uploaded/" + value.pic;
                        var profileUrl = 'crew_profile?id=' + value.id;
                    }

                    if(value.pic == ''  || value.pic == null)
                        imgurl = '/images/gangster1.jpg';

                    var rowClass = isOdd ? 'rank-row-odd' : 'rank-row-even';

                    var stat = '0';

                    if(value.stat ) {
                        stat = value.stat.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")
                    }

                    var html = '<li class="list-group-item list-group-item-action ranksulli">'
                    + '<div class="media">'
                    + '<div class="mr-3">'
                    + '<div class="rank-row top">'
                    + ' <div class="rank-row-number"><span>' + value.rank + '</span></div>'
                    + '<div class="rank-row-image">'
                    + '<a href="' + profileUrl + '">'
                    + '</a>'
                    + '</div></div></div>'
                    + '<div class="media-body">'
                    + '<h5 class="tx-inverse"><a href="' + profileUrl + '">' + value.name + '</a></h5>'
                    + '<p class="mg-b-0">' + stat + '</p>'
                    + '</div>'
                    + '</li>'


                    $('#rankings_crewboss').append(html);

                    isOdd = !isOdd;

                });

                isLoading = false;
                $('#last-updated').html('<br>Last updated: ' + data.timestamp);
                $('#ranks').show();
            }, "json");
        }

        $( document ).ready(function() {

            var selO = $('option[value="char_power"]');selectCategory('char_power', selO.html());
            $( ".rank-sel2" ).change(function() {

                if($( this ).val() == '')
                    return;

                var isCrew = $( this ).attr('iscrew') == '1';
                selectCategory($( this ).val(), $(this).find("option:selected").text(), isCrew);

            });
        });

    }})}})}})}})}})}})}})}});

// equipment injection

if ( document.URL.indexOf("outwar.com/home") != -1 ) {
GM_xmlhttpRequest ( {
    method:     'GET',
    url:        'https://torax.outwar.com/profile',
    onload:     function (responseDetails) {
const EQ = /<div style="position:absolute; left:61px; top:12px; width:41px; height:41px;text-align:center">[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*/im;
const EQprint = EQ.exec(responseDetails.responseText);

function insertBefore(newNode, existingNode) {
let sp2 = document.querySelector("#content-header-row > div.bio.col-lg-8.col-md-8.col-sm-12.col-12.layout-spacing.layout-spacing > div.widget-content.widget-content-area.text-left > div > div > div:nth-child(1) > div > div:nth-child(1)");
existingNode.parentNode.insertBefore(newNode, sp2);
}

let menu = document.querySelector("#content-header-row > div.bio.col-lg-8.col-md-8.col-sm-12.col-12.layout-spacing.layout-spacing > div.widget-content.widget-content-area.text-left > div > div > div:nth-child(1) > div")

var homepageEQ =

'<div ID=EQhome style="position:relative; width:300px; height:385px; background-image:url(https://studiomoxxi.com/ow_themes/custom_jobs/classic_01/thedude_dark.png)">' +
EQprint +
'</div>'

let div = document.createElement('div');
div.innerHTML += homepageEQ;
insertBefore(div, menu.children[0]);



}})};

if ( document.URL.indexOf("world") != -1 ) {
GM_xmlhttpRequest ( {
    method:     'GET',
    url:        'https://torax.outwar.com/profile',
    onload:     function (responseDetails) {
const EQ = /<div style="position:absolute; left:61px; top:12px; width:41px; height:41px;text-align:center">[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*/im;
const EQprint = EQ.exec(responseDetails.responseText);

var EQworld = document.querySelector("#content-header-row > div.col-xl-4.col-lg-12.col-md-12.col-sm-12.col-12.layout-spacing.px-1 > div > div.widget-heading");
EQworld.innerHTML =

'<div id=EQworld style="position:relative; width:300px; height:385px; background-image:url(https://studiomoxxi.com/ow_themes/custom_jobs/classic_01/thedude_dark.png)">' +
EQprint +
'</div>'

}})};

if ( document.URL.indexOf("treasury") != -1 ) {
GM_xmlhttpRequest ( {
    method:     'GET',
    url:        'https://torax.outwar.com/profile',
    onload:     function (responseDetails) {
const EQ = /<div style="position:absolute; left:61px; top:12px; width:41px; height:41px;text-align:center">[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r].*/im;
const EQprint = EQ.exec(responseDetails.responseText);

var EQtreas = document.querySelector("#content-header-row > div.col-8.col-lg-3.pl-3.pl-xl-0.pr-1 > div > div.widget-heading");
EQtreas.innerHTML =

'<div id=EQtreas style="position:relative; width:300px; height:385px; background-image:url(https://studiomoxxi.com/ow_themes/custom_jobs/classic_01/thedude_dark.png)">' +
EQprint +
'</div>'

    }})};

// crew raid menus

var crewID = '';
if (document.documentElement.innerHTML.match(/href="\/crew_raidresults\.php\?crewid=(.*)">Raid Results<\/a>/i) != null)
crewID = document.documentElement.innerHTML.match(/href="\/crew_raidresults\.php\?crewid=(.*)">Raid Results<\/a>/i);


var crewID2 = document.documentElement.innerHTML.match(/tradeWith=(.*)"><svg/i);

if ( document.URL.indexOf("crew_profile") != -1 ) {
$('a[href="crew_raidresults.php?crewid='+crewID2[1]+'&most_recent=1"]').prop('href', 'https://torax.outwar.com/crew_raidresults.php?most_recent=MoxxiMod+raid+results&crewid='+crewID2[1]);

$('a[href="crew_raidresults.php?crewid='+crewID2[1]+'&most_recent=1"]').text("Bed 2");}

var crewmenu =

'<div class="btn-group" role="group">' +
'<button id="btnGroupDefault" type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">' +
'Moxxi Mod Raids <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down"><polyline points="6 9 12 15 18 9"></polyline></svg>' +
'</button>' +
'<div class="dropdown-menu" aria-labelledby="btnGroupDefault" style="will-change: transform;">' +
'<a class="dropdown-item" href="/crew_raidresults.php?most_recent=MoxxiMod+raid+results&crewid='+crewID[1]+'">Moxxi Mod Raid Results</a>' +
'<a class="dropdown-item" href="/crew_raidresults.php?all_results=Display+all+raid+results&crewid='+crewID[1]+'">All Raid Results</a>' +
'<a class="dropdown-item" href="/crew_raidresults.php?wins=Display+only+victorious+raids&crewid='+crewID[1]+'">Only Victorious Raids</a>' +
'</div>' +
'</div>'

if ( document.URL.indexOf("crew_") != -1 ) {
function insertAfter9(newNode, existingNode) {
existingNode.parentNode.insertBefore(newNode, existingNode.nextSibling);
}

var rrHead = document.querySelector("#content-header-row > div > div > div.btn-group.mb-3.mr-2");
let tdHead = document.createElement('div');
tdHead.innerHTML = crewmenu;

if (rrHead != null)
insertAfter9(tdHead, rrHead.children[2]);}