Last active
August 29, 2015 14:24
-
-
Save longlho/b8efc22bcb79ebbcdc1d to your computer and use it in GitHub Desktop.
Kittens scripts
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
(function () { | |
var res = window.gamePage.resPool.resources; | |
function findRes (type) { | |
return res.filter(function (r) { | |
return r.name === type; | |
})[0]; | |
} | |
function setRes (type, amt) { | |
var obj = findRes(type); | |
obj.value = amt || obj.maxValue; | |
} | |
function maxAll (isVisible) { | |
isVisible || (isVisible = true); | |
res.forEach(function (r) { | |
if (r.visible === isVisible) { | |
r.value = r.maxValue; | |
} | |
}); | |
} | |
window.__maxAll = maxAll; | |
window.__findRes = findRes; | |
window.__res = res; | |
window.setRes = setRes; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment