Skip to content

Instantly share code, notes, and snippets.

@Olical
Olical / factory.js
Created November 21, 2014 00:03
Screeps hervester swarm - http://screeps.com
var _ = require('lodash');
function countType(type) {
return _.size(_.filter(Game.creeps, function (creep, creepName) {
return creepName.split('_')[0] === type;
}));
}
function build(spawn, type, attrNames) {
var attrs = attrNames.map(function (name) {