我尝试像那样使用findNearest:varsources=creep.room.findNearest(Game.SOURCES)creep.moveTo(sources[0]);creep.harvest(sources[0]);这就是我得到的:TypeError:undefinedisnotafunctionatmodule.exports:5:28at:11:6如何使用此方法和findInRange才不会导致此错误? 最佳答案 这里有几点需要注意:findNearest()不在房间对象中。简单修复varsources=cr