Last active
March 29, 2024 18:50
-
-
Save kewldan/1aae5042d9dec1fa398dc010fef294b8 to your computer and use it in GitHub Desktop.
Notcoin abuse
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function STOP() { | |
clearInterval(window.__interval); // Stop the loop | |
console.log('STOPPED') | |
} | |
function __SEND(endpoint, data) { | |
return new Promise(accept => { | |
fetch('https://clicker-api.joincommunity.xyz' + endpoint, { //API endpoint | |
method: 'POST', | |
body: JSON.stringify(data), | |
headers: { | |
Authorization: 'Bearer ' + JSON.parse(localStorage.getItem('access-token')), // Auth header from localstorage | |
'Content-Type': 'application/json' // Required header | |
} | |
}).then(req => { | |
req.json().then(res => { | |
accept(res); | |
}); | |
}); | |
}); | |
} | |
function CLICK(count) { | |
__SEND('/clicker/core/click', { //API endpoint | |
count, // Click count | |
hash: window.__ok ? eval(window.__payload.hash.map(t => atob(t)).join("+")) : 0, // Calculated hash | |
webAppData: window.Telegram.WebApp.initData // Web app data from Telegram SDK | |
}).then(res => { | |
if (res.ok) { | |
window.__payload = res.data[0]; // Save payload | |
window.__ok = true; // Previous request was OK and i have hash | |
console.log(`Clicked: ${count}`); | |
console.log(`Balance: ${window.__payload.balanceCoins}`); | |
console.log(`Energy left: ${window.__payload.availableCoins}`) | |
} else { | |
console.error(res.data); | |
} | |
}); | |
} | |
function START(count) { | |
window.__interval = setInterval(() => CLICK(count + Math.floor((Math.random() * 2 - 1) * count * 0.1)), 5000); // Start the loop | |
console.log('STARTED') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to use:
START(80)
(Where 80 is clicks for 5 sec +- 10%) to start script andSTOP()
to stop it