From 2f3eeb5a616397bf842953a69774b28d92b790ad Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Sat, 14 Apr 2018 18:05:24 +0200 Subject: [PATCH] Instead of doing string magic use a number Signed-off-by: Knut Ahlers --- autocookieclicker.user.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/autocookieclicker.user.js b/autocookieclicker.user.js index 77b006f..9186bd5 100644 --- a/autocookieclicker.user.js +++ b/autocookieclicker.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Automate CookieClicker // @namespace https://luzifer.io/ -// @version 0.8.1 +// @version 0.8.2 // @description Automate everything! // @author Knut Ahlers // @source https://github.com/Luzifer/automate-cookie-clicker @@ -54,12 +54,12 @@ function executeAutoActions() { } function checkCPS() { - let cps = parseInt($('#cookies').children('div').text().split(': ')[1]); - if (cps == 0) { + let cps = Game.cookiesPs; + if (cps < 3000) { if (window.autoClicker == undefined) { window.autoClicker = window.setInterval(autoClick, 1); } - } else if (cps > 3000) { + } else { if (window.autoClicker != undefined) { window.clearInterval(window.autoClicker); window.autoClicker = undefined;