Finally, click on the start button, and it's all good!"
setTimeout(function() {
if (sessionStorage.ait === "true") {
$("btn btn-green hud-intro-play").click()
}
var GoldObserver;
var gold;
var isInWorld = setInterval(function() {
if (Game.currentGame.world.inWorld) {
clearInterval(isInWorld)
setTimeout(function() {
gold = Game.currentGame.world.localPlayer.entity.fromTick.gold
GoldObserver = function(goldAmount, doFunction) {
var Observer = setInterval(function() {
if (Game.currentGame.world.localPlayer.entity.fromTick.gold !== gold) {
gold = Game.currentGame.world.localPlayer.entity.fromTick.gold
}
if (gold > goldAmount) {
doFunction()
clearInterval(Observer)
}
})
}
console.log(GoldObserver)
if (sessionStorage.ait === "true") {
GoldObserver(10500, function() {
if (sessionStorage.ait) {
$("hud-spell-icon")[1].click()
sessionStorage.ait = "true"
Observer.observe($("hud-ticker-bar"), {
attributes: true,
attributeFilter: ['style']
})
} else {
sessionStorage.setItem("ait", "false")
}
})
}
var Observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
if ($("hud-ticker-bar").style.backgroundPosition === "-2.65417px 0px") {
console.log("changed!")
window.location.href = "http://zombs.io/#/" + Game.currentGame.options.serverId + "/" + Game.currentGame.ui.playerPartyShareKey + "/aito"
window.location.reload()
}
})
})
$("btn btn-green start-aito").addEventListener("click", function() {
if (sessionStorage.ait) {
sessionStorage.ait = "true"
Observer.observe($("hud-ticker-bar"), {
attributes: true,
attributeFilter: ['style']
})
} else {
sessionStorage.setItem("ait", "false")
}
})
$("btn btn-green stop-aito").addEventListener("click", function stop() {
sessionStorage.ait = "false"
})
}, 500)
}
}, 100)
}, 250)
}, 1500)
}