Skip to content

Instantly share code, notes, and snippets.

@kewldan
Last active March 29, 2024 18:50
Show Gist options
  • Save kewldan/1aae5042d9dec1fa398dc010fef294b8 to your computer and use it in GitHub Desktop.
Save kewldan/1aae5042d9dec1fa398dc010fef294b8 to your computer and use it in GitHub Desktop.
Notcoin abuse
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')
}
@kewldan
Copy link
Author

kewldan commented Jan 8, 2024

How to use:

  1. Enable telegram web app inspecting by following Official Telegram Guide
    image
  2. Open Notcoin on Desktop and press RMB on Mini App. Then open console and paste code
  3. Write START(80) (Where 80 is clicks for 5 sec +- 10%) to start script and STOP() to stop it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment