Skip to content

Instantly share code, notes, and snippets.

@nealey
Last active October 1, 2021 21:55
Show Gist options
  • Save nealey/fad1c3916cc080a1467c9aac4b5a7b52 to your computer and use it in GitHub Desktop.
Save nealey/fad1c3916cc080a1467c9aac4b5a7b52 to your computer and use it in GitHub Desktop.
A Cookie Clicker mod to automatically click the golden cookie
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