diff --git a/role.builder.js b/role.builder.js index 013ec2e..a2b5a4e 100644 --- a/role.builder.js +++ b/role.builder.js @@ -51,7 +51,7 @@ var roleBuilder = { else { var containers = creep.room.find(FIND_STRUCTURES, { filter: (structure) => { - return (structure.structureType == STRUCTURE_CONTAINER && structure.store[RESOURCE_ENERGY] > 0) ; + return ((structure.structureType == STRUCTURE_CONTAINER|| structure.structureType == STRUCTURE_STORAGE) && structure.store[RESOURCE_ENERGY] > 0) ; }}); var allcontainers = creep.room.find(FIND_STRUCTURES, { filter: (structure) => { diff --git a/role.hauler.js b/role.hauler.js index 5ccf8bb..55a597b 100644 --- a/role.hauler.js +++ b/role.hauler.js @@ -23,7 +23,7 @@ var roleHauler = { }); var containertargets = creep.room.find(FIND_STRUCTURES, { filter: (structure) => { - return (structure.structureType == STRUCTURE_CONTAINER && structure.store[RESOURCE_ENERGY] < structure.storeCapacity) ; + return ((structure.structureType == STRUCTURE_CONTAINER || structure.structureType == STRUCTURE_STORAGE) && _.sum(structure.store) < structure.storeCapacity) ; } }); diff --git a/role.hauler2.js b/role.hauler2.js index f6a0d1b..0fb71a9 100644 --- a/role.hauler2.js +++ b/role.hauler2.js @@ -15,7 +15,7 @@ if(creep.carryCapacity > creep.carry.energy){ var container = creep.pos.findClosestByRange(FIND_STRUCTURES, { filter: (structure) => { - return (structure.structureType == STRUCTURE_CONTAINER && structure.store[RESOURCE_ENERGY] > 0) ; + return ((structure.structureType == STRUCTURE_CONTAINER|| structure.structureType == STRUCTURE_STORAGE) && structure.store[RESOURCE_ENERGY] > 0) ; }}); if(creep.withdraw(container,RESOURCE_ENERGY) == ERR_NOT_IN_RANGE) { creep.say("MTSC"); diff --git a/role.repairbot.js b/role.repairbot.js index 71bb730..e26bb9f 100644 --- a/role.repairbot.js +++ b/role.repairbot.js @@ -14,7 +14,7 @@ var roleRepairbot = { if(creep.memory.repairing==false){ var container = creep.pos.findClosestByRange(FIND_STRUCTURES, { filter: (structure) => { - return (structure.structureType == STRUCTURE_CONTAINER && structure.store[RESOURCE_ENERGY] > 0) ; + return ((structure.structureType == STRUCTURE_CONTAINER|| structure.structureType == STRUCTURE_STORAGE) && structure.store[RESOURCE_ENERGY] > 0) ; }}); if(creep.withdraw(container,RESOURCE_ENERGY) == ERR_NOT_IN_RANGE) { creep.say("MTSC"); diff --git a/role.towerrecharger.js b/role.towerrecharger.js index 0eaa615..efa9335 100644 --- a/role.towerrecharger.js +++ b/role.towerrecharger.js @@ -5,7 +5,7 @@ if(creep.carryCapacity > creep.carry.energy){ var container = creep.pos.findClosestByRange(FIND_STRUCTURES, { filter: (structure) => { - return (structure.structureType == STRUCTURE_CONTAINER && structure.store[RESOURCE_ENERGY] > 1000) ; + return ((structure.structureType == STRUCTURE_CONTAINER|| structure.structureType == STRUCTURE_STORAGE) && structure.store[RESOURCE_ENERGY] > 1000) ; }}); if(creep.withdraw(container,RESOURCE_ENERGY) == ERR_NOT_IN_RANGE) { creep.say("MTSC"); diff --git a/role.upgrader.js b/role.upgrader.js index e83fafe..70d8a9e 100644 --- a/role.upgrader.js +++ b/role.upgrader.js @@ -34,7 +34,7 @@ var roleUpgrader = { else { var containers = creep.room.find(FIND_STRUCTURES, { filter: (structure) => { - return (structure.structureType == STRUCTURE_CONTAINER && structure.store[RESOURCE_ENERGY] > 0) ; + return ((structure.structureType == STRUCTURE_CONTAINER|| structure.structureType == STRUCTURE_STORAGE) && structure.store[RESOURCE_ENERGY] > 0) ; }}); var allcontainers = creep.room.find(FIND_STRUCTURES, { filter: (structure) => {