MJ: attack coordinator update / various fixes . captcha and back button and jitterloop 2 secs
This commit is contained in:
@@ -14,15 +14,16 @@ function randInt(min, max) {
|
||||
return Math.floor(Math.random() * (max - min + 1)) + min;
|
||||
}
|
||||
|
||||
// Schedules fn to run after a random ms delay, then reschedules itself
|
||||
function jitterLoop(fn, minMs, maxMs) {
|
||||
function schedule() {
|
||||
// Schedules fn to run after a random ms delay, then reschedules itself.
|
||||
// Optional initialDelayMs sets the delay for the very first run only.
|
||||
function jitterLoop(fn, minMs, maxMs, initialDelayMs) {
|
||||
function schedule(delay) {
|
||||
setTimeout(async () => {
|
||||
await fn();
|
||||
schedule();
|
||||
}, randInt(minMs, maxMs));
|
||||
schedule(randInt(minMs, maxMs));
|
||||
}, delay);
|
||||
}
|
||||
schedule();
|
||||
schedule(initialDelayMs !== undefined ? initialDelayMs : randInt(minMs, maxMs));
|
||||
}
|
||||
|
||||
function log(msg) {
|
||||
|
||||
Reference in New Issue
Block a user