Update CUnleash.js

This commit is contained in:
David Duran Rosich
2026-05-28 23:59:49 +02:00
parent c00aa75bc4
commit a57f932d64

View File

@@ -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() {