Abstract purchase requirement to global variable

This commit is contained in:
Andrew Tomaka 2015-04-14 17:19:05 -04:00
parent d2c0b25476
commit e238c25762

7
bot.js
View file

@ -1,3 +1,6 @@
var BOT_WORKER_MONEY = 1;
var BOT_SLIME_MONEY = 10;
var botLoop; var botLoop;
var botGlobalBossTimer; var botGlobalBossTimer;
var botPaused = true; var botPaused = true;
@ -114,13 +117,13 @@ function mainLoop() {
} }
//BUY SLIMES //BUY SLIMES
if(botBuySlimes === true && haveTrillions(10) && botPurchasing === false) { if(botBuySlimes === true && haveTrillions(BOT_SLIME_MONEY) && botPurchasing === false) {
botPurchasing = true; botPurchasing = true;
clickSelector('button[name="buymax-knight"]'); clickSelector('button[name="buymax-knight"]');
} }
//BUY WORKERS //BUY WORKERS
if(botBuyWorkers === true && haveTrillions(10) && haveCheapLabor() === true && botPurchasing === false) { if(botBuyWorkers === true && haveTrillions(BOT_WORKER_MONEY) && haveCheapLabor() === true && botPurchasing === false) {
botPurchasing = true; botPurchasing = true;
clickSelector('button[name="buymax-' + mostEfficientWorker() + '"]'); clickSelector('button[name="buymax-' + mostEfficientWorker() + '"]');
} }