1
0
Fork 0
mirror of https://github.com/Luzifer/automate-cookie-clicker.git synced 2024-11-09 14:30:08 +00:00

Simplify max-buy

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2018-04-14 18:51:51 +02:00
parent b9b2705a78
commit ca590a990a
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.9.5 // @version 0.10.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
@ -69,11 +69,7 @@ function debug(msg) {
} }
function getMaxBuy() { function getMaxBuy() {
var topPurchaseCount = 0; let topPurchaseCount = Game.ObjectsById[Game.ObjectsN - 1].amount;
var topPurchaseTextCount = $('#product14').find('.owned').text();
if (topPurchaseTextCount != "") {
topPurchaseCount = parseInt(topPurchaseTextCount);
}
return Math.max(Math.ceil((topPurchaseCount + 1) / purchaseSteps), 1) * purchaseSteps; return Math.max(Math.ceil((topPurchaseCount + 1) / purchaseSteps), 1) * purchaseSteps;
} }