Merge branch 'master' of git.atomaka.com:atomaka/trugul-bot

This commit is contained in:
Andrew Tomaka 2015-04-16 08:11:56 -04:00
commit cb57d54508

View file

@ -15,6 +15,7 @@ var botFightRandom = true;
var botRaidTarget = null; var botRaidTarget = null;
var botLastRandom = 0; var botLastRandom = 0;
var botLastRaid = 0; var botLastRaid = 0;
var botLastPurchase = 0;
var botSleeping = false; var botSleeping = false;
var botUser = null; var botUser = null;
@ -103,12 +104,6 @@ function mainLoop() {
clickSelector('button:contains("Activate")'); clickSelector('button:contains("Activate")');
} }
//BUY SCIENTISTS
if(haveBossCoins() && haveCheapLabor() && botPurchasing === false && haveMaxRBMinion()) {
botPurchasing = true;
clickSelector('button[name="hiremax_scientists"]');
}
//RAID //RAID
if(raidRefreshing() === false && haveRaidTarget() === true && internalRaidRefreshing() === false) { if(raidRefreshing() === false && haveRaidTarget() === true && internalRaidRefreshing() === false) {
clickSelector('button[name="raid_button"]'); clickSelector('button[name="raid_button"]');
@ -116,19 +111,34 @@ function mainLoop() {
botRaiding = true; botRaiding = true;
} }
//PURCHASES
if(botTimestamp() > botLastPurchase + 5 && botPurchasing === true) {
botPurchasing = false;
}
//BUY SCIENTISTS
if(haveBossCoins(1) && haveCheapLabor() && botPurchasing === false && haveMaxRBMinion()) {
botPurchasing = true;
botLastPurchase = botTimestamp();
clickSelector('button[name="hiremax_scientists"]');
}
//BUY SLIMES //BUY SLIMES
if(botBuySlimes === true && haveTrillions(BOT_SLIME_MONEY) && botPurchasing === false) { if(botBuySlimes === true && haveTrillions(BOT_SLIME_MONEY) && botPurchasing === false) {
botPurchasing = true; botPurchasing = true;
botLastPurchase = botTimestamp();
clickSelector('button[name="buymax-knight"]'); clickSelector('button[name="buymax-knight"]');
} }
//BUY WORKERS //BUY WORKERS
if(botBuyWorkers === true && haveTrillions(BOT_WORKER_MONEY) && haveCheapLabor() === true && botPurchasing === false) { if(botBuyWorkers === true && haveTrillions(BOT_WORKER_MONEY) && haveCheapLabor() === true && botPurchasing === false) {
botPurchasing = true; botPurchasing = true;
botLastPurchase = botTimestamp();
clickSelector('button[name="buymax-' + mostEfficientWorker() + '"]'); clickSelector('button[name="buymax-' + mostEfficientWorker() + '"]');
} }
if(botBuyWorkers === true && haveCheapLabor() === true && botPurchasing === false && haveBossCoins()) { if(botBuyWorkers === true && haveCheapLabor() === true && botPurchasing === false && haveBossCoins(9)) {
botPurchasing = true; botPurchasing = true;
botLastPurchase = botTimestamp();
clickSelector('button[name="buymax-capturedminion"]'); clickSelector('button[name="buymax-capturedminion"]');
} }
} }
@ -294,8 +304,8 @@ function trillions(number) {
return number * 1000000000000; return number * 1000000000000;
} }
function haveBossCoins() { function haveBossCoins(value) {
if($('#bc_display').text() != 0) { if(convertToNumber($('#bc_display').text()) >= value) {
return true; return true;
} else { } else {
return false; return false;