3 ms·
A small improvement would be to stop based on the balance, rather than a number of clicks, to avoid going into ludicrous Yes JS Numbers Are All Floats territory
by Terr_ 2y ago
A small improvement would be to stop based on the balance, rather than a number of clicks, to avoid going into ludicrous Yes JS Numbers Are All Floats territory.
let max_amt = 2000000000*2; // Twice most expensive item
let btn = $('.main-btn');
function cl() {
btn.click();
let curr = $(".main-stat-num").innerText.replace(/\D/g, '');
if (curr < max_amt) {
setTimeout(cl, 1)
}
}
cl()