Skip to content

Instantly share code, notes, and snippets.

@Drakim
Drakim / main.js
Created April 28, 2017 11:20
Screeps renew bug
var roleHarvester = {
run: function(creep) {
if(creep.carry.energy < creep.carryCapacity) {
var sources = creep.room.find(FIND_SOURCES);
if(creep.harvest(sources[0]) == ERR_NOT_IN_RANGE) {
creep.moveTo(sources[0], {visualizePathStyle: {stroke: '#ffaa00'}});
}
}
else {
var targets = creep.room.find(FIND_STRUCTURES, {