Navigation

    forum

    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    1. Home
    2. HellWatcher
    3. Topics
    • Flag Profile
    • block_user
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Groups
    • Blog

    Topics created by HellWatcher

    • [Resolved] Help with withdraw from container
      Help • • HellWatcher

      3
      3
      Posts
      9557
      Views

      Welp, looked at my code and I had left it backwards. copied it from my harvesters' code and didn't switch true:falsemodule.exports = { run: function(creep) { if(creep.memory.working == true && creep.carry.energy == 0) { creep.memory.working = false; } else if (creep.memory.working == false && creep.carry.energy == creep.carryCapacity) { creep.memory.working = true; } if(creep.memory.working == true) { var Container = creep.pos.findClosestByPath(FIND_STRUCTURES, { filter: (s) => s.structureType == STRUCTURE_CONTAINER && s.store[RESOURCE_ENERGY] > 0 }) if(creep.withdraw(Container, RESOURCE_ENERGY) == ERR_NOT_IN_RANGE) { creep.moveTo(Container) } } else { var EnergyStructures = creep.pos.findClosestByPath(FIND_STRUCTURES, { filter: (s) => (s.structureType == STRUCTURE_SPAWN || s.structureType == STRUCTURE_EXTENSION) && s.energy < s.energyCapacity }) if(creep.transfer(EnergyStructures) == ERR_NOT_IN_RANGE) { creep.moveTo(EnergyStructures) } } }};silly me
    • [Resolved] Massive script error
      Help • • HellWatcher

      3
      3
      Posts
      4198
      Views

      Thanks MyrddinE, I disabled every module and re-enabled them one at a time and found that for some reason screeps-profiler was causing the issue. I probably broke it. I'm not even close to actually benefiting from it. So, I will just leave it off.    *Edit: Most likely it was how my defense acquired targets I had reverted to a working variant without realising. It takes a few minutes before the error shows up.