Cookie Clicker Mod Menu

Adds a mod menu to Cookie Clicker for cheats and enhancements.

  1. // ==UserScript==
  2. // @name Cookie Clicker Mod Menu
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description Adds a mod menu to Cookie Clicker for cheats and enhancements.
  6. // @author ME : )
  7. // @match http://orteil.dashnet.org/cookieclicker/
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. // Wait for the game to load fully
  15. function waitForGame() {
  16. if (typeof Game !== 'undefined' && Game.ready) {
  17. initModMenu();
  18. } else {
  19. setTimeout(waitForGame, 1000);
  20. }
  21. }
  22.  
  23. // Initialize the mod menu
  24. function initModMenu() {
  25. // Create a new div element for the mod menu
  26. const modMenu = document.createElement('div');
  27. modMenu.style.position = 'fixed';
  28. modMenu.style.top = '10px';
  29. modMenu.style.right = '10px';
  30. modMenu.style.padding = '10px';
  31. modMenu.style.backgroundColor = 'rgba(0, 0, 0, 0.8)';
  32. modMenu.style.color = 'white';
  33. modMenu.style.zIndex = '10000';
  34. modMenu.style.fontFamily = 'Arial, sans-serif';
  35. modMenu.style.borderRadius = '5px';
  36.  
  37. // Add title to the mod menu
  38. const title = document.createElement('h2');
  39. title.innerText = 'Cookie Clicker Mod Menu';
  40. title.style.marginTop = '0';
  41. modMenu.appendChild(title);
  42.  
  43. // Function to create a button
  44. function createButton(text, onClick) {
  45. const button = document.createElement('button');
  46. button.innerText = text;
  47. button.style.margin = '5px';
  48. button.style.padding = '5px 10px';
  49. button.style.border = 'none';
  50. button.style.borderRadius = '3px';
  51. button.style.cursor = 'pointer';
  52. button.style.backgroundColor = '#444';
  53. button.style.color = 'white';
  54. button.addEventListener('click', onClick);
  55. modMenu.appendChild(button);
  56. }
  57.  
  58. // Function to add cookies
  59. function addCookies(amount) {
  60. Game.cookies += amount;
  61. Game.RefreshStore();
  62. }
  63.  
  64. // Function to unlock all upgrades
  65. function unlockAllUpgrades() {
  66. Game.UpgradesById.forEach(upgrade => {
  67. upgrade.unlock();
  68. });
  69. }
  70.  
  71. // Function to unlock all achievements
  72. function unlockAllAchievements() {
  73. Game.AchievementsById.forEach(achievement => {
  74. achievement.unlock();
  75. });
  76. }
  77.  
  78. // Function to set cookie production speed
  79. function setProductionSpeed(speed) {
  80. Game.fps = speed;
  81. }
  82.  
  83. // Function to add Golden Cookies
  84. function addGoldenCookies(amount) {
  85. for (let i = 0; i < amount; i++) {
  86. new Game.shimmer('golden');
  87. }
  88. }
  89.  
  90. // Add buttons to the mod menu
  91. createButton('Add 1 Million Cookies', () => addCookies(1000000));
  92. createButton('Add 1 Billion Cookies', () => addCookies(1000000000));
  93. createButton('Unlock All Upgrades', unlockAllUpgrades);
  94. createButton('Unlock All Achievements', unlockAllAchievements);
  95. createButton('Set Fast Production (60 FPS)', () => setProductionSpeed(60));
  96. createButton('Add 10 Golden Cookies', () => addGoldenCookies(10));
  97.  
  98. // Add the mod menu to the document body
  99. document.body.appendChild(modMenu);
  100. }
  101.  
  102. // Start the waiting process
  103. waitForGame();
  104. })();

QingJ © 2025

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