Hey You could also check for energy available. With every find function you can add a function to filter your research. var source = spawn.pos.findClosestByRange(FIND_SOURCES, { filter:(source)=>{ return /*your test here*/ true;} }); if(!source){/**no sources found, do something else*/} if(creep.harvest(source) == ERR_NOT_IN_RANGE) {  creep.moveTo(source);} http://support.screeps.com/hc/en-us/articles/203079211-Source