-
-
Save vielhuber/06eef5f7aa8353606ae33d63ebd42008 to your computer and use it in GitHub Desktop.
| coins = 42, | |
| sourceId = localStorage.getItem('sourceId').split('"').join(''), | |
| deviceLogId = localStorage.getItem('deviceLogId').split('"').join(''), | |
| users = JSON.parse(localStorage.getItem('users')); | |
| users.forEach(users__value => { | |
| fetch('https://logger-lb-5.anton.app/events', { | |
| method: 'POST', | |
| 'headers': { 'Content-Type': 'application/json' }, | |
| body: JSON.stringify({ | |
| "events":[{"event":"adjustCoins","value":coins,"src":sourceId,"created":(new Date()).toISOString()}], | |
| "log":users__value.l, | |
| "credentials":{"authToken":users__value.t,"deviceLogId":deviceLogId} | |
| }), | |
| }).then(v=>v).catch(v=>v).then(data => { window.location.reload(); }); | |
| }); |
And how to hack the bestlist to be first / make bots im new in this dimension
and another:// A much more robust, testable, and extensible coin store
// Improvements (~3x better):
// 1) Encapsulation + immutability where possible
// 2) Typed guards, clamping, and overflow safety
// 3) Subscribe / unsubscribe API with immediate sync
// 4) Persistence layer abstraction (pluggable)
// 5) Dev-friendly debugging hooks
const createCoinStore = ({
initial = 0,
min = 0,
max = Number.MAX_SAFE_INTEGER,
persist = null, // { load(): number, save(v:number): void }
} = {}) => {
let value = clampInt(initial, min, max);
const listeners = new Set();
// --- helpers ---
function clampInt(v, lo, hi) {
if (!Number.isFinite(v)) throw new Error("Value must be finite");
v = Math.trunc(v);
return Math.min(hi, Math.max(lo, v));
}
function emit() {
for (const fn of listeners) fn(value);
}
function set(v) {
const next = clampInt(v, min, max);
if (next === value) return; // avoid useless updates
value = next;
persist?.save?.(value);
emit();
}
function add(delta) {
if (!Number.isFinite(delta)) throw new Error("delta must be finite");
set(value + delta);
}
function subscribe(fn, { immediate = true } = {}) {
if (typeof fn !== "function") throw new Error("listener must be a function");
listeners.add(fn);
if (immediate) fn(value);
return () => listeners.delete(fn); // unsubscribe
}
function get() {
return value;
}
// --- init from persistence ---
if (persist?.load) {
try {
set(persist.load());
} catch (e) {
console.warn("Failed to load coins, using initial value", e);
}
}
return Object.freeze({ get, set, add, subscribe });
};
// --- Persistence implementation (localStorage) ---
const localStoragePersist = {
load() {
const v = Number(localStorage.getItem("coins") ?? 0);
return Number.isFinite(v) ? v : 0;
},
save(v) {
localStorage.setItem("coins", String(v));
},
};
// --- Store instance ---
const coinStore = createCoinStore({
initial: 0,
min: 0,
persist: localStoragePersist,
});
// --- UI binding ---
const unsubscribeUI = coinStore.subscribe((v) => {
const el = document.querySelector("#coins");
if (el) el.textContent = String(v);
});
// --- Public API (game code) ---
function addCoins(amount) {
coinStore.add(amount);
}
// --- Example usage ---
addCoins(42);
addCoins(-10);
// --- Dev / debug helpers ---
window.coinDebug = {
get: coinStore.get,
set: coinStore.set,
add: coinStore.add,
};
Ok thx im really new in javascript and try to analyse this that im later also can write such things
and another:// A much more robust, testable, and extensible coin store // Improvements (~3x better): // 1) Encapsulation + immutability where possible // 2) Typed guards, clamping, and overflow safety // 3) Subscribe / unsubscribe API with immediate sync // 4) Persistence layer abstraction (pluggable) // 5) Dev-friendly debugging hooks
const createCoinStore = ({ initial = 0, min = 0, max = Number.MAX_SAFE_INTEGER, persist = null, // { load(): number, save(v:number): void } } = {}) => { let value = clampInt(initial, min, max); const listeners = new Set();
// --- helpers --- function clampInt(v, lo, hi) { if (!Number.isFinite(v)) throw new Error("Value must be finite"); v = Math.trunc(v); return Math.min(hi, Math.max(lo, v)); }
function emit() { for (const fn of listeners) fn(value); }
function set(v) { const next = clampInt(v, min, max); if (next === value) return; // avoid useless updates value = next; persist?.save?.(value); emit(); }
function add(delta) { if (!Number.isFinite(delta)) throw new Error("delta must be finite"); set(value + delta); }
function subscribe(fn, { immediate = true } = {}) { if (typeof fn !== "function") throw new Error("listener must be a function"); listeners.add(fn); if (immediate) fn(value); return () => listeners.delete(fn); // unsubscribe }
function get() { return value; }
// --- init from persistence --- if (persist?.load) { try { set(persist.load()); } catch (e) { console.warn("Failed to load coins, using initial value", e); } }
return Object.freeze({ get, set, add, subscribe }); };
// --- Persistence implementation (localStorage) --- const localStoragePersist = { load() { const v = Number(localStorage.getItem("coins") ?? 0); return Number.isFinite(v) ? v : 0; }, save(v) { localStorage.setItem("coins", String(v)); }, };
// --- Store instance --- const coinStore = createCoinStore({ initial: 0, min: 0, persist: localStoragePersist, });
// --- UI binding --- const unsubscribeUI = coinStore.subscribe((v) => { const el = document.querySelector("#coins"); if (el) el.textContent = String(v); });
// --- Public API (game code) --- function addCoins(amount) { coinStore.add(amount); }
// --- Example usage --- addCoins(42); addCoins(-10);
// --- Dev / debug helpers --- window.coinDebug = { get: coinStore.get, set: coinStore.set, add: coinStore.add, };
I’m not sure what you want to achieve with this, but all this does is implement a local coin storage, that has nothing to do with ANTONs. (Still cool I g but how does this help here? (Also, if you didn’t use an LLM, I will eat my broom (haha)))
And the other one is also overengineered, it just does the same local storage thing but with the actually real ANTON "log" function. (Btw the log thing actually is used for data storage, idk why but it’s not just for debug purposes)
As I said maybe you guys should look at the code of the frontend projects (like for example app01), maybe you’ll understand what the code you sent actually does.
You can parse the PDO that the client actually uses, or get it from here: https://projects.anton.app/update?project=app01&branch=master&version=0 (this is just json, so it’s much easier to parse)
ow man i am hacked. sad.
ow man i am hacked. sad.
what?
der hack wurde gepacht ich hab einen neuen der funktioniert
WIE WELCHER
https://gist.github.com/QQLol-hash/724b3e27db76023042738beee30b8672
Nice ein neuer skiddi ist gejoint
Kann mir wer coins geben znjt-mqs2
i am hacked frome someone ,i have -100 coins :(
Ich bin gerade am kacken...
Nice :)
1 Anton hack is easy working
Kann mir wer coins geben znjt-mqs2
Joa bist du on?
Ja
Ich könnte
Now you have coins
Now you have coins
ey bro
Ja
Hat funktioniert aber bitte lösche deinen Beitrag sonst können anderendeinen Account klauen
@carlobloemer7 kannst du das bei meinem anderen Account auch machen ich flehe dich an hier Name koda1 und Code Pfuk-nakt Danke
Habe dir Coins Gegeben viel Spass dir
Ok thx i will test it later , im not the best in js and im want to learn it