Only random fight with slimes/skeletons

This commit is contained in:
Andrew Tomaka 2015-04-13 21:42:34 -04:00
parent 6ed690ef74
commit caa997179c

14
bot.js
View file

@ -61,7 +61,7 @@ function mainLoop() {
} }
} else { } else {
//RANDOM BOSS //RANDOM BOSS
if(randomBossRefreshing() === true && botFightingRandomBoss === true && botFightingGlobalBoss === false) { if(randomBossRefreshing() === true && botFightingRandomBoss === true && botFightingGlobalBoss === false && haveSoldiers()) {
botFightingRandomBoss = false; botFightingRandomBoss = false;
} else if(randomBossRefreshing() === false && botFightingRandomBoss === false) { } else if(randomBossRefreshing() === false && botFightingRandomBoss === false) {
clickSelector('#randomBossPortal a'); clickSelector('#randomBossPortal a');
@ -109,6 +109,16 @@ function mainLoop() {
botToggle(); botToggle();
function haveSoldiers() {
if(convertToNumber($('tr[name="knight"] > .owned').text()) == 0) {
return false;
} else if(convertToNumber($('tr[name="advknight"] > .owned').text()) == 0) {
return false;
} else {
return true;
}
}
function chatMonitor() { function chatMonitor() {
$('#chatbox, #groupchatbox').bind('DOMSubtreeModified', function() { $('#chatbox, #groupchatbox').bind('DOMSubtreeModified', function() {
var lastMessage = $(this).find('.chat-message').last(); var lastMessage = $(this).find('.chat-message').last();
@ -163,7 +173,7 @@ function botBuildRaidReport(message) {
var botRaidResult = (/won/.exec(message) !== null) ? 'won' : 'lost'; var botRaidResult = (/won/.exec(message) !== null) ? 'won' : 'lost';
var botRaidStolen = (/steal (.*?) from/.exec(message) !== null) ? /steal (.*?) from/.exec(message)[1] : '$0'; var botRaidStolen = (/steal (.*?) from/.exec(message) !== null) ? /steal (.*?) from/.exec(message)[1] : '$0';
return "RAIDED (" + botRaidUser + "): " + botRaidResult + "; souldiers: -" + botRaidSoldiers + "; " + botRaidResult + " money: " + botRaidStolen; return "RAIDED (" + botRaidUser + "): " + botRaidResult + "; soldiers: -" + botRaidSoldiers + "; " + botRaidResult + " money: " + botRaidStolen;
} }
function haveTrillions(number) { function haveTrillions(number) {