Only random fight with slimes/skeletons
This commit is contained in:
parent
6ed690ef74
commit
caa997179c
1 changed files with 12 additions and 2 deletions
14
bot.js
14
bot.js
|
@ -61,7 +61,7 @@ function mainLoop() {
|
|||
}
|
||||
} else {
|
||||
//RANDOM BOSS
|
||||
if(randomBossRefreshing() === true && botFightingRandomBoss === true && botFightingGlobalBoss === false) {
|
||||
if(randomBossRefreshing() === true && botFightingRandomBoss === true && botFightingGlobalBoss === false && haveSoldiers()) {
|
||||
botFightingRandomBoss = false;
|
||||
} else if(randomBossRefreshing() === false && botFightingRandomBoss === false) {
|
||||
clickSelector('#randomBossPortal a');
|
||||
|
@ -109,6 +109,16 @@ function mainLoop() {
|
|||
|
||||
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() {
|
||||
$('#chatbox, #groupchatbox').bind('DOMSubtreeModified', function() {
|
||||
var lastMessage = $(this).find('.chat-message').last();
|
||||
|
@ -163,7 +173,7 @@ function botBuildRaidReport(message) {
|
|||
var botRaidResult = (/won/.exec(message) !== null) ? 'won' : 'lost';
|
||||
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) {
|
||||
|
|
Loading…
Reference in a new issue