Cookie Clicker Auto Everything

Automates everything in Cookie Clicker at maximum speed

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Cookie Clicker Auto Everything
// @namespace    http://tampermonkey.net/
// @version      1.2
// @description  Automates everything in Cookie Clicker at maximum speed
// @author       ggteras
// @match        *://orteil.dashnet.org/cookieclicker/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    function clickCookie() {
        document.getElementById("bigCookie").click();
        requestAnimationFrame(clickCookie); // Uses the fastest possible browser refresh rate
    }

    function buyUpgrades() {
        if (Game.cookies >= 120000) {
            let upgrades = document.getElementsByClassName("upgrade enabled");
            for (let upgrade of upgrades) {
                upgrade.click();
            }
        }
    }

    function buyBuildings() {
        if (Game.cookies >= 120000) {
            let buildings = document.getElementsByClassName("product unlocked enabled");
            for (let building of buildings) {
                building.click();
            }
        }
    }

    function clickGoldenCookies() {
        let goldenCookies = document.getElementsByClassName("shimmer");
        for (let cookie of goldenCookies) {
            cookie.click();
        }
    }

    requestAnimationFrame(clickCookie); // Starts the high-speed clicking loop
    setInterval(buyUpgrades, 1000);
    setInterval(buyBuildings, 500);
    setInterval(clickGoldenCookies, 100);
})();