setInterval(function() {
openBox();
setTimeout(function () {
let data = JSON.parse(response);
data.forEach(function(entry) {
entry.btn.click();
setTimeout(function () {
entry.btnClose.click();
}, 3000);
});
setTimeout(function () {
btn.click();
}, 3000);
}, 3000);
}, 10000);
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
while (true) {
await sleep(10000);
openBox();
await sleep(3000);
const data = JSON.parse(response);
for (const entry of data) {
entry.btn.click(); // рили?
await sleep(3000);
entry.btnClose.click();
}
await sleep(3000);
btn.click();
}