-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathpoppig_bot.js
56 lines (48 loc) · 2.33 KB
/
poppig_bot.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
/******************************************************************************************
* INSTRUCTIONS:
* 1 - Open "poppig.click" website.
* 2 - Open Console (Ctrl + Shift + I).
* 3 - Reload the website (F5).
* 4 - Copy from line 11 to 56, paste in Console and press Enter to run.
*
* Additional info: https://github.com/MokuMoki/PopHub#poppig-bothack
*******************************************************************************************/
let loop = 0, ok = 0, err = 0;
const loopAmount = 100; //amount of requests to send (recommended: 100)
const loopInterval = 30; //time to wait before sending the requests (recommended: 30)
async function fetchTokens() {
let jsonToken;
try {
let getUUID = await fetch('/getuuid');
let jsonData = await getUUID.json();
let uuid = jsonData.uuid;
let getToken = await fetch('/gettoken?uuid=' + uuid);
jsonToken = await getToken.json();
setTimeout(() => { spamClicks(jsonToken.token) }, loopInterval * 1000);
} catch (err) {
fetchTokens();
}
}
async function spamClicks(tokenkey) {
loop++;
let submitScore = await fetch('/submitscore', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ token: tokenkey, clicked2: 800 })
});
let jsonScore = await submitScore.json();
(jsonScore.status == 0) ? ok++ : err++;
fetchTokens(); //fetch new token for every response
}
function displayStatus() {
console.clear();
console.log(`%cAdministered: ${loop}, %cSuccess: ${ok} (${ok * 800} clicks), %cRejected: ${err}`, "color: aqua", "color: lime;", "color: orange;");
}
if (loopAmount > 1300) { throw `Your loopAmount is too high (${loopAmount}), please reload the page and run the script with lower loopAmount value.` }
for (let i = 0; i < loopAmount; i++) {
fetchTokens(); //fetch the first batch of tokens
}
console.clear();
console.warn("To save resources, please disable network recording by going to Network (top row, next to Console) and click on the red button (first icon) to stop recording.");
if (loopAmount > 250) { console.warn(`You have set a high loopAmount (${loopAmount}), which will cause the system to lag when bot is running. Consider using a lower value if you experiencing lag.`)}
setInterval(() => { displayStatus() }, 3000);