CookieClicker

CookieClicker Extension

目前為 2016-03-15 提交的版本,檢視 最新版本

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

You will need to install an extension such as Tampermonkey to install this script.

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name           CookieClicker
// @namespace      CookieClickerExtension
// @include        http://orteil.dashnet.org/cookieclicker/
// @author         Dummbroesel
// @description    CookieClicker Extension
// @version		   1.1.0
// ==/UserScript==

document._g = false;
document._c = false;
document._o = false;
document._u = false;
document._s = false;

document._goldenCookieSpawnAndClickCHEAT;
document._clickBigCookieCHEAT;

document._products;
document._upgrades;

document._purchaseObjectCheat;
document._purchaseUpgradesCHEAT;
document._goldenCookieListenerCHEAT

document._autoPurchaseObject;
document._autoPurchaseUpgrade;

document._gcc;

document.onkeypress = function(event) {
  	console.log(event.keyCode);
    if (event.keyCode == 32) {
        document._products = document.getElementById('products').children;
        document._upgrades = document.getElementById('upgrades').children;
        document._autoPurchaseObject = function autoPurchaseObject() {
            for (i = document._products.length-1; i >= 0; i--) 
            {
                if(document._products[i].classList.contains('enabled')) { 
                    document._products[i].click();
                    return false;
                }
            }
        };
        document._autoPurchaseUpgrade = function autoPurchaseUpgrade() { 
            if(Game.UpgradesInStore.length < 1) return false;
            if(Game.UpgradesInStore.length == 1)
            {
                var _firstChild = document._upgrades[0];
                if(_firstChild.classList.contains('enabled'))
                {
                    if (Game.UpgradesInStore[0].name == "Elder Covenant" 
                        || Game.UpgradesInStore[0].name.indexOf("Ghostly biscuit") >=0 
                        || Game.UpgradesInStore[0].name.indexOf("Fool's biscuit") >=0
                        || Game.UpgradesInStore[0].name.indexOf("Lovesick biscuit") >=0
                        || Game.UpgradesInStore[0].name.indexOf("Festive biscuit") >=0
                        || Game.UpgradesInStore[0].name.indexOf("Milk selector") >=0
                        || Game.UpgradesInStore[0].name.indexOf("Golden switch [off]") >=0
                        || Game.UpgradesInStore[0].name.indexOf("Bunny biscuit") >=0) 
                    { 
                        return false;
                    }
                    _firstChild.click();
                }
            }
            if(Game.UpgradesInStore.length > 1)
            {
                for (i=0;i<document._upgrades.length;i++){
                    if(document._upgrades[i].classList.contains('enabled')) {
                        if (Game.UpgradesInStore[i].name == "Elder Covenant"
                        || Game.UpgradesInStore[i].name.indexOf("Ghostly biscuit") >=0 
                        || Game.UpgradesInStore[i].name.indexOf("Fool's biscuit") >=0
                        || Game.UpgradesInStore[i].name.indexOf("Lovesick biscuit") >=0
                        || Game.UpgradesInStore[i].name.indexOf("Festive biscuit") >=0
                        || Game.UpgradesInStore[i].name.indexOf("Milk selector") >=0
                        || Game.UpgradesInStore[i].name.indexOf("Golden switch [off]") >=0
                        || Game.UpgradesInStore[i].name.indexOf("Bunny biscuit") >=0) 
                        { 
                            
                        }
                        else {
                            document._upgrades[i].click();
                        }
                    }
                    else {
                        break;
                    }
                }
                
                //var _firstChild = document._upgrades[0];
                //var _secondChild = document._upgrades[1];
                //if(_firstChild.classList.contains('enabled'))
                //{
                //    if (Game.UpgradesInStore[0].name == "Elder Covenant" && Game.UpgradesInStore[0].basePrice == 66666666666666) 
                //    { 
                //        if(_secondChild.classList.contains('enabled'))
                //        {
                //            _secondChild.click();
                //        }
                //    } else {
                //        _firstChild.click();
                //    }
                //}
            }
        };
        document._gcc = function () {
          if (Game.goldenCookie.life > 0) Game.goldenCookie.click();
        };
        
        console.log('Initilized');
    } else if (event.keyCode == 103) {
    //g goldencookie spawn&clicker
        if(document._g) { 
            clearInterval(document._goldenCookieSpawnAndClickCHEAT);
            document._g = false;
            console.log('GoldenCookieSpawn&Clicker Deactivated');
        }
        else {
            document._goldenCookieSpawnAndClickCHEAT = setInterval("Game.goldenCookie.spawn(); Game.goldenCookie.click();", 5); 
            document._g = true;
            console.log('GoldenCookieSpawn&Clicker Activated');
        }
    } else if (event.keyCode == 99) {
    //c bigcookie clicker
        if (document._c) { clearInterval(document._clickBigCookieCHEAT); document._c = false; console.log('BigCookieClicker Deactivated'); }
        else {
            document._clickBigCookieCHEAT = setInterval("Game.ClickCookie();", 5); 
            document._c = true;
            console.log('BigCookieClicker Activated');
        }
    } else if (event.keyCode == 111) {
    //o Buildings purchaser
  		if(document._o) { 
            clearInterval(document._purchaseObjectCheat);
            document._o = false; 
            console.log('AutoObjectPurchaser Deactivated');
        }
        else{
            document._purchaseObjectCheat = setInterval('document._autoPurchaseObject()', 10);
            document._o = true;
            console.log('AutoObjectPurchaser Activated');
        }
    } else if (event.keyCode == 117) {
    //u Upgrade purchaser
        if (document._u) { 
            clearInterval(document._purchaseUpgradesCHEAT); 
            document._u = false; 
            console.log('AutoUpgradePurchaser Deactivated');
        }
        else {
            document._purchaseUpgradesCHEAT = setInterval("document._autoPurchaseUpgrade()", 10);
            document._u = true;
            console.log('AutoUpgradePurchaser Activated');
        }
    } else if(event.keyCode == 114) {
    //r Reset Game keep Achievments
      	Game.Reset(true);
    	console.log('Game successfully reset!');
	} else if (event.keyCode == 115) {
    //s GoldenCookieClicker
        if (document._s) { 
            clearInterval(document._goldenCookieListenerCHEAT); 
            document._s = false; 
            console.log('GoldenCookieClicker Deactivated');
        }
        else {
            document._goldenCookieListenerCHEAT = setInterval("document._gcc()", 1000);
            document._s = true;
            console.log('GoldenCookieClicker Activated');
        }
    } else if(event.keyCode == 113) {
    	Game.goldenCookie.spawn();
    }
}