Greasy Fork

Greasy Fork is available in English.

Kittens tools

Trimps tools (visual)

当前为 2017-04-27 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Kittens tools
// @namespace    http://bloodrizer.ru/games/kittens/
// @version      1.009
// @description  Trimps tools (visual)
// @author       Anton
// @match        http://bloodrizer.ru/games/kittens/
// ==/UserScript==

(function() {
	'use strict';

	var $ = jQuery, isStarted = false,
	    version = typeof GM_info == 'function' ? GM_info().script.version :
		    (typeof GM_info == 'object' ? GM_info.script.version : '?');

    var _log = function(message) {
        var mes = 'BOT: ' + message;
        game.msg(mes, 'msg');
        game.ui.renderConsoleLog();
    }

    var _getAstronomy = function() {
        if (game.calendar.observeRemainingTime > 0) {
            if (typeof game.calendar.observeHandler === 'function') {
                _log('Collecting astronomy');
                game.calendar.observeHandler();
            }
        }
    }

    var _flushCatnip = function() {
        var catnip = game.resPool.get("catnip");
        if (catnip.value >= catnip.maxValue) {
            _log('Catnip to Wood');
            game.craftAll('wood');
        }
    }

    var _collectFaith = function() {
        var faith = game.resPool.get("faith");
        if (faith.value >= faith.maxValue) {
            _log('Praise');
            game.religion.praise();
        }
    }

    var _sendHunters = function() {
        var manpower = game.resPool.get("manpower");
        if (manpower.value >= manpower.maxValue) {
            _log('Sending hunters. Fur to parchment');
            game.village.huntAll();
            game.craftAll('parchment');
        }
    }

    var _ironToSteel = function() {
        var iron = game.resPool.get("iron");
        var coal = game.resPool.get("coal");
        if (iron.value >= iron.maxValue) {
            if (coal.value >= 100) {
                _log('Iron to Steel');
                game.craftAll('steel');
            } else {
                _log('Iron to Plate');
                game.craft('plate', 1);
            }
        }
    }

    var _woodToBeams = function() {
        var wood = game.resPool.get("wood");
        if (wood.value >= wood.maxValue) {
            _log('Wood to Beam');
            game.craft('beam', 1);
        }
    }

    var _mineralsToSlabs = function() {
        var minerals = game.resPool.get("minerals");
        if (minerals.value >= minerals.maxValue) {
            _log('Minerals to Slab');
            game.craft('slab', 1);
        }
    }

    var _auto = function() {
        _getAstronomy();
        _flushCatnip();
        _collectFaith();
        _ironToSteel();
        _sendHunters();
        _woodToBeams();
        _mineralsToSlabs();
    }

    var tAuto;

    setTimeout(function() {
        tAuto = setInterval(_auto, 1000);
        
        _log('Started version ' + version);
    }, 1000);
})();