Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Cookie Clicker semi-Automate click
- // @namespace http://tampermonkey.net/
- // @version 2025-06-25
- // @description Click cookie
- // @author You
- // @match https://orteil.dashnet.org/cookieclicker/
- // @icon https://www.google.com/s2/favicons?sz=64&domain=dashnet.org
- // @grant none
- // ==/UserScript==
- (function() {
- 'use strict';
- let autoClickInterval = null;
- function startAutoClick() {
- if (typeof Game === 'undefined' || !Game.ready) {
- setTimeout(startAutoClick, 100);
- return;
- }
- if (autoClickInterval === null) {
- autoClickInterval = setInterval(() => {
- Game?.ClickCookie();
- }, 10);
- }
- }
- function stopAutoClick() {
- if (autoClickInterval !== null) {
- clearInterval(autoClickInterval);
- autoClickInterval = null;
- }
- }
- const bigCookie = document.getElementById("bigCookie");
- if (bigCookie) {
- bigCookie.addEventListener('touchstart', () => {
- startAutoClick();
- });
- bigCookie.addEventListener('touchend', () => {
- stopAutoClick();
- });
- }
- if (bigCookie) {
- bigCookie.addEventListener('mousedown', () => {
- startAutoClick();
- });
- bigCookie.addEventListener('mouseup', () => {
- stopAutoClick();
- });
- bigCookie.addEventListener('mouseleave', () => {
- stopAutoClick();
- });
- }
- })();
Advertisement
Add Comment
Please, Sign In to add comment