mirror of
https://github.com/Luzifer/automate-cookie-clicker.git
synced 2024-11-08 14:00:12 +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() != "") {
|
||||
|
@ -39,6 +40,7 @@ function autoPurchaseUpgrades() {
|
|||
toastr.info('Purchased ' + topPurchase.find('.title:first').text() + ' for you.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function checkCPS() {
|
||||
let cps = parseInt($('#cookies').children('div').text().split(': ')[1]);
|
||||
|
|
Loading…
Reference in a new issue