mirror of
https://github.com/paradizelost/screeps.git
synced 2024-11-25 02:14:44 -06:00
14 lines
533 B
JavaScript
14 lines
533 B
JavaScript
let buildparts=require('bodypartbuilder')
|
|
let roleMiner = {
|
|
run: function(creep) {
|
|
if(creep.memory.originroom === undefined){
|
|
creep.memory.originroom = creep.room.name
|
|
}
|
|
if(Game.getObjectById(creep.memory.destsource.id)==undefined){creep.memory.destsource=undefined}
|
|
let mysource=Game.getObjectById(creep.memory.destsource.id)
|
|
if(creep.harvest(mysource) == ERR_NOT_IN_RANGE) {
|
|
creep.moveTo(mysource);
|
|
}
|
|
}
|
|
};
|
|
module.exports = roleMiner; |