old source files of 2018-2020.
This commit is contained in:
16
job_reserver.js
Normal file
16
job_reserver.js
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
/* ###########################################
|
||||
# Go to a controller and reserve the room #
|
||||
###########################################*/
|
||||
|
||||
module.exports = {
|
||||
do: function(creep){
|
||||
if(Game.flags[creep.memory.target].room != undefined && Game.flags[creep.memory.target].room == creep.room){
|
||||
if(creep.reserveController(creep.room.controller) == ERR_NOT_IN_RANGE){
|
||||
creep.moveTo(creep.room.controller);
|
||||
}
|
||||
} else {
|
||||
creep.moveTo(Game.flags[creep.memory.target]);
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user