Navigation

    forum

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

    Zorach

    @Zorach

    7
    Posts
    1001
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    Zorach Follow

    Posts made by Zorach

    • RE: Cache results

      so something like...

      Function = function (room) {
          if (global.Cache.rooms[room].FunctionName === undefined) {
              if (global.Cache.rooms[room] === undefined) {
                  if (global.Cache.rooms === undefined) {
                      if (global.Cache === undefined) {
                          global.Cache = {};
                      }
                      global.Cache.rooms = {};
                  }
                  global.Cache.rooms[room] = {};
              }
              global.Cache.rooms[room].FunctionName = FunctionCode;
          }
          return global.Cache.rooms[room].FunctionName;
      }
      
      ?
      is there a way I could format that better? more readable etc.?
      
      posted in Help
      Zorach
    • RE: Recomended IDEs

      Any suggestions on customization or setup of your preferred IDE for screeps?

      posted in Help
      Zorach
    • Recomended IDEs

      planing on doing a full rewrite of my AI and was thinking of swapping IDE to do it, (had just been using the in game environment) what are some suggestions?

      posted in Help
      Zorach
    • RE: Twitter promo finally here, but...

      In the same lack of followers boat here, if anyone wants to follow me or wants me to follow them I'm @ICZorach.
      Also if you were wanting to abuse newbie protection couldn't you just make 11 twitter accounts?

      posted in General Discussion
      Zorach
    • Cache results

      I have an expensive function that returns a variable result.
      I only want to call this function once per tick but want to access and change the result multiple times per tick.
      What are some recommendations on how to achieve this?

      posted in Help
      Zorach
    • RE: Memory not being assigned to creeps

      That seems to be working thanks!
      though now I will need to figure out how to generalise the script 😞

      posted in Help
      Zorach
    • Memory not being assigned to creeps

      When I spawn a creep using this function it isn't having role: 'hauler' assigned to its memory,
      The creep will build but wont have anything in memory.

      for (spawn in Game.spawns){
      var spawn = Game.spawns[spawn];
      if (Memory.buildList.length){
      for (var i in Memory.buildList){
      var blueprint = Memory.buildList[i];
      var body = blueprint.body;
      if (!spawn.canCreateCreep(body)){
      console.log(spawn.createCreep(body,null,{role:'hauler'}));
      Memory.buildList.splice(i,1);
      };
      };
      };
      };

      posted in Help
      Zorach