Skip to content

Instantly share code, notes, and snippets.

@edunham
Created June 21, 2015 17:26
Show Gist options
  • Save edunham/4cad73b3478d3e1264f3 to your computer and use it in GitHub Desktop.
Save edunham/4cad73b3478d3e1264f3 to your computer and use it in GitHub Desktop.
autoHunt = setInterval(function() {
var catpower = gamePage.resPool.get('manpower');
if (catpower.value / catpower.maxValue > 0.95) {
$("a:contains('Send hunters')").click();
if (gamePage.workshop.getCraft('parchment').unlocked) { gamePage.craftAll('parchment'); }
if (gamePage.workshop.getCraft('manuscript').unlocked) { gamePage.craftAll('manuscript'); }
}
}, 5 * 1000);
autoCatnip = setInterval(function() {
var catnip = gamePage.resPool.get('catnip');
var calendar = gamePage.calendar;
// Only run if positive catnip and not in last half of Autumn
if (catnip.perTickUI < 0) { return; }
if (catnip.value / catnip.maxValue < 0.95) { return; }
if (calendar.season == 2 && calendar.day > 50) { return; }
gamePage.craftAll('wood');
}, 5 * 1000);
starClick = setInterval(function() { $("#gameLog").find("input").click(); }, 2 * 1000);
autoCraft = setInterval(function() {
var resources = [
["wood", "beam" ],
["minerals", "slab" ],
["coal", "steel"],
["iron", "steel"],
["titanium", "alloy"]
];
for (var i = 0; i < resources.length; i++) {
var curRes = gamePage.resPool.get(resources[i][0]);
if (curRes.value / curRes.maxValue > 0.95
&& gamePage.workshop.getCraft(resources[i][1]).unlocked) {
gamePage.craftAll(resources[i][1]);
}
}
}, 5 * 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment