mirror of
https://github.com/Luzifer/automate-cookie-clicker.git
synced 2024-11-09 14:30:08 +00:00
Simplify overflow to next purchase boundary
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
4de087373a
commit
9b6752a37e
1 changed files with 2 additions and 8 deletions
|
@ -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 <knut@ahlers.me>
|
||||
// @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() {
|
||||
|
|
Loading…
Reference in a new issue