// ==UserScript== // @name Gladiatus Tools // @namespace https://greasyfork.org/users/904482 // @version 0.0.4 // @description Set of tools and aids for the game Gladiatus // @author lpachecob // @grant none // @match *.gladiatus.gameforge.com/game/index.php* // @icon https://lobby.gladiatus.gameforge.com/favicon.ico // @license MIT // @downloadURL none // ==/UserScript== if ( window.location.search.split("&")[0] == "?mod=guildMarket" && window.location.search.split("&")[1] != "submod=control" ) { MarketHelps(); } else if ( window.location.search.split("&")[0] == "?mod=guildMarket" && window.location.search.split("&")[1] == "submod=control" ) { //comming soon } else if (window.location.search.split("&")[0] == "?mod=auction") { AcutionHouseTools(); } else if ( window.location.search.split("&")[0] == "?mod=forge" && window.location.search.split("&")[1] == "submod=smeltery" ) { SmelteryTimeSaverExtension(); } autoGuardarOro(); function autoGuardarOro() { let oro = parseFloat(document.getElementById("sstat_gold_val").textContent); let header_game = document.getElementById("header_game"); let ObjetosMercado = document.getElementById("market_item_table").children[0]; let elements = document.getElementById("market_item_table").children[0]; let elementsArray = [].slice.call(elements.children); let elementsOnlyTR = [] let itemsCanBuy = []; for (let index = 0; index < elementsArray.length; index++) { let element = elementsArray[index]; if (element.tagName == "TR") { elementsOnlyTR.push(element) } } for (let item of elementsOnlyTR) { if (item.children[0].children[0] != undefined) { itemsCanBuy.push(item) } } header_game.insertAdjacentHTML( "beforeend", ` ` ); let NotificarOro = document.getElementById("NotificarOro"); //.checked indica si está activo o no if (JSON.parse(localStorage.NotificarOro) == undefined) { localStorage.NotificarOro = NotificarOro.checked } else { NotificarOro.checked = JSON.parse(localStorage.NotificarOro); } NotificarOro.addEventListener("change", () => { localStorage.NotificarOro = NotificarOro.checked; }) window.addEventListener("load", () => { if (document.getElementById("mmonetbar") != undefined && JSON.parse(localStorage.NotificarOro) == true) { if (oro > 50.000) { let mensaje = ""; if (Math.floor(oro / 50.000) >= 2) { mensaje += `Empaqueta ` + Math.floor(oro / 50.000) + ` rotativos de 50k ` } else if (Math.floor(oro / 50.000) == 1) { mensaje += `Empaqueta ` + Math.floor(oro / 50.000) + ` rotativo de 50k ` } if (Math.floor(oro / 100.000) >= 2) { mensaje += `Empaqueta ` + Math.floor(oro / 100.000) + ` rotativos de 100k ` } else if (Math.floor(oro / 100.000) == 1) { mensaje += `Empaqueta ` + Math.floor(oro / 100.000) + ` rotativo de 100k ` } if (Math.floor(oro / 200.000) >= 2) { mensaje += `Empaqueta ` + Math.floor(oro / 200.000) + ` rotativos de 100k ` } else if (Math.floor(oro / 200.000) == 1) { mensaje += `Empaqueta ` + Math.floor(oro / 200.000) + ` rotativo de 200k ` } if (Math.floor(oro / 500.000) >= 2) { mensaje += `Empaqueta ` + Math.floor(oro / 500.000) + ` rotativos de 100k ` } else if (Math.floor(oro / 500.000) == 1) { mensaje += `Empaqueta ` + Math.floor(oro / 500.000) + ` rotativo de 500k ` } if (Math.floor(oro / 1000.000) >= 2) { mensaje += `Empaqueta ` + Math.floor(oro / 1000.000) + ` rotativos de 100k ` } else if (Math.floor(oro / 1000.000) == 1) { mensaje += `Empaqueta ` + Math.floor(oro / 1000.000) + ` rotativo de 1kk ` } if (mensaje != "") { document.getElementById("mmonetbar").insertAdjacentHTML( "beforeend", `
` + mensaje + `