screeps/role.claimer.js
2020-11-09 19:31:39 -06:00

13 lines
383 B
JavaScript

let roleClaimer = {
run: function(creep) {
if(Game.flags.claim.room==undefined){
creep.travelTo(Game.flags.claim)
} else{
if(creep.claimController(Game.flags.claim.room.controller) == ERR_NOT_IN_RANGE) {
creep.travelTo(Game.flags.claim.room.controller)
}
}
}
};
module.exports = roleClaimer;