From f489079569aacf41ae4367a0d7cf20daf95b390a Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Mon, 12 Feb 2018 20:27:32 +0100 Subject: [PATCH] Fix: Number contains words, only check for zero Signed-off-by: Knut Ahlers --- autocookieclicker.user.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/autocookieclicker.user.js b/autocookieclicker.user.js index b47b9ef..264c66f 100644 --- a/autocookieclicker.user.js +++ b/autocookieclicker.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Automate CookieClicker // @namespace https://luzifer.io/ -// @version 0.5.0 +// @version 0.5.1 // @description Automate everything! // @author Knut Ahlers // @match http://orteil.dashnet.org/cookieclicker/ @@ -42,9 +42,11 @@ function autoPurchaseUpgrades() { function checkCPS() { let cps = parseInt($('#cookies').children('div').text().split(': ')[1]); - if (cps < 3000 && window.autoClicker == undefined) { - window.autoClicker = window.setInterval(autoClick, 1); - } else { + if (cps == 0) { + if (window.autoClicker == undefined) { + window.autoClicker = window.setInterval(autoClick, 1); + } + } else if (cps > 3000) { if (window.autoClicker != undefined) { window.clearInterval(window.autoClicker); window.autoClicker = undefined;