Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var targets = creep.room.find(FIND_STRUCTURES, {
- filter: (structure) => {
- return (structure.structureType == STRUCTURE_EXTENSION ||
- structure.structureType == STRUCTURE_SPAWN ||
- structure.structureType == STRUCTURE_TOWER) && structure.energy < structure.energyCapacity;
- }
- });
- if(targets.length > 0) {
- //console.log("list isn't empty");
- if(creep.transfer(targets[0], RESOURCE_ENERGY) == ERR_NOT_IN_RANGE) {
- creep.moveTo(targets[0]);
- //console.log("if creep.move firing?");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement