Testing for only popup or action

This commit is contained in:
Andrew Tomaka 2015-04-10 14:24:57 -04:00
parent 20961faa4d
commit c899373dd8

74
bot.js
View file

@ -46,6 +46,7 @@ function mainLoop() {
case 'BATTLE REPORT':
case 'Battle Report':
case 'ACTIVITY PASSED!':
case 'ACTIVITY FAILED!':
case 'SCENARIO #1':
case 'Lobby closed':
case 'Wait':
@ -55,48 +56,49 @@ 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) {
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) {
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"]');
}
}
}