old source files of 2018-2020.

This commit is contained in:
Douwe Ravers
2022-04-15 14:29:07 +02:00
parent 0985358150
commit 85215ebd97
20 changed files with 676 additions and 795 deletions

16
job_reserver.js Normal file
View 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]);
}
}
};