-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.js
62 lines (51 loc) · 1.57 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
(async () => {
const random = (min, max) =>
Math.floor(Math.random() * (max - min + 1) + min);
// Pause between tab switches (10 sec)
const pauseBetweenTabSwitches = [5 * 1000, 15 * 1000];
// Pause after mining (20 sec)
const pauseAndAfterMinig = [15 * 1000, 25 * 1000];
// Close error popup if need
setInterval(() => {
const btnCancel = document.querySelector(
".container-card-error .btn-cancel"
);
if (btnCancel) btnCancel?.click();
}, random(8 * 1000, 12 * 1000));
setInterval(() => {
const btnConfirm = document.querySelector(
".container-setting .btn-confirm"
);
if (btnConfirm) btnConfirm?.click();
}, random(3 * 1000, 7 * 1000));
// Let's start
const leftPanelBts = [
...(
document.querySelector(".tab-right") ||
document.querySelector(".tab-left")
)
.closest("div")
.querySelectorAll("button"),
];
while (1) {
for (const leftPanelBt of leftPanelBts) {
leftPanelBt.click();
await new Promise((res) =>
setTimeout(res, random(...pauseBetweenTabSwitches))
);
const claimBtns = [...document.querySelectorAll(".btn-claim")];
for (let i = claimBtns.length; i > 1; --i) {
const claimBtn = document.querySelector(
`.container-menu-right .h-full:nth-child(${i - 1}) .btn-claim`
);
claimBtn.click();
await new Promise((res) =>
setTimeout(res, random(...pauseAndAfterMinig))
);
}
}
await new Promise((res) =>
setTimeout(res, random(...pauseBetweenTabSwitches))
);
}
})();