Cookie Clicker hack

Just a cookie clicker hack.

目前為 2019-11-15 提交的版本,檢視 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Cookie Clicker hack
// @namespace    https://greasyfork.org/ru/scripts/392425-cookie-clicker-hack
// @version      1.0.2
// @description  Just a cookie clicker hack.
// @author       hasha2982
// @match        *://orteil.dashnet.org/cookieclicker/*
// @match        *://orteil.dashnet.org/cookieclicker/
// @grant        none
// ==/UserScript==

// NOTE: Don't works in IE!

console.log('[== Starting hack... ==]');

var ans = '';
var confirmans = false;
var forCookies = [0, 0]; // First one is how many iterations is need to do, and second is counter (unused)



document.onkeydown = function(e){
    e = e || window.event;
    var key = e.which || e.keyCode;
    if(key===72){
        hackMenu();
    }
}; // thx StackOverflow

function hackMenu() {
    // if (event.code = 'KeyH') {
        ans = prompt('Welcome to hasha2982\'s Cookie Clicker hack v.1.0.1!\nPlease select an option below:\n1) Earn free cookies\n2) Spawn 1 golden cookie');
        if (ans == '1') {
            ans = prompt('How many cookies do you want to earn?');
            if (ans === "" || ans === null) {
                alert('Cancelled.');
            } else {
                Game.cookies += Number(ans);
                Game.cookiesEarned += Number(ans);
            }
        } else if (ans == '2') {
            /* In progress
            ans = prompt('How many golden cookies do you want to spawn?');
            if (ans === "" || ans === null) {
                alert('Cancelled.');
            } else if (Number(ans) > 25) {
                confirmans = confirm('That\'s a little bit too much\nAlso, it can lag very much!\nAre you sure that you want to spawn ' + ans + ' cookies?');
                if (confirm === true) {
                    forCookies[0] = Number(ans);
                    for (; forCookies[0] > forCookies[1]; forCookies[1]++) { */
                        var newShimmer=new Game.shimmer("golden");
                        console.log('Golden cookie spawned.');
                   /* }
                } else {
                    alert('Cancelled.');
                }
            } */
        }
        else {
            alert('Function not found.');
        }
   // }
}

console.log('[== Hack is started. ==]\nVersion: v.1.0.1');