A Cookie Clicker mod to automatically click the golden cookie
This file contains 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
let Millisecond = 1 | |
let Second = 1000 * Millisecond | |
let Minute = 60 * Second | |
let Hour = 60 * Minute | |
class GoldenClicker { | |
heartbeat() { | |
for (let s of Game.shimmers) { | |
if (s.type == "golden") { | |
s.pop() | |
} | |
} | |
let buff = Game.buffs["Click frenzy"] | |
if (buff) { | |
let frenzyClicker = setInterval(Game.ClickCookie, Second / 8) | |
setTimeout(clearInterval(frenzyClicker), buff.time) | |
Game.Popup("Clicking like crazy for you!") | |
console.log("Clicker interval:", frenzyClicker) | |
} | |
} | |
// Save state | |
save() { | |
return "" | |
} | |
// Load state | |
load(s) { | |
} | |
init() { | |
Game.registerHook("check", () => this.heartbeat) | |
} | |
} | |
Game.registerMod("Golden Clicker", new GoldenClicker()) | |
console.log("I thought I registered the mod... no?", GoldenClicker) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment