CookieClicker mod Menu

Extension for Cookie Clicker press Tab to open cheat menu.

安装此脚本?
作者推荐脚本

您可能也喜欢CookieClicker

安装此脚本
  1. // ==UserScript==
  2. // @name CookieClicker mod Menu
  3. // @namespace CookieClicker cheat
  4. // @include *orteil.dashnet.org/cookieclicker/*
  5. // @description Extension for Cookie Clicker press Tab to open cheat menu.
  6. // @version 1.3
  7. // @grant none
  8. // @license MIT
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. // Variables pour suivre l'état des triches
  15. const state = {
  16. bigCookieClicker: false,
  17. autoPurchaseObjects: false,
  18. autoPurchaseUpgrades: false,
  19. autoGetCookies: false, // Auto farm de cookies
  20. };
  21.  
  22. // Fonction pour activer/désactiver une fonctionnalité
  23. function toggleFeature(feature, callbackActivate, callbackDeactivate) {
  24. state[feature] = !state[feature];
  25. if (state[feature]) {
  26. callbackActivate();
  27. } else {
  28. callbackDeactivate();
  29. }
  30. }
  31.  
  32. // Fonction pour obtenir des cookies instantanément
  33. function getmorecookie() {
  34. let ta = atob(Game.WriteSave(1).replace(/%3D/g, '').replace(/%21END%21/g, ''));
  35. ta = ta.replace(/([^\|])\|([\w.e+]+);/, (a, b, c) => b + '|' + Number.MAX_VALUE + ';');
  36. ta = btoa(ta) + '%21END%21';
  37. Game.LoadSave(ta);
  38. Game.WriteSave();
  39. }
  40.  
  41. // Menu HTML
  42. const menu = document.createElement('div');
  43. menu.style.position = 'fixed';
  44. menu.style.top = '10%';
  45. menu.style.left = '50%';
  46. menu.style.transform = 'translateX(-50%)';
  47. menu.style.backgroundColor = 'rgba(0, 0, 0, 0.8)';
  48. menu.style.color = '#fff';
  49. menu.style.padding = '15px';
  50. menu.style.borderRadius = '10px';
  51. menu.style.boxShadow = '0 4px 10px rgba(0, 0, 0, 0.5)';
  52. menu.style.zIndex = '9999';
  53. menu.style.display = 'none';
  54. menu.style.fontFamily = 'Arial, sans-serif';
  55. menu.innerHTML = `
  56. <h3 style="margin-top: 0; text-align: center;">Cookie Clicker Cheats</h3>
  57. <ul style="list-style: none; padding: 0;">
  58. <li><button id="toggleBigCookie" style="width: 100%; margin-bottom: 5px;">Big Cookie Clicker</button></li>
  59. <li><button id="toggleAutoObjects" style="width: 100%; margin-bottom: 5px;">Auto Purchase Objects</button></li>
  60. <li><button id="toggleAutoUpgrades" style="width: 100%; margin-bottom: 5px;">Auto Purchase Upgrades</button></li>
  61. <li><button id="toggleAutoCookies" style="width: 100%; margin-bottom: 5px;">Cookie spammer</button></li>
  62. <li><button id="resetGame" style="width: 100%; margin-bottom: 5px; background-color: #f44336;">Reset Game</button></li>
  63. </ul>
  64. <button id="closeMenu" style="width: 100%; background-color: #555;">Close Menu</button>
  65. `;
  66.  
  67. document.body.appendChild(menu);
  68.  
  69. // Ajouter les événements pour les boutons
  70. document.getElementById('toggleBigCookie').onclick = () => {
  71. toggleFeature(
  72. 'bigCookieClicker',
  73. () => {
  74. state.bigCookieClickerInterval = setInterval(() => Game.ClickCookie(), 5);
  75. console.log('Big Cookie Clicker Activated');
  76. },
  77. () => {
  78. clearInterval(state.bigCookieClickerInterval);
  79. console.log('Big Cookie Clicker Deactivated');
  80. }
  81. );
  82. };
  83.  
  84. document.getElementById('toggleAutoObjects').onclick = () => {
  85. toggleFeature(
  86. 'autoPurchaseObjects',
  87. () => {
  88. state.autoPurchaseObjectsInterval = setInterval(() => {
  89. const products = document.querySelectorAll('#products .enabled');
  90. if (products.length > 0) products[products.length - 1].click();
  91. }, 100);
  92. console.log('Auto Purchase Objects Activated');
  93. },
  94. () => {
  95. clearInterval(state.autoPurchaseObjectsInterval);
  96. console.log('Auto Purchase Objects Deactivated');
  97. }
  98. );
  99. };
  100.  
  101. document.getElementById('toggleAutoUpgrades').onclick = () => {
  102. toggleFeature(
  103. 'autoPurchaseUpgrades',
  104. () => {
  105. state.autoPurchaseUpgradesInterval = setInterval(() => {
  106. const upgrades = document.querySelectorAll('#upgrades .enabled');
  107. if (upgrades.length > 0) upgrades[0].click();
  108. }, 100);
  109. console.log('Auto Purchase Upgrades Activated');
  110. },
  111. () => {
  112. clearInterval(state.autoPurchaseUpgradesInterval);
  113. console.log('Auto Purchase Upgrades Deactivated');
  114. }
  115. );
  116. };
  117.  
  118. document.getElementById('toggleAutoCookies').onclick = () => {
  119. toggleFeature(
  120. 'autoGetCookies',
  121. () => {
  122. state.autoGetCookiesInterval = setInterval(() => {
  123. getmorecookie();
  124. }, 100);
  125. console.log('Auto Get Cookies Activated');
  126. },
  127. () => {
  128. clearInterval(state.autoGetCookiesInterval);
  129. console.log('Auto Get Cookies Deactivated');
  130. }
  131. );
  132. };
  133.  
  134. document.getElementById('resetGame').onclick = () => {
  135. Game.Reset(true);
  136. console.log('Game Reset!');
  137. };
  138.  
  139. document.getElementById('closeMenu').onclick = () => {
  140. menu.style.display = 'none';
  141. };
  142.  
  143. // Afficher/Masquer le menu avec la touche Tab
  144. document.addEventListener('keydown', (event) => {
  145. if (event.key === 'Tab') {
  146. event.preventDefault();
  147. menu.style.display = menu.style.display === 'none' ? 'block' : 'none';
  148. }
  149. });
  150.  
  151. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址