Advertisement
Guest User

Untitled

a guest
Feb 17th, 2017
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. else {
  2. let targets = creep.pos.findClosestByPath(FIND_STRUCTURES, {
  3. filter: (structure) =>
  4. (structure.structureType == STRUCTURE_SPAWN && structure.energy < structure.energyCapacity )||
  5. (structure.structureType == STRUCTURE_EXTENSION && structure.energy < structure.energyCapacity )||
  6. (structure.structureType == STRUCTURE_CONTAINER && structure.store < structure.storeCapacity )
  7.  
  8. })
  9. if(targets) {
  10. if(creep.transfer(targets, RESOURCE_ENERGY) == ERR_NOT_IN_RANGE) {
  11. creep.moveTo(targets);
  12. }
  13. }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement