Greasy Fork

Greasy Fork is available in English.

喵国建设者作弊器 Kittens Game Cheat

可以添加任意数量的资源,注意,这将极大地破坏您的游戏体验。You can add as many resources as you like in the game, and this will greatly ruin your gaming experience.

当前为 2019-11-14 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         喵国建设者作弊器 Kittens Game Cheat
// @version      0.1
// @description  可以添加任意数量的资源,注意,这将极大地破坏您的游戏体验。You can add as many resources as you like in the game, and this will greatly ruin your gaming experience.
// @author       Kong Weihang
// @match        *likexia.gitee.io/*
// @grant        none
// @name         zh-CN,en
// @run-at       document-start
// @license      GNU General Public License v3.0 or later
// @namespace    http://tampermonkey.net/
// ==/UserScript==

(function () {
    'use strict';
    var isShowed = false;

    function InsertInputElement(inputArea, elementName) {
        var row = document.createElement("div");
        var input = document.createElement("input");
        var span = document.createElement("span");
        input.type = "text";
        input.className = "input";
        input.id = elementName;
        input.placeholder = elementName;
        input.style.marginRight = "1.0em";
        span.textContent = elementName;
        row.style.padding = "0px 10px";
        row.appendChild(span);
        row.appendChild(input);
        inputArea.appendChild(row);
    }

    function ElementCheat(elementName, value) {
        var numValue = parseInt(value);
        gamePage.resPool.get(elementName).value += numValue;
    }

    function CheatEvent() {
        if (isShowed) { return; }
        var cheatList = [
            "catnip",
            "wood",
            "minerals",
            "iron",
            "gold",
            "catpower",
            "science",
            "culture",
            "kittens",
            "furs",
            "ivory",
            "spice",
            "unicorns",
            "blueprint"];
        var inputArea = document.createElement("div");

        var observeButton = document.getElementById("observeButton");

        if (typeof observeButton !== 'undefined' &&
            observeButton !== null) {

            for (let i = 0; i < cheatList.length; i++) {
                const chaetElement = cheatList[i];
                InsertInputElement(inputArea, chaetElement);
            }

            var cheatButton = document.createElement("button");
            cheatButton.textContent = "Start Cheat";
            cheatButton.addEventListener('click', function () {
                for (let i = 0; i < cheatList.length; i++) {
                    const elementName = cheatList[i];
                    var value = document.getElementById(elementName).value;
                    if (!isNaN(value)) {
                        ElementCheat(elementName, value);
                    }
                }
            }, false);

            var cheatMaxButton = document.createElement("button");
            cheatMaxButton.textContent = "To Max";
            cheatMaxButton.addEventListener('click', function () {
                for (let i = 0; i < cheatList.length; i++) {
                    const elementName = cheatList[i];
                    gamePage.resPool.get(elementName).value = gamePage.resPool.get(elementName).maxValue;

                }
            }, false);

            var parent = observeButton.parentNode;
            parent.insertBefore(inputArea, observeButton);
            parent.insertBefore(cheatButton, observeButton);
            parent.insertBefore(cheatMaxButton, observeButton);

            isShowed = true;
        }
    }

    var IntervalID = setInterval(CheatEvent, 10000);

    setTimeout(function () {
        clearInterval(IntervalID)
    }, 300000);


})();