initial commit, tutorial level scripts

This commit is contained in:
2024-04-30 21:37:16 +02:00
parent d672727d9b
commit efa3d8df5c
48 changed files with 8250 additions and 0 deletions
@@ -0,0 +1,19 @@
var roleUpgrader = {
/** @param {Creep} creep **/
run: function (creep) {
if (creep.store[RESOURCE_ENERGY] == 0) {
var sources = creep.room.find(FIND_SOURCES);
if (creep.harvest(sources[0]) == ERR_NOT_IN_RANGE) {
creep.moveTo(sources[0]);
}
}
else {
if (creep.upgradeController(creep.room.controller) == ERR_NOT_IN_RANGE) {
creep.moveTo(creep.room.controller);
}
}
}
};
module.exports = roleUpgrader;