From 17f923aadd97c58ba3f9bff86bc82e19c765335d Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Sun, 22 Apr 2018 02:33:44 +0200 Subject: [PATCH] Automagically manage Santa Signed-off-by: Knut Ahlers --- autocookieclicker.user.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/autocookieclicker.user.js b/autocookieclicker.user.js index 22e6d15..92a9a95 100644 --- a/autocookieclicker.user.js +++ b/autocookieclicker.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Automate CookieClicker // @namespace https://luzifer.io/ -// @version 0.19.2 +// @version 0.20.0 // @description Automate everything! // @author Knut Ahlers // @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()); } - - manageDragon(); } function controlAutoClicker() { @@ -107,6 +105,9 @@ function installHelper() { blockingUpgrades = blockingUpgrades.concat(Game.UpgradesByPool['toggle'].map(obj => obj.id)); Game.customChecks.push(controlAutoClicker); + Game.customChecks.push(manageDragon); + Game.customChecks.push(manageSanta); + Game.customLogic.push(executeAutoActions); } @@ -120,6 +121,11 @@ function manageDragon() { // 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) { // Icon: img/icons.png 0-based indices Game.Notify('Auto-CookieClicker', msg, [12, 0], quick, true);