SHARE
TWEET

Untitled

a guest Feb 17th, 2017 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.     }
RAW Paste Data
Top