Skip to content

Instantly share code, notes, and snippets.

@kbakdev
Created May 14, 2022 17:32
Show Gist options
  • Save kbakdev/26d55243177e0f535c960b4db2431176 to your computer and use it in GitHub Desktop.
Save kbakdev/26d55243177e0f535c960b4db2431176 to your computer and use it in GitHub Desktop.
screeps2
module.exports.loop = function () {
var creep = Game.creeps['Harvester1'];
var sources = creep.room.find(FIND_SOURCES);
if(creep.harvest(sources[0]) == ERR_NOT_IN_RANGE) {
creep.moveTo(sources[0]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment