First commit

This commit is contained in:
uwap 2022-12-20 08:17:26 +01:00
commit 6496f2d0ab
9 changed files with 1088 additions and 0 deletions

10
src/index.ts Normal file
View file

@ -0,0 +1,10 @@
export function loop() {
const spawn = Game.spawns.Spawn1;
spawn.spawnCreep([WORK, CARRY, CARRY, MOVE], 'w1');
for (const creep of Object.values(Game.creeps)) {
const source = creep.pos.findClosestByPath(FIND_SOURCES_ACTIVE);
if (source && creep.harvest(source) === ERR_NOT_IN_RANGE) {
creep.moveTo(source);
}
}
}