// ==UserScript==
// @name CookieClicker mod Menu
// @namespace CookieClicker cheat
// @include *orteil.dashnet.org/cookieclicker/*
// @description Extension for Cookie Clicker press tab to open cheat menu.
// @version 1.2
// @grant none
// @license MIT
// @downloadURL none
// ==/UserScript==
(function() {
'use strict';
// Variables pour suivre l'état des triches
const state = {
goldenCookieSpawnAndClick: false,
bigCookieClicker: false,
autoPurchaseObjects: false,
autoPurchaseUpgrades: false,
goldenCookieListener: false,
};
// Fonction pour activer/désactiver une fonctionnalité
function toggleFeature(feature, callbackActivate, callbackDeactivate) {
state[feature] = !state[feature];
if (state[feature]) {
callbackActivate();
} else {
callbackDeactivate();
}
}
// Menu HTML
const menu = document.createElement('div');
menu.style.position = 'fixed';
menu.style.top = '10%';
menu.style.left = '50%';
menu.style.transform = 'translateX(-50%)';
menu.style.backgroundColor = 'rgba(0, 0, 0, 0.8)';
menu.style.color = '#fff';
menu.style.padding = '15px';
menu.style.borderRadius = '10px';
menu.style.boxShadow = '0 4px 10px rgba(0, 0, 0, 0.5)';
menu.style.zIndex = '9999';
menu.style.display = 'none';
menu.style.fontFamily = 'Arial, sans-serif';
menu.innerHTML = `
Cookie Clicker Cheats
`;
document.body.appendChild(menu);
// Ajouter les événements pour les boutons
document.getElementById('toggleGoldenCookies').onclick = () => {
toggleFeature(
'goldenCookieSpawnAndClick',
() => {
state.goldenCookieSpawnAndClickInterval = setInterval(() => {
Game.goldenCookie.spawn();
Game.goldenCookie.click();
}, 5);
console.log('Golden Cookies Activated');
},
() => {
clearInterval(state.goldenCookieSpawnAndClickInterval);
console.log('Golden Cookies Deactivated');
}
);
};
document.getElementById('toggleBigCookie').onclick = () => {
toggleFeature(
'bigCookieClicker',
() => {
state.bigCookieClickerInterval = setInterval(() => Game.ClickCookie(), 5);
console.log('Big Cookie Clicker Activated');
},
() => {
clearInterval(state.bigCookieClickerInterval);
console.log('Big Cookie Clicker Deactivated');
}
);
};
document.getElementById('toggleAutoObjects').onclick = () => {
toggleFeature(
'autoPurchaseObjects',
() => {
state.autoPurchaseObjectsInterval = setInterval(() => {
const products = document.querySelectorAll('#products .enabled');
if (products.length > 0) products[products.length - 1].click();
}, 100);
console.log('Auto Purchase Objects Activated');
},
() => {
clearInterval(state.autoPurchaseObjectsInterval);
console.log('Auto Purchase Objects Deactivated');
}
);
};
document.getElementById('toggleAutoUpgrades').onclick = () => {
toggleFeature(
'autoPurchaseUpgrades',
() => {
state.autoPurchaseUpgradesInterval = setInterval(() => {
const upgrades = document.querySelectorAll('#upgrades .enabled');
if (upgrades.length > 0) upgrades[0].click();
}, 100);
console.log('Auto Purchase Upgrades Activated');
},
() => {
clearInterval(state.autoPurchaseUpgradesInterval);
console.log('Auto Purchase Upgrades Deactivated');
}
);
};
document.getElementById('resetGame').onclick = () => {
Game.Reset(true);
console.log('Game Reset!');
};
document.getElementById('closeMenu').onclick = () => {
menu.style.display = 'none';
};
// Afficher/Masquer le menu avec la touche Tab
document.addEventListener('keydown', (event) => {
if (event.key === 'Tab') {
event.preventDefault();
menu.style.display = menu.style.display === 'none' ? 'block' : 'none';
}
});
})();