Forked from WillMoggridge/my-kittens-game-tweaks.user.js
Last active
December 10, 2018 21:43
-
-
Save paris-ci/665724d5af2c81a9e19ab6aa9ea3253c to your computer and use it in GitHub Desktop.
Kittens game tweaks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name My Kittens Game tweaks | |
// @namespace https://gist.github.com/WillMoggridge/133c22444caaa4cc3f2a5536e9621a37 | |
// @description Kittens! | |
// @include *bloodrizer.ru/games/kittens/* | |
// @version 1.0.0 | |
// @grant none | |
// ==/UserScript== | |
var autoObserve = function(game) { | |
var observe = setInterval(function() { | |
document.getElementById("observeBtn").dispatchEvent(new MouseEvent('click')); | |
}, 1000); // 1 second | |
}; | |
var autoPraiseFaith = function(game) { | |
console.log("Autopraising faith"); | |
praiseFaith = setInterval(function() { | |
var faith = game.resPool.get('faith'); | |
if (faith.value > faith.maxValue * 0.95) { | |
game.religion.praise(); | |
} | |
}, 10000); // 10 seconds | |
}; | |
var speedUpGame = function(game) { | |
// Speed game up. Lower is faster. | |
// 200 = double. 30 ~ 8x | |
var newSpeed = 30; | |
console.log("Speeding game up..."); | |
autoTick = setInterval(function(){ | |
game.tick(); | |
}, newSpeed); | |
game.rate = 5+(1000/newSpeed); | |
}; | |
var loadScript = function() { | |
var game = window.gamePage; | |
if (typeof gamePage === 'undefined') { | |
setTimeout(function(){ | |
loadScript(); | |
}, 2000); | |
} else { | |
autoObserve(game); | |
//autoPraiseFaith(game); | |
speedUpGame(game); | |
} | |
}; | |
loadScript(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment