From 9b6752a37e69972d2441593a0c41a8c0f84cc3e4 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Wed, 11 Apr 2018 22:39:33 +0200 Subject: [PATCH] Simplify overflow to next purchase boundary Signed-off-by: Knut Ahlers --- autocookieclicker.user.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/autocookieclicker.user.js b/autocookieclicker.user.js index 9c716ad..8ebbc24 100644 --- a/autocookieclicker.user.js +++ b/autocookieclicker.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Automate CookieClicker // @namespace https://luzifer.io/ -// @version 0.6.0 +// @version 0.6.1 // @description Automate everything! // @author Knut Ahlers // @match http://orteil.dashnet.org/cookieclicker/ @@ -67,13 +67,7 @@ function getMaxBuy() { topPurchaseCount = parseInt(topPurchaseTextCount); } - var max = Math.max(Math.ceil(topPurchaseCount / 50), 1) * 50; - if (topPurchaseCount == max) { - // Special case: Cap was already bought - max += 50; - } - - return max; + return Math.max(Math.ceil((topPurchaseCount + 1) / 50), 1) * 50; } (function() {