Only process message or action

This commit is contained in:
Andrew Tomaka 2015-04-13 18:42:38 -04:00
parent 42331e6a2e
commit c876c8be4b

76
bot.js
View file

@ -1,4 +1,5 @@
var botLoop;
var botGlobalBossTimer;
var botPaused = true;
var botPurchasing = false;
var botRaiding = false;
@ -7,7 +8,6 @@ var botFightingGlobalBoss = false;
var botBuySlimes = false;
var botFightGlobal = true;
var botRaidTarget = null;
var botGlobalBossTimer;
function mainLoop() {
if($('#popup').is(':visible')) {
@ -56,48 +56,48 @@ function mainLoop() {
console.log('Unknown popup: ' + botPopupTitle);
break;
}
}
} else {
//RANDOM BOSS
if(randomBossRefreshing() === true && botFightingRandomBoss === true && botFightingGlobalBoss === false) {
botFightingRandomBoss = false;
} else if(randomBossRefreshing() === false && botFightingRandomBoss === false) {
clickSelector('#randomBossPortal a');
botFightingRandomBoss = true;
}
//RANDOM BOSS
if(randomBossRefreshing() === true && botFightingRandomBoss === true && botFightingGlobalBoss === false) {
botFightingRandomBoss = false;
} else if(randomBossRefreshing() === false && botFightingRandomBoss === false) {
clickSelector('#randomBossPortal a');
botFightingRandomBoss = true;
}
//GLOBAL BOSS
if(globalBossRefreshing() === true && botFightingGlobalBoss === true) {
clearInterval(botGlobalBossTimer);
botFightingGlobalBoss = false;
} else if(globalBossRefreshing() === false && botFightingGlobalBoss === false && botFightGlobal === true) {
clickSelector('span[name="timeRemaining"]:contains("JOIN") a');
botGlobalBossTimer = setInterval(fightGlobalBoss, 250);
botFightingGlobalBoss = true;
}
//GLOBAL BOSS
if(globalBossRefreshing() === true && botFightingGlobalBoss === true) {
clearInterval(botGlobalBossTimer);
botFightingGlobalBoss = false;
} else if(globalBossRefreshing() === false && botFightingGlobalBoss === false && botFightGlobal === true) {
clickSelector('span[name="timeRemaining"]:contains("JOIN") a');
botGlobalBossTimer = setInterval(fightGlobalBoss, 250);
botFightingGlobalBoss = true;
}
//ACTIVATE BUFFS
if(inactiveBuffs()) {
clickSelector('button:contains("Activate")');
}
//ACTIVATE BUFFS
if(inactiveBuffs()) {
clickSelector('button:contains("Activate")');
}
//BUY SCIENTISTS
if(haveBossCoins() && haveCheapLabor()) {
botPurchasing = true;
clickSelector('button[name="hiremax_scientists"]');
}
//BUY SCIENTISTS
if(haveBossCoins() && haveCheapLabor()) {
botPurchasing = true;
clickSelector('button[name="hiremax_scientists"]');
}
//RAID
if(raidRefreshing() === false && haveRaidTarget() === true) {
clickSelector('button[name="raid_button"]');
botFillIn('input[name="raid_user"]', botRaidTarget);
botRaiding = true;
}
//RAID
if(raidRefreshing() === false && haveRaidTarget() === true) {
clickSelector('button[name="raid_button"]');
botFillIn('input[name="raid_user"]', botRaidTarget);
botRaiding = true;
}
//BUY SLIMES
if(botBuySlimes === true && haveTrillions(10) && botPurchasing === false) {
botPurchasing = true;
clickSelector('button[name="buymax-knight"]');
//BUY SLIMES
if(botBuySlimes === true && haveTrillions(10) && botPurchasing === false) {
botPurchasing = true;
clickSelector('button[name="buymax-knight"]');
}
}
}