Homepage Forums Code Help Example

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #1212
    Atanner
    Keymaster

    If you are having an issue with a code section or want help outlining a new feature make a post here.

    If you are posting code then please use a Code Tag from above. It makes it much easier to read.

    Shortcode for Code Block

    function extendSource(creep) {
      let target = Game.getObjectById(creep.memory.task.source);
      let inRange = creep.pos.inRangeTo(target, 3);
    
    if (inRange && creep.powers[PWR_REGEN_SOURCE].cooldown == 0) {
      creep.usePower(PWR_REGEN_SOURCE, target);
    
      delete creep.memory.task;
    } else {
      creep.moveTo(target, {reusePath: 15, ignoreRoads: true, plainCost: 1, swampCost: 1, range: 3});
    }
    
    }
    
    • This topic was modified 4 months, 3 weeks ago by Atanner.
    • This topic was modified 4 months, 3 weeks ago by Atanner.
    • This topic was modified 4 months, 3 weeks ago by Atanner.
    • This topic was modified 4 months, 3 weeks ago by Atanner.
    • This topic was modified 4 months, 3 weeks ago by Atanner.
Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.