Update CUnleash.js
This commit is contained in:
17
CUnleash.js
17
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() {
|
||||
|
||||
Reference in New Issue
Block a user