screeps/role.miner.js

12 lines
396 B
JavaScript
Raw Normal View History

2016-09-28 08:37:28 -05:00
let roleMiner = {
2016-09-23 00:12:42 -05:00
run: function(creep) {
2016-09-28 08:37:28 -05:00
if(Game.getObjectById(creep.memory.destsource.id)==undefined){creep.memory.destsource=undefined}
2020-11-09 19:31:39 -06:00
let mysource=Game.getObjectById(creep.memory.destsource.id)
{
2016-09-28 08:37:28 -05:00
if(creep.harvest(mysource) == ERR_NOT_IN_RANGE) {
2020-11-09 19:31:39 -06:00
creep.travelTo(mysource);
2016-09-28 08:37:28 -05:00
}
2020-11-09 19:31:39 -06:00
}
2016-09-23 00:12:42 -05:00
}
2016-09-15 00:30:24 -05:00
};
module.exports = roleMiner;