Revert from tracking botTickActiity

This commit is contained in:
Andrew Tomaka 2015-04-09 23:16:36 -04:00
parent 2e3ca91401
commit b4d33f9842

21
bot.js
View file

@ -5,13 +5,10 @@ var botRaiding = false;
var botFightingRandomBoss = false; var botFightingRandomBoss = false;
var botFightingGlobalBoss = false; var botFightingGlobalBoss = false;
var botBuySlimes = false; var botBuySlimes = false;
var botTickActivity = false;
var botRaidTarget = null; var botRaidTarget = null;
var botGlobalBossTimer; var botGlobalBossTimer;
function mainLoop() { function mainLoop() {
botTickActivity = false;
if($('#popup').is(':visible')) { if($('#popup').is(':visible')) {
var botPopupTitle = $('#popup p[name="title"]').text(); var botPopupTitle = $('#popup p[name="title"]').text();
switch(botPopupTitle) { switch(botPopupTitle) {
@ -61,51 +58,45 @@ function mainLoop() {
} }
//RANDOM BOSS //RANDOM BOSS
if(randomBossRefreshing() === true && botFightingRandomBoss === true && botTickActivity === false) { if(randomBossRefreshing() === true && botFightingRandomBoss === true) {
botFightingRandomBoss = false; botFightingRandomBoss = false;
} else if(randomBossRefreshing() === false && botFightingRandomBoss === false) { } else if(randomBossRefreshing() === false && botFightingRandomBoss === false) {
clickSelector('#randomBossPortal a'); clickSelector('#randomBossPortal a');
botFightingRandomBoss = true; botFightingRandomBoss = true;
botTickActivity = true;
} }
//GLOBAL BOSS //GLOBAL BOSS
if(globalBossRefreshing() === true && botFightingGlobalBoss === true && botTickActivity === false) { if(globalBossRefreshing() === true && botFightingGlobalBoss === true) {
clearInterval(botGlobalBossTimer); clearInterval(botGlobalBossTimer);
botFightingGlobalBoss = false; botFightingGlobalBoss = false;
} else if(globalBossRefreshing() === false && botFightingGlobalBoss === false) { } else if(globalBossRefreshing() === false && botFightingGlobalBoss === false) {
clickSelector('span[name="timeRemaining"]:contains("JOIN") a'); clickSelector('span[name="timeRemaining"]:contains("JOIN") a');
botGlobalBossTimer = setInterval(fightGlobalBoss, 250); botGlobalBossTimer = setInterval(fightGlobalBoss, 250);
botFightingGlobalBoss = true; botFightingGlobalBoss = true;
botTickActivity = true;
} }
//ACTIVATE BUFFS //ACTIVATE BUFFS
if(inactiveBuffs() && botTickActivity === false) { if(inactiveBuffs()) {
clickSelector('button:contains("Activate")'); clickSelector('button:contains("Activate")');
botTickActivity = true;
} }
//BUY SCIENTISTS //BUY SCIENTISTS
if(haveBossCoins() && haveCheapLabor() && botTickActivity === false) { if(haveBossCoins() && haveCheapLabor()) {
botPurchasing = true; botPurchasing = true;
clickSelector('button[name="hiremax_scientists"]'); clickSelector('button[name="hiremax_scientists"]');
botTickActivity = true;
} }
//RAID //RAID
if(raidRefreshing() === false && haveRaidTarget() === true && botTickActivity === false) { if(raidRefreshing() === false && haveRaidTarget() === true) {
clickSelector('button[name="raid_button"]'); clickSelector('button[name="raid_button"]');
botFillIn('input[name="raid_user"]', botRaidTarget); botFillIn('input[name="raid_user"]', botRaidTarget);
botTickActivity = true;
botRaiding = true; botRaiding = true;
} }
//BUY SLIMES //BUY SLIMES
if(botBuySlimes === true && haveTrillions(10) && botTickActivity === false) { if(botBuySlimes === true && haveTrillions(10) && botPurchasing === false) {
botPurchasing = true; botPurchasing = true;
clickSelector('button[name="buymax-knight"]'); clickSelector('button[name="buymax-knight"]');
botTickActivity = true;
} }
} }