From e238c25762fb7f4ee3ffb749232f4c9724d2afce Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Tue, 14 Apr 2015 17:19:05 -0400 Subject: [PATCH] Abstract purchase requirement to global variable --- bot.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bot.js b/bot.js index d9345cc..8960377 100644 --- a/bot.js +++ b/bot.js @@ -1,3 +1,6 @@ +var BOT_WORKER_MONEY = 1; +var BOT_SLIME_MONEY = 10; + var botLoop; var botGlobalBossTimer; var botPaused = true; @@ -114,13 +117,13 @@ function mainLoop() { } //BUY SLIMES - if(botBuySlimes === true && haveTrillions(10) && botPurchasing === false) { + if(botBuySlimes === true && haveTrillions(BOT_SLIME_MONEY) && botPurchasing === false) { botPurchasing = true; clickSelector('button[name="buymax-knight"]'); } //BUY WORKERS - if(botBuyWorkers === true && haveTrillions(10) && haveCheapLabor() === true && botPurchasing === false) { + if(botBuyWorkers === true && haveTrillions(BOT_WORKER_MONEY) && haveCheapLabor() === true && botPurchasing === false) { botPurchasing = true; clickSelector('button[name="buymax-' + mostEfficientWorker() + '"]'); }