screeps/role.claimer.js

13 lines
383 B
JavaScript
Raw Normal View History

2017-06-06 13:17:26 -05:00
let roleClaimer = {
run: function(creep) {
2020-11-09 19:31:39 -06:00
if(Game.flags.claim.room==undefined){
creep.travelTo(Game.flags.claim)
2017-06-06 13:17:26 -05:00
} else{
2020-11-09 19:31:39 -06:00
if(creep.claimController(Game.flags.claim.room.controller) == ERR_NOT_IN_RANGE) {
creep.travelTo(Game.flags.claim.room.controller)
}
2017-06-06 13:17:26 -05:00
}
}
};
2017-07-13 23:24:42 -05:00
module.exports = roleClaimer;