// ==UserScript== // @name Cookie Clicker Mod Menu // @namespace https://orteil.dashnet.org/cookieclicker/ // @version 1.3Beta // @description Mod menu for Cookie Clicker. // @author DarkDeath // @match https://orteil.dashnet.org/cookieclicker/* // @icon https://www.google.com/s2/favicons?sz=64&domain=dashnet.org // @grant none // @license MIT // @downloadURL https://update.greasyfork.icu/scripts/509045/Cookie%20Clicker%20Mod%20Menu.user.js // @updateURL https://update.greasyfork.icu/scripts/509045/Cookie%20Clicker%20Mod%20Menu.meta.js // ==/UserScript== (function() { let clickInterval; const style = document.createElement('style'); style.textContent = ` #cookie-clicker-menu { position: fixed; top: 10px; right: 10px; background-color: rgba(0, 0, 0, 0.8); color: white; border: 1px solid #ccc; padding: 10px; z-index: 1000000; font-family: Arial, sans-serif; width: 200px; } #cookie-clicker-menu h3 { margin: 0; padding-bottom: 10px; cursor: move; user-select: none; border-bottom: 1px solid #ccc; margin-bottom: 10px; } #cookie-clicker-menu button { display: block; width: 100%; margin-bottom: 5px; padding: 5px; background-color: #007bff; color: white; border: none; border-radius: 5px; cursor: pointer; transition: background-color 0.3s; } #cookie-clicker-menu button:hover { background-color: #0056b3; } #ruin-the-fun { background-color: #dc3545 !important; } #ruin-the-fun:hover { background-color: #c82333 !important; } .custom-window { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background-color: rgba(0, 0, 0, 0.9); color: white; border: 1px solid #ccc; padding: 20px; z-index: 1000001; font-family: Arial, sans-serif; width: 300px; text-align: center; } .custom-window input { width: 100%; padding: 5px; margin: 10px 0; box-sizing: border-box; } .custom-window button { margin: 5px; padding: 5px 10px; background-color: #007bff; color: white; border: none; border-radius: 5px; cursor: pointer; } .custom-window button:hover { background-color: #0056b3; } `; document.head.appendChild(style); const menu = document.createElement('div'); menu.id = 'cookie-clicker-menu'; menu.innerHTML = `
${message}
`; document.body.appendChild(alertWindow); const okBtn = alertWindow.querySelector('.ok'); okBtn.addEventListener('click', () => { document.body.removeChild(alertWindow); }); } // Auto-click functionality function autoClickCookie(interval) { if (typeof interval !== 'number' || interval <= 0) { console.error("Please provide a valid interval in milliseconds."); return; } if (!clickInterval) { clickInterval = setInterval(() => { Game.ClickCookie(); }, interval); } else { createAlertWindow("Auto clicker is already running."); } } function stopAutoClickCookie() { if (clickInterval) { clearInterval(clickInterval); clickInterval = null; console.log("Auto clicker stopped."); } else { console.warn("Auto clicker is not currently running."); } } // Gain lumps functionality function getLumps() { createInputWindow("Gain Lumps", "Enter number of lumps", (lumps) => { if (lumps && !isNaN(Number(lumps))) { Game.gainLumps(Number(lumps)); createAlertWindow(`Gained ${lumps} lumps`); } else { createAlertWindow("Please enter a valid number."); } }); } // Ruin The Fun functionality function ruinTheFun() { if (confirm("Are you sure you want to ruin the fun? This action cannot be undone!")) { Game.RuinTheFun(1); createAlertWindow("The fun has been ruined!"); } } function buyAll() { Game.storeBuyAll(); createInputWindow("Buy All", "How much do you want to buy?", (times) => { if (times && !isNaN(Number(times))) { for (let i in Game.Objects) { Game.Objects[i].getFree(Number(times)); } createAlertWindow(`Bought all objects ${times} times.`); } else { createAlertWindow("Please enter a valid number."); } }); } function setCookies() { createInputWindow("Set Cookies", "Enter number of cookies", (cookies) => { if (cookies && !isNaN(Number(cookies))) { Game.cookies = Number(cookies); createAlertWindow(`Successfully set your cookies to ${cookies}`); } else { createAlertWindow("Please enter a valid number."); } }); } // Event listeners for buttons document.getElementById('start-auto-click').addEventListener('click', () => autoClickCookie(10)); document.getElementById('stop-auto-click').addEventListener('click', stopAutoClickCookie); document.getElementById('gain-lumps').addEventListener('click', getLumps); document.getElementById('buy-times').addEventListener('click', buyAll); document.getElementById('ruin-the-fun').addEventListener('click', ruinTheFun); document.getElementById('set-cookies').addEventListener('click', setCookies); console.log("Cookie Clicker mod menu added. Drag the title to move the menu."); })();