mirror of
https://github.com/Luzifer/automate-cookie-clicker.git
synced 2024-11-08 14:00:12 +00:00
Simplify max-buy
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
b9b2705a78
commit
ca590a990a
1 changed files with 2 additions and 6 deletions
|
@ -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 <knut@ahlers.me>
|
||||
// @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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue