Add ability to save spears

This commit is contained in:
Andrew Tomaka 2015-04-23 09:56:49 -04:00
parent a01f733f35
commit cd5399a4ab

View file

@ -17,6 +17,7 @@ var botFightGlobal = true;
var botFightRandom = true; var botFightRandom = true;
var botSpendBossCoins = true; var botSpendBossCoins = true;
var botChatClear = true; var botChatClear = true;
var botSaveSpears = true;
var botRaidTarget = null; var botRaidTarget = null;
var botLastRandom = 0; var botLastRandom = 0;
var botLastRaid = 0; var botLastRaid = 0;
@ -120,7 +121,7 @@ function mainLoop() {
//ACTIVATE BUFFS //ACTIVATE BUFFS
if(inactiveBuffs()) { if(inactiveBuffs()) {
clickSelector('button:contains("Activate")'); activateBuffs();
} }
//RAID //RAID
@ -167,6 +168,19 @@ function mainLoop() {
botDetectUser(); botDetectUser();
botToggle(); botToggle();
function activateBuffs() {
$('div[name="items_holder"]').children().each(function() {
var itemHolder = $(this);
if(itemHolder.attr('item') != 'godspear_fragment' || botSaveSpears === false) {
var itemButton = itemHolder.find('button:contains("Activate")');
if(itemButton.length > 0) {
itemButton.get(0).click()
}
}
});
}
function setBotToPurchasing() { function setBotToPurchasing() {
botPurchasing = true; botPurchasing = true;
botLastPurchase = botTimestamp(); botLastPurchase = botTimestamp();
@ -489,11 +503,21 @@ function botToggleBossCoins() {
console.log('Stopping spending boss coins'); console.log('Stopping spending boss coins');
botSpendBossCoins = false; botSpendBossCoins = false;
} else { } else {
console.log('starting spending boss coins'); console.log('Starting spending boss coins');
botSpendBossCoins = true; botSpendBossCoins = true;
} }
} }
function botToggleSaveSpears() {
if(botSaveSpears) {
console.log('Stopping saving spears');
botSaveSpears = false;
} else {
console.log('Starting saving spears');
botSaveSpears = true;
}
}
function botHelp() { function botHelp() {
console.log('bt(): Toggle for the entire bot.'); console.log('bt(): Toggle for the entire bot.');
console.log('bs(): Toggle "sleep mode." Disables all actions, but logs raids and chat.'); console.log('bs(): Toggle "sleep mode." Disables all actions, but logs raids and chat.');
@ -504,6 +528,7 @@ function botHelp() {
console.log('btr(): Toggle the random boss.'); console.log('btr(): Toggle the random boss.');
console.log('btc(): Toggle the chat clear.'); console.log('btc(): Toggle the chat clear.');
console.log('btb(): Toggle boss coins spending.'); console.log('btb(): Toggle boss coins spending.');
console.log('bta(): Toggle saving of spears.');
console.log('bst("username"): Set a target to raid every 5 minutes.'); console.log('bst("username"): Set a target to raid every 5 minutes.');
console.log('bct(): Clear the raid target.'); console.log('bct(): Clear the raid target.');
} }
@ -517,5 +542,6 @@ function btg() { botToggleGlobal(); }
function btr() { botToggleRandom(); } function btr() { botToggleRandom(); }
function btc() { botToggleChatClear(); } function btc() { botToggleChatClear(); }
function btb() { botToggleBossCoins(); } function btb() { botToggleBossCoins(); }
function bta() { botToggleSaveSpears(); }
function bst(username) { botSetTarget(username); } function bst(username) { botSetTarget(username); }
function bct() { botClearTarget(); } function bct() { botClearTarget(); }