From a57f932d64c4c53903e204cd1a547f3b48ba3219 Mon Sep 17 00:00:00 2001 From: David Duran Rosich Date: Thu, 28 May 2026 23:59:49 +0200 Subject: [PATCH] Update CUnleash.js --- CUnleash.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/CUnleash.js b/CUnleash.js index 86eda94..c1cabcb 100644 --- a/CUnleash.js +++ b/CUnleash.js @@ -25,12 +25,11 @@ setInterval(function () { (function () { "use strict"; - let state = true; + let state = false; let intervalId; document.addEventListener("keydown", function (event) { if (event.code === "KeyX") { - state = !state; // toggle state if (state) { // code to run when state is ON console.log("State is ON"); @@ -49,21 +48,23 @@ setInterval(function () { intervalId = setInterval(function () { Game.ClickCookie(); }, 4); + state = true; } function stopAutoClicker() { console.log("Auto-clicker stopped"); Game.Notify(`Auto clicker OFF`, `Press X to toggle`, [0, 35], false); clearInterval(intervalId); + state = false; } // Wait for the Game object to be defined, then start the auto-clicker - const waitIntervalId = setInterval(function () { - if (typeof Game !== "undefined") { - clearInterval(waitIntervalId); - stopAutoClicker(); - } - }, 1000); + // const waitIntervalId = setInterval(function () { + // if (typeof Game !== "undefined") { + // clearInterval(waitIntervalId); + // stopAutoClicker(); + // } + // }, 1000); })(); // setInterval(function() {