From 611f5250d49acac0ca0623d25e4a30e37346b7de Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Wed, 15 Apr 2015 19:18:23 -0400 Subject: [PATCH] Fix for botPurchasing bug --- public/bot.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/public/bot.js b/public/bot.js index b1152d1..bba8075 100644 --- a/public/bot.js +++ b/public/bot.js @@ -61,7 +61,6 @@ function mainLoop() { } break; case 'WHOOPS!': - botPurchasing = false; case 'BATTLE REPORT': case 'Battle Report': case 'ACTIVITY PASSED!': @@ -105,7 +104,7 @@ function mainLoop() { } //BUY SCIENTISTS - if(haveBossCoins() && haveCheapLabor() && botPurchasing === false && haveMaxRBMinion()) { + if(haveBossCoins(1) && haveCheapLabor() && botPurchasing === false && haveMaxRBMinion()) { botPurchasing = true; clickSelector('button[name="hiremax_scientists"]'); } @@ -128,7 +127,7 @@ function mainLoop() { botPurchasing = true; clickSelector('button[name="buymax-' + mostEfficientWorker() + '"]'); } - if(botBuyWorkers === true && haveCheapLabor() === true && botPurchasing === false && haveBossCoins()) { + if(botBuyWorkers === true && haveCheapLabor() === true && botPurchasing === false && haveBossCoins(9)) { botPurchasing = true; clickSelector('button[name="buymax-capturedminion"]'); } @@ -295,8 +294,8 @@ function trillions(number) { return number * 1000000000000; } -function haveBossCoins() { - if($('#bc_display').text() != 0) { +function haveBossCoins(value) { + if(convertToNumber($('#bc_display').text()) >= value) { return true; } else { return false;