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:
parent
b9b2705a78
commit
ca590a990a
1 changed files with 2 additions and 6 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue