|
const switches = [74, 84, 85, 182, 183, 184, 185, 209, 331, 333, 361, 414, 452, 563] |
|
|
|
setInterval(Game.ClickCookie) // keep clicking the big cookie |
|
|
|
setInterval(() => { |
|
// cast Force the Hand of Fate when magic is almost full |
|
let grimoire = Game.ObjectsById[7].minigame |
|
if (grimoire.magic / grimoire.magicM > 0.95) |
|
grimoire.castSpell(grimoire.spellsById[1]) |
|
|
|
// kill the most sucked wrinklers when there are more than eight wrinklers |
|
let wrinklers = Game.wrinklers.filter(w => w.close).sort((x, y) => y.sucked - x.sucked) |
|
if (wrinklers.length > 8) |
|
for (let wrinkler of wrinklers.slice(0, wrinklers.length - 8)) |
|
wrinkler.hp = 0 |
|
|
|
// upgrade the dragon |
|
let currentDragonLevel = -1 |
|
while (Game.dragonLevel < 23 && currentDragonLevel != Game.dragonLevel) { |
|
currentDragonLevel = Game.dragonLevel |
|
Game.UpgradeDragon() |
|
} |
|
}, 60000) // check the above every minute |
|
|
|
setInterval(() => { |
|
// click the news ticker that tells a fortune |
|
if (Game.TickerEffect) |
|
Game.tickerL.click() |
|
|
|
// click all the golden cookies, wrath cookies and reindeers |
|
while (Game.shimmers.length) |
|
for (let s of Game.shimmers) |
|
s.pop() |
|
|
|
// buy all the affordable upgrades |
|
for (let u of Game.UpgradesInStore) { |
|
if (switches.includes(u.id) || u.bought) // skip switches |
|
continue |
|
if (u.getPrice() < Game.cookies) |
|
u.buy() |
|
} |
|
|
|
// buy all the affordable buildings with the highest CPS per price |
|
for (let t = Game.ObjectsById[0]; t.price < Game.cookies;) { |
|
for (let o of Game.ObjectsById) |
|
if (o.price < t.price && o.storedCps * t.price > t.storedCps * o.price) |
|
t = o |
|
if (t.price < Game.cookies) |
|
t.buy(1) |
|
} |
|
}, 1000) // check the above every second |
What this script doing automatically