mirror of
https://github.com/paradizelost/screeps.git
synced 2024-11-28 19:54:01 -06:00
13 lines
383 B
JavaScript
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;
|