mirror of
https://github.com/Luzifer/automate-cookie-clicker.git
synced 2024-12-23 10:41:17 +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==
|
// ==UserScript==
|
||||||
// @name Automate CookieClicker
|
// @name Automate CookieClicker
|
||||||
// @namespace https://luzifer.io/
|
// @namespace https://luzifer.io/
|
||||||
// @version 0.5.1
|
// @version 0.5.2
|
||||||
// @description Automate everything!
|
// @description Automate everything!
|
||||||
// @author Knut Ahlers <knut@ahlers.me>
|
// @author Knut Ahlers <knut@ahlers.me>
|
||||||
// @match http://orteil.dashnet.org/cookieclicker/
|
// @match http://orteil.dashnet.org/cookieclicker/
|
||||||
|
@ -28,6 +28,7 @@ function autoPurchaseUpgrades() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the top enabled purchase to be made
|
// Get the top enabled purchase to be made
|
||||||
|
if ($('.product.unlocked.enabled').length > 0) {
|
||||||
let topPurchase = $('.product.unlocked.enabled').last();
|
let topPurchase = $('.product.unlocked.enabled').last();
|
||||||
let topPurchaseCount = 0;
|
let topPurchaseCount = 0;
|
||||||
if (topPurchase.find('.owned').text() != "") {
|
if (topPurchase.find('.owned').text() != "") {
|
||||||
|
@ -38,6 +39,7 @@ function autoPurchaseUpgrades() {
|
||||||
topPurchase.click();
|
topPurchase.click();
|
||||||
toastr.info('Purchased ' + topPurchase.find('.title:first').text() + ' for you.');
|
toastr.info('Purchased ' + topPurchase.find('.title:first').text() + ' for you.');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkCPS() {
|
function checkCPS() {
|
||||||
|
|
Loading…
Reference in a new issue