Guest User

Untitled

a guest
Aug 28th, 2025
17
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Cookie Clicker semi-Automate click
  3.  
  4. // @namespace http://tampermonkey.net/
  5. // @version 2025-06-25
  6. // @description Click cookie
  7. // @author You
  8. // @match https://orteil.dashnet.org/cookieclicker/
  9. // @icon https://www.google.com/s2/favicons?sz=64&domain=dashnet.org
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. let autoClickInterval = null;
  17.  
  18. function startAutoClick() {
  19. if (typeof Game === 'undefined' || !Game.ready) {
  20. setTimeout(startAutoClick, 100);
  21. return;
  22. }
  23. if (autoClickInterval === null) {
  24. autoClickInterval = setInterval(() => {
  25. Game?.ClickCookie();
  26. }, 10);
  27. }
  28. }
  29.  
  30. function stopAutoClick() {
  31. if (autoClickInterval !== null) {
  32. clearInterval(autoClickInterval);
  33. autoClickInterval = null;
  34. }
  35. }
  36.  
  37. const bigCookie = document.getElementById("bigCookie");
  38. if (bigCookie) {
  39. bigCookie.addEventListener('touchstart', () => {
  40. startAutoClick();
  41. });
  42.  
  43. bigCookie.addEventListener('touchend', () => {
  44. stopAutoClick();
  45. });
  46. }
  47.  
  48. if (bigCookie) {
  49. bigCookie.addEventListener('mousedown', () => {
  50. startAutoClick();
  51. });
  52. bigCookie.addEventListener('mouseup', () => {
  53. stopAutoClick();
  54. });
  55. bigCookie.addEventListener('mouseleave', () => {
  56. stopAutoClick();
  57. });
  58. }
  59. })();
Advertisement
Add Comment
Please, Sign In to add comment