Cookie Clicker Cheats

Enable/Disable different cheats/hacks for Cookie Clicker

  1. // ==UserScript==
  2. // @name Cookie Clicker Cheats
  3. // @namespace https://gf.qytechs.cn/scripts/7921-cookie-clicker-cheats/code/Cookie%20Clicker%20Cheats.user.js
  4. // @description Enable/Disable different cheats/hacks for Cookie Clicker
  5. // @include http://orteil.dashnet.org/cookieclicker/v10466/
  6. // @include orteil.dashnet.org/cookieclicker/v10466/
  7. // @require https://gf.qytechs.cn/scripts/7922-ccc-css/code/CCC%20CSS.user.js
  8. // @require https://gf.qytechs.cn/scripts/7927-mousetrap/code/Mousetrap.user.js
  9. // @icon http://images2.wikia.nocookie.net/__cb20130827014914/cookieclicker/images/5/5a/PerfectCookie.png
  10. // @grant none
  11. // @run-at document-end
  12. // @version 2.0
  13. // ==/UserScript==
  14.  
  15. // Main wait loop
  16. setTimeout(doSomething, 1000);
  17.  
  18. function doSomething() {
  19. var element = document.getElementById('particle0');
  20. if (typeof (element) != 'undefined' && element != null) {
  21.  
  22. //Game particles have loaded, FIRE AWAY!
  23. (function () {
  24. var options = {
  25. panelId: 'cookie-cheater',
  26. intervalDelay: 1,
  27. longDelay: 250,
  28. buttons: {
  29. 'bigCookie': {
  30. label: 'Autoclick Big Cookie',
  31. action: function () {
  32. toggleAutoAction('bigCookie', function () {
  33. Game.ClickCookie();
  34. })
  35. }
  36. },
  37. 'spawnGoldenCookie': {
  38. label: 'Spawn a Golden Cookie',
  39. action: function () {
  40. Game.goldenCookie.life = 0;
  41. Game.goldenCookie.time = Game.goldenCookie.minTime;
  42. Game.goldenCookie.spawn();
  43. }
  44. },
  45. 'autoGoldenCookie': {
  46. label: 'Autospawnclick GCs',
  47. action: function () {
  48. toggleAutoAction('autoGoldenCookie', function () {
  49. if (Game.frenzy <= 0) {
  50. Game.goldenCookie.time = Game.goldenCookie.minTime;
  51. Game.goldenCookie.spawn();
  52. }
  53. if (Game.goldenCookie.last == "clot" || Game.goldenCookie.last == "ruin cookies") {
  54. if (Game.elderWrath > 0) {
  55. Game.goldenCookie.last = "blood frenzy"
  56. } else {
  57. Game.goldenCookie.last = "frenzy"
  58. }
  59. Game.frenzy = 1
  60. }
  61. if (Game.frenzy > 0) {
  62. Game.goldenCookie.toDie = 1
  63. }
  64. if (Game.goldenCookie.life >= 0 && (Game.frenzy <= 0 || Game.frenzyPower < 2 || Game.goldenCookie.chain > 0)) {
  65. Game.goldenCookie.click();
  66. }
  67. })
  68. }
  69. },
  70. 'autoBuyUpgrades': {
  71. label: 'Autobuy Upgrades',
  72. action: function () {
  73. toggleAutoAction('autoBuyUpgrades', function () {
  74. buyUpgrades();
  75. })
  76. }
  77. },
  78. 'optimalBuying': {
  79. label: 'Optimal Buying',
  80. action: function () {
  81. toggleAutoAction('optimalBuying', function () {
  82. setTimeout(function() { var buy = CookieCheat.miscVars.objectsOrder[0].id; if (Game.UpgradesById[buy] != "undefined") {Game.UpgradesById[buy].buy(); }if (Game.ObjectsById[buy] != "undefined") {Game.ObjectsById[buy].buy(); } if (CookieCheat.currentTab === "tools") {
  83. CookieCheat.changeTab("tools");
  84. } }, 500);
  85. })
  86. }
  87. },
  88. 'fuckThemWrinklers': {
  89. label: 'Slaughter Wrinklers',
  90. action: function () {
  91. toggleAutoAction('fuckThemWrinklers', function () {
  92. setTimeout(function() { for (var i in Game.wrinklers) { var me=Game.wrinklers[i]; if (me.phase==2) { me.hurt=1; me.hp--; var x=me.x+(Math.sin(me.r*Math.PI/180)*100); var y=me.y+(Math.cos(me.r*Math.PI/180)*100); for (var ii=0;ii<4;ii++) { Game.particleAdd(x+Math.random()*50-25,y+Math.random()*50-25,Math.random()*4-2,Math.random()*-2-2,1,1,2,'wrinklerBits.png'); } } } }, 200);
  93. })
  94. }
  95. },
  96. 'catchThemWonderdeer': {
  97. label: 'Capture the Deer',
  98. action: function () {
  99. toggleAutoAction('catchThemWonderdeer', function () {
  100. setTimeout(function(){if (Game.seasonPopup.life > 0) {Game.seasonPopup.click()}},Math.floor(((Math.random()*7)+3)*2500));
  101. })
  102. }
  103. },
  104. }
  105. };
  106.  
  107. addStyleSheet();
  108. addPanel();
  109. for (var name in options.buttons) {
  110. if (!options.buttons[name]) {
  111. return;
  112. }
  113. addButton(name, options.buttons[name].label, options.buttons[name].action);
  114. }
  115.  
  116. function buyUpgrades() {
  117. for (var i = 0; i < Game.UpgradesById.length; i++) {
  118. if ((i > 63 && i < 75) || i === 79 || (i > 82 && i < 86) || i === 91 || i === 124 || (i > 140 && i < 143) || i === 167 || (i > 181 && i < 186)) {
  119. continue;
  120. } else {
  121. if (Game.UpgradesById[i].unlocked === 1) {
  122. if(Game.cookies >= Game.UpgradesById[i].basePrice) {
  123. Game.UpgradesById[i].buy();
  124. }
  125. }
  126. }
  127. }
  128. }
  129.  
  130. //Lets bind some keys!!!
  131. //Buys one of specified building
  132. Mousetrap.bind('shift+1', function() { Game.ObjectsById[Game.ObjectsById.length - 11].buy(); }); //Cursor
  133. Mousetrap.bind('shift+2', function() { Game.ObjectsById[Game.ObjectsById.length - 10].buy(); }); //Grandma
  134. Mousetrap.bind('shift+3', function() { Game.ObjectsById[Game.ObjectsById.length - 9].buy(); }); //Farm
  135. Mousetrap.bind('shift+4', function() { Game.ObjectsById[Game.ObjectsById.length - 8].buy(); }); //Factory
  136. Mousetrap.bind('shift+5', function() { Game.ObjectsById[Game.ObjectsById.length - 7].buy(); }); //Mine
  137. Mousetrap.bind('shift+6', function() { Game.ObjectsById[Game.ObjectsById.length - 6].buy(); }); //Shipment
  138. Mousetrap.bind('shift+7', function() { Game.ObjectsById[Game.ObjectsById.length - 5].buy(); }); //Alchemy Lab
  139. Mousetrap.bind('shift+8', function() { Game.ObjectsById[Game.ObjectsById.length - 4].buy(); }); //Portal
  140. Mousetrap.bind('shift+9', function() { Game.ObjectsById[Game.ObjectsById.length - 3].buy(); }); //Time Machine
  141. Mousetrap.bind('shift+0', function() { Game.ObjectsById[Game.ObjectsById.length - 2].buy(); }); //Antimatter Condenser
  142. Mousetrap.bind('shift+-', function() { Game.ObjectsById[Game.ObjectsById.length - 1].buy(); }); //Prism
  143.  
  144. //Sells one of specified building
  145. Mousetrap.bind('option+1', function() { Game.ObjectsById[Game.ObjectsById.length - 11].sell(); }); //Cursor
  146. Mousetrap.bind('option+2', function() { Game.ObjectsById[Game.ObjectsById.length - 10].sell(); }); //Grandma
  147. Mousetrap.bind('option+3', function() { Game.ObjectsById[Game.ObjectsById.length - 9].sell(); }); //Farm
  148. Mousetrap.bind('option+4', function() { Game.ObjectsById[Game.ObjectsById.length - 8].sell(); }); //Factory
  149. Mousetrap.bind('option+5', function() { Game.ObjectsById[Game.ObjectsById.length - 7].sell(); }); //Mine
  150. Mousetrap.bind('option+6', function() { Game.ObjectsById[Game.ObjectsById.length - 6].sell(); }); //Shipment
  151. Mousetrap.bind('option+7', function() { Game.ObjectsById[Game.ObjectsById.length - 5].sell(); }); //Alchemy Lab
  152. Mousetrap.bind('option+8', function() { Game.ObjectsById[Game.ObjectsById.length - 4].sell(); }); //Portal
  153. Mousetrap.bind('option+9', function() { Game.ObjectsById[Game.ObjectsById.length - 3].sell(); }); //Time Machine
  154. Mousetrap.bind('option+0', function() { Game.ObjectsById[Game.ObjectsById.length - 2].sell(); }); //Antimatter Condenser
  155. Mousetrap.bind('option+-', function() { Game.ObjectsById[Game.ObjectsById.length - 1].sell(); }); //Prism
  156.  
  157. // Awesome textParticle mod, mostly for execution of "Cookie Clicker Cheats v.X.X launched!" message.
  158. Game.textParticlesAdd = function (text, el) {
  159. //pick the first free (or the oldest) particle to replace it
  160. var highest = 0;
  161. var highestI = 0;
  162. for (var i in Game.textParticles) {
  163. if (Game.textParticles[i].life == -1) {
  164. highestI = i;
  165. break;
  166. }
  167. if (Game.textParticles[i].life > highest) {
  168. highest = Game.textParticles[i].life;
  169. highestI = i;
  170. }
  171. }
  172. var i = highestI;
  173. var x = (Math.random() - 0.5) * 40;
  174. var y = 0; //+(Math.random()-0.5)*40;
  175. if (!el) {
  176. var rect = l('game').getBoundingClientRect();
  177. var x = Math.floor((rect.left + rect.right) / 2);
  178. var y = Math.floor(((rect.bottom)) - 60);
  179. x += (Math.random() - 0.5) * 40;
  180. y += 0; //(Math.random()-0.5)*40;
  181. }
  182. var me = Game.textParticles[i];
  183. if (!me.l) me.l = l('particle' + i);
  184. me.life = 0;
  185. me.x = x;
  186. me.y = y - Game.textParticlesY;
  187. if (me.y < 60) {
  188. for (var j = 0; j <= (rect.bottom); j++) {
  189. me.y += (me.y - 60);
  190. }
  191. }
  192. me.text = text;
  193. me.l.innerHTML = text;
  194. me.l.style.left = Math.floor(Game.textParticles[i].x - 200) + 'px';
  195. me.l.style.bottom = Math.floor(-Game.textParticles[i].y) + 'px';
  196. me.l.style.display = 'block';
  197. Game.textParticlesY += 60;
  198. }
  199.  
  200. function autoAction(name, action) {
  201. if (!options.buttons[name]) {
  202. return;
  203. }
  204. if (name == 'bigCookie') {
  205. options.buttons[name].interval = setInterval(action, options.intervalDelay);
  206. } else {
  207. options.buttons[name].interval = setInterval(action, options.longDelay);
  208. }
  209. }
  210.  
  211. function stopAutoAction(name) {
  212. clearInterval(options.buttons[name].interval);
  213. }
  214.  
  215. function toggleAutoAction(name, action) {
  216. if (!options.buttons[name].on) {
  217. autoAction(name, action);
  218. options.buttons[name].on = true;
  219. options.buttons[name].element.className = 'active';
  220. } else {
  221. stopAutoAction(name);
  222. options.buttons[name].on = false;
  223. options.buttons[name].element.className = '';
  224. }
  225. }
  226.  
  227. function addPanel() {
  228. if (document.getElementById(options.panelId)) {
  229. document.getElementById(options.panelId).remove();
  230. }
  231. options.panel = document.createElement("div");
  232. options.panel.id = options.panelId;
  233. document.body.appendChild(options.panel);
  234. }
  235.  
  236. function addButton(name, label, action) {
  237. if (!options.buttons[name]) {
  238. return;
  239. }
  240. options.buttons[name].element = document.createElement('button');
  241. options.buttons[name].element[(typeof document.body.style.WebkitAppearance == "string") ? "innerText" : "innerHTML"] = label;
  242. options.buttons[name].element.addEventListener('click', action);
  243. options.panel.appendChild(options.buttons[name].element);
  244. }
  245.  
  246. function addStyleSheet() {
  247. var stylesClassName = options.panelId + '-styles';
  248. var styles = document.getElementsByClassName(stylesClassName);
  249. if (styles.length <= 0) {
  250. styles = document.createElement('style');
  251. styles.type = 'text/css';
  252. styles.className += ' ' + stylesClassName;
  253. document.body.appendChild(styles);
  254. }
  255.  
  256. var css = '#' + options.panelId + '{position:fixed;top:25px;right:0;padding:5px;z-index:9999;}#' + options.panelId + ' button{margin-left: 5px; font-family:\"Kavoon\"; color:#2ba39f;}#' + options.panelId + ' button.active:after{content:"*";color:#1E7471;}';
  257. styles[(typeof document.body.style.WebkitAppearance == "string") ? "innerText" : "innerHTML"] = css;
  258. }
  259.  
  260. var link = document.createElement('a');
  261. link.setAttribute('href', 'http://orteil.dashnet.org/experiments/cookie/');
  262. link.target = 'blank';
  263. link.appendChild(
  264. document.createTextNode('Cookie Clicker Classic'));
  265. var add = document.getElementsByTagName('div')[2];
  266. add.insertBefore(document.createTextNode('| '), add.lastChild);
  267. add.insertBefore(link, add.lastChild);
  268.  
  269. if (window.location == "http://orteil.dashnet.org/cookieclicker/") {
  270. var linkb = document.createElement('a');
  271. linkb.setAttribute('href', 'beta');
  272. linkb.target = 'blank';
  273. linkb.appendChild(
  274. document.createTextNode('Try the beta!'));
  275. var addb = document.getElementsByTagName('div')[2];
  276. addb.insertBefore(document.createTextNode(' | '), add.lastChild);
  277. addb.insertBefore(linkb, add.lastChild);
  278. }
  279. var del = document.getElementById('links');
  280. del.parentNode.removeChild(del);
  281. return;
  282. })();
  283.  
  284. var seasonalText;
  285. var d = new Date();
  286.  
  287. if ((d.getMonth() == 1-1) && (d.getDate() == 1)) {
  288. seasonalText = "Happy New Year!"
  289. } else if ((d.getMonth() == 2-1) && (d.getDate() == 14)) {
  290. seasonalText = "Happy Valentine's Day!"
  291. } else if ((d.getMonth() == 3-1) && (d.getDate() == 17)) {
  292. seasonalText = "Happy St. Patrick's Day!"
  293. } else if ((d.getMonth() == 4-1) && (d.getDate() == 20)) {
  294. seasonalText = "Happy Easter Sunday!"
  295. } else if ((d.getMonth() == 7-1) && (d.getDate() == 4)) {
  296. seasonalText = "Happy 4th of July!"
  297. } else if ((d.getMonth() == 10-1) && (d.getDate() == 31)) {
  298. seasonalText = "Happy Halloween!"
  299. } else if ((d.getMonth() == 11-1) && (d.getDate() == 27)) {
  300. seasonalText = "Happy Thanksgiving!"
  301. } else if ((d.getMonth() == 12-1) && (d.getDate() == 25)) {
  302. seasonalText = "Merry Christmas!"
  303. }
  304.  
  305. if (typeof (seasonalText) != 'undefined' && seasonalText != null) {
  306. var seasonText = seasonalText;
  307. var br1 = document.createElement('br');
  308. var br2 = document.createElement('br');
  309. var append = document.createElement('div');
  310. append.setAttribute('id', 'seasonalText');
  311. append.setAttribute('class', 'commentsText');
  312. append.setAttribute('style', 'font-size:28px');
  313. append.appendChild(
  314. document.createTextNode(seasonText));
  315. var add = document.getElementById('comments');
  316. add.insertBefore(br1, add.lastChild);
  317. add.insertBefore(br2, add.lastChild);
  318. add.insertBefore(append, add.lastChild);
  319. Game.Popup(seasonalText);
  320. }
  321.  
  322. setInterval(function() {Game.WriteSave()},20000);
  323.  
  324. var script = document.createElement('script');
  325. script.setAttribute('src', 'https://gf.qytechs.cn/scripts/7952-ccc-libraries/code/CCC%20Libraries.js?version=35672');
  326. document.body.appendChild(script);
  327.  
  328. } else {
  329. setTimeout(doSomething, 1000);
  330. }
  331. }

QingJ © 2025

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