I am trying to use findNearest as follows:
var sources = creep.room.findNearest(Game.SOURCES) creep.moveTo(sources[0]); creep.harvest(sources[0]);
and this is what I get:
TypeError: undefined is not a function at module.exports:5:28 at <main>:11:6
How to use this method and findInRange so that they do not cause this error?
javascript screeps
Krokiet
source share