1
0
Fork 0
mirror of https://github.com/Luzifer/automate-cookie-clicker.git synced 2024-12-22 18:21:18 +00:00

Automagically manage Santa

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2018-04-22 02:33:44 +02:00
parent 23dc21bdfc
commit 17f923aadd
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E

View file

@ -1,7 +1,7 @@
// ==UserScript== // ==UserScript==
// @name Automate CookieClicker // @name Automate CookieClicker
// @namespace https://luzifer.io/ // @namespace https://luzifer.io/
// @version 0.19.2 // @version 0.20.0
// @description Automate everything! // @description Automate everything!
// @author Knut Ahlers <knut@ahlers.me> // @author Knut Ahlers <knut@ahlers.me>
// @source https://github.com/Luzifer/automate-cookie-clicker // @source https://github.com/Luzifer/automate-cookie-clicker
@ -66,8 +66,6 @@ function executeAutoActions() {
availableProducts = Game.ObjectsById.filter(obj => obj.price < Game.cookies && obj.amount < getMaxBuy()); availableProducts = Game.ObjectsById.filter(obj => obj.price < Game.cookies && obj.amount < getMaxBuy());
} }
manageDragon();
} }
function controlAutoClicker() { function controlAutoClicker() {
@ -107,6 +105,9 @@ function installHelper() {
blockingUpgrades = blockingUpgrades.concat(Game.UpgradesByPool['toggle'].map(obj => obj.id)); blockingUpgrades = blockingUpgrades.concat(Game.UpgradesByPool['toggle'].map(obj => obj.id));
Game.customChecks.push(controlAutoClicker); Game.customChecks.push(controlAutoClicker);
Game.customChecks.push(manageDragon);
Game.customChecks.push(manageSanta);
Game.customLogic.push(executeAutoActions); Game.customLogic.push(executeAutoActions);
} }
@ -120,6 +121,11 @@ function manageDragon() {
// This will just open a select dialogue... // This will just open a select dialogue...
} }
function manageSanta() {
let moni = Math.pow(Game.santaLevel + 1, Game.santaLevel + 1);
if (Game.cookies > moni && Game.santaLevel < 14) Game.UpgradeSanta();
}
function note(msg, quick = true) { function note(msg, quick = true) {
// Icon: img/icons.png 0-based indices // Icon: img/icons.png 0-based indices
Game.Notify('Auto-CookieClicker', msg, [12, 0], quick, true); Game.Notify('Auto-CookieClicker', msg, [12, 0], quick, true);