Navigation

    forum

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

    Madrang

    @Madrang

    4
    Posts
    920
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    Madrang Follow

    Posts made by Madrang

    • RE: CPU tips and tricks

      The biggest saving i found was by replacing Structure.prototype.isActive

          const _isActive = Structure.prototype.isActive;
          Structure.prototype.isActive = function() {
              if (this.structureType === STRUCTURE_CONTAINER || this.structureType === STRUCTURE_ROAD) {
                  // Always true for these
                  this.isActive = function() { return true };
                  return true;
              }
              const room = this.room;
              const roomLevel = (room.memory.level || room.controller.level);
              if (roomLevel === CONTROLLER_MAX_LEVEL) {
                  this.isActive = function() { return true };
                  return true;
              }
              const curActive = _isActive.call(this);
              this.isActive = function() { return curActive };
              return curActive;
          };
      
      posted in General Discussion
      Madrang
    • RE: RoomPosition.createFlag fails without room vision

      Got the same error, devs should confirm if this is intended or not.

      posted in Technical Issues and Bugs
      Madrang
    • RE: Cannot use 0 as a default public segment

      Was still there, so i made a PR.

      https://github.com/screeps/driver/pull/46

      posted in Technical Issues and Bugs
      Madrang
    • RFC - Add optional reason string to halt

      Hi, currently in my code, if/when it breaks and i'm away. It will try to reset global and re-validate memory by restarting. Always before calling halt i send a notification to try to know what broke, but even if it does trigger once in a while, that specific notification is never sent/received.

      Game.notify(messageString); Game.cpu.halt();

      All other notifications as long as halt is not called in the same tick are received. I think it would be easier to just allow Game.cpu.halt(messageString | errorObj); to do both in one call.

      posted in Technical Issues and Bugs
      Madrang