Files
screeps/Room.js

18 lines
371 B
JavaScript

module.exports = {
setup: function () { Room.prototype = _Room.prototype; }
}
class _Room extends Room {
begin(){}
tick(){
const creepsCount = this.find(FIND_MY_CREEPS).length;
console.log(creepsCount);
if(creepsCount < 5){
const spawn = this.find(FIND_MY_STRUCTURES, {filter: {structureType: STRUCTURE_SPAWN}})[0];
spawn.createHarvester();
}
}
}