Add play/pause functions
This commit is contained in:
parent
a8cfc86972
commit
6419abb381
1 changed files with 19 additions and 9 deletions
28
bot.js
28
bot.js
|
@ -1,4 +1,4 @@
|
||||||
var globalBossTracker;
|
var activeTimers = [];
|
||||||
|
|
||||||
function delayClick(selector, seconds) {
|
function delayClick(selector, seconds) {
|
||||||
var timer = setInterval(
|
var timer = setInterval(
|
||||||
|
@ -13,13 +13,23 @@ function delayClick(selector, seconds) {
|
||||||
return timer;
|
return timer;
|
||||||
}
|
}
|
||||||
|
|
||||||
delayClick('#popup span button:contains("Summon Boss")', 3);
|
function play() {
|
||||||
delayClick('#popup span button:contains("CONTINUE")', 3);
|
activeTimers.push(delayClick('#popup span button:contains("Summon Boss")', 3));
|
||||||
delayClick('#randomBossPortal a', 20);
|
activeTimers.push(delayClick('#popup span button:contains("CONTINUE")', 3));
|
||||||
delayClick('span[name="timeRemaining"]:contains("JOIN") a', 80);
|
activeTimers.push(delayClick('#randomBossPortal a', 20));
|
||||||
|
activeTimers.push(delayClick('span[name="timeRemaining"]:contains("JOIN") a', 80));
|
||||||
|
|
||||||
setInterval(function() {
|
var timer = setInterval(function() {
|
||||||
if($('img[name="globalBossImg"]').is(':visible')) {
|
if($('img[name="globalBossImg"]').is(':visible')) {
|
||||||
$('img[name="globalBossImg"]').get(0).click();
|
$('img[name="globalBossImg"]').get(0).click();
|
||||||
|
}
|
||||||
|
}, 1000);
|
||||||
|
|
||||||
|
activeTimers.push(timer);
|
||||||
|
}
|
||||||
|
|
||||||
|
function pause() {
|
||||||
|
for(var i = 0; i < activeTimers.length; i++) {
|
||||||
|
clearInterval(activeTimers[i]);
|
||||||
}
|
}
|
||||||
}, 1000);
|
}
|
||||||
|
|
Loading…
Reference in a new issue