mirror of
https://github.com/Luzifer/automate-cookie-clicker.git
synced 2024-12-23 02:31:18 +00:00
Fix: Number contains words, only check for zero
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
d9877b6413
commit
f489079569
1 changed files with 6 additions and 4 deletions
|
@ -1,7 +1,7 @@
|
||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name Automate CookieClicker
|
// @name Automate CookieClicker
|
||||||
// @namespace https://luzifer.io/
|
// @namespace https://luzifer.io/
|
||||||
// @version 0.5.0
|
// @version 0.5.1
|
||||||
// @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/
|
||||||
|
@ -42,9 +42,11 @@ function autoPurchaseUpgrades() {
|
||||||
|
|
||||||
function checkCPS() {
|
function checkCPS() {
|
||||||
let cps = parseInt($('#cookies').children('div').text().split(': ')[1]);
|
let cps = parseInt($('#cookies').children('div').text().split(': ')[1]);
|
||||||
if (cps < 3000 && window.autoClicker == undefined) {
|
if (cps == 0) {
|
||||||
|
if (window.autoClicker == undefined) {
|
||||||
window.autoClicker = window.setInterval(autoClick, 1);
|
window.autoClicker = window.setInterval(autoClick, 1);
|
||||||
} else {
|
}
|
||||||
|
} else if (cps > 3000) {
|
||||||
if (window.autoClicker != undefined) {
|
if (window.autoClicker != undefined) {
|
||||||
window.clearInterval(window.autoClicker);
|
window.clearInterval(window.autoClicker);
|
||||||
window.autoClicker = undefined;
|
window.autoClicker = undefined;
|
||||||
|
|
Loading…
Reference in a new issue