From ca590a990a00b500e881d8df2ff813fbe01b3a42 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Sat, 14 Apr 2018 18:51:51 +0200 Subject: [PATCH] Simplify max-buy Signed-off-by: Knut Ahlers --- autocookieclicker.user.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/autocookieclicker.user.js b/autocookieclicker.user.js index 40b775b..5a12803 100644 --- a/autocookieclicker.user.js +++ b/autocookieclicker.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Automate CookieClicker // @namespace https://luzifer.io/ -// @version 0.9.5 +// @version 0.10.0 // @description Automate everything! // @author Knut Ahlers // @source https://github.com/Luzifer/automate-cookie-clicker @@ -69,11 +69,7 @@ function debug(msg) { } function getMaxBuy() { - var topPurchaseCount = 0; - var topPurchaseTextCount = $('#product14').find('.owned').text(); - if (topPurchaseTextCount != "") { - topPurchaseCount = parseInt(topPurchaseTextCount); - } + let topPurchaseCount = Game.ObjectsById[Game.ObjectsN - 1].amount; return Math.max(Math.ceil((topPurchaseCount + 1) / purchaseSteps), 1) * purchaseSteps; }