Greasy Fork is available in English.
Trimps tools (visual)
当前为
// ==UserScript==
// @name Kittens tools
// @namespace http://bloodrizer.ru/games/kittens/
// @version 1.010
// @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 isUnlocked = function(res) {
var resource = game.resPool.get(res);
return resource.unlocked;
}
var _craftAll = function(res) {
if (isUnlocked(res)) {
_log("Crafting " + res);
game.craftAll(res);
}
}
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');
game.village.huntAll();
_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 && isUnlocked('steel')) {
_log('Iron to Steel');
game.craftAll('steel');
} else if (isUnlocked('plate')) {
_log('Iron to Plate');
game.craft('plate', 1);
}
}
}
var _woodToBeams = function() {
var wood = game.resPool.get("wood");
if (wood.value >= wood.maxValue && isUnlocked('beam')) {
_log('Wood to Beam');
game.craft('beam', 1);
}
}
var _mineralsToSlabs = function() {
var minerals = game.resPool.get("minerals");
if (minerals.value >= minerals.maxValue && isUnlocked('slab')) {
_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);
})();