mirror of
https://github.com/Luzifer/automate-cookie-clicker.git
synced 2024-12-23 02:31:18 +00:00
Do not try to buy when there is nothing to buy
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
f489079569
commit
447bc7d2d1
1 changed files with 12 additions and 10 deletions
|
@ -1,7 +1,7 @@
|
|||
// ==UserScript==
|
||||
// @name Automate CookieClicker
|
||||
// @namespace https://luzifer.io/
|
||||
// @version 0.5.1
|
||||
// @version 0.5.2
|
||||
// @description Automate everything!
|
||||
// @author Knut Ahlers <knut@ahlers.me>
|
||||
// @match http://orteil.dashnet.org/cookieclicker/
|
||||
|
@ -28,6 +28,7 @@ function autoPurchaseUpgrades() {
|
|||
}
|
||||
|
||||
// Get the top enabled purchase to be made
|
||||
if ($('.product.unlocked.enabled').length > 0) {
|
||||
let topPurchase = $('.product.unlocked.enabled').last();
|
||||
let topPurchaseCount = 0;
|
||||
if (topPurchase.find('.owned').text() != "") {
|
||||
|
@ -38,6 +39,7 @@ function autoPurchaseUpgrades() {
|
|||
topPurchase.click();
|
||||
toastr.info('Purchased ' + topPurchase.find('.title:first').text() + ' for you.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function checkCPS() {
|
||||
|
|
Loading…
Reference in a new issue