Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- else {
- let targets = creep.pos.findClosestByPath(FIND_STRUCTURES, {
- filter: (structure) =>
- (structure.structureType == STRUCTURE_SPAWN && structure.energy < structure.energyCapacity )||
- (structure.structureType == STRUCTURE_EXTENSION && structure.energy < structure.energyCapacity )||
- (structure.structureType == STRUCTURE_CONTAINER && structure.store < structure.storeCapacity )
- })
- if(targets) {
- if(creep.transfer(targets, RESOURCE_ENERGY) == ERR_NOT_IN_RANGE) {
- creep.moveTo(targets);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement