Skip to content

Instantly share code, notes, and snippets.

@Darkosto
Created February 2, 2017 04:06
Show Gist options
  • Save Darkosto/afee1e3a1a457c7ae76386b6cc26a1d2 to your computer and use it in GitHub Desktop.
Save Darkosto/afee1e3a1a457c7ae76386b6cc26a1d2 to your computer and use it in GitHub Desktop.
if(creep.carry.energy == 0) {
var sources = creep.room.find(FIND_SOURCES_ACTIVE);
if(creep.harvest(sources[0]) == ERR_NOT_IN_RANGE) {
creep.moveTo(sources[0]);
creep.harvest(source) -> ['50'];
}
}
els
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment