Navigation

    forum

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

    MrC0de

    @MrC0de

    3
    Posts
    974
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    MrC0de Follow

    Posts made by MrC0de

    • RE: Allow us to access .type of objects

          report(thing) {
              var report = "";
              report += "Report For "+  thing + "\n";
              if (thing.structureType != null) {
                  report += "Type: STRUCTURE\n";
              } else if ( thing instanceof Creep ) {
                  report += "Type: CREEP\n";
              }
              report += "ID: " + thing.id + "\n";
              report += "---------------\n";
              report += "STRINGIFIED:\n" + JSON.stringify(thing) + "\n";
              report += "---------------\n";
              
              console.log(report);
          }

      ---------------
      Report For [creep Kaelyn]
      Type: CREEP
      ID: 58841ace5f886cd81fe8c6a6
      ~~~~~~~~~~
      STRINGIFIED:
      {"room":{"name":"E75N2","mode":"world","energyAvailable":500,"energyCapacityAvailable":550},"pos":{"x":24,"y":14,"roomName":"E75N2"},"id":"58841ace5f886cd81fe8c6a6","name":"Kaelyn","body":[{"type":"work","hits":100},{"type":"carry","hits":100},{"type":"carry","hits":100},{"type":"move","hits":100},{"type":"move","hits":100}],"my":true,"owner":{"username":"MrC0de"},"spawning":false,"ticksToLive":1440,"carryCapacity":100,"carry":{"energy":2},"fatigue":0,"hits":500,"hitsMax":500}
      ~~~~~~~~~~

      Thanks your answers all helped me along!
      - Man from Future

      posted in Feature Requests
      MrC0de
    • RE: Problems with finding containers

      I was using

         var roomContainers = Game.rooms[creep.room.name].find(FIND_MY_STRUCTURES, { filter: (structure) => { return ((structure.structureType == STRUCTURE_CONTAINER)) } });


                          console.log("Containers: "+ roomContainers.length);

       

      Apparently Containers arent in the MY.

      Once I swapped to FIND_STRUCTURES it worked

      posted in Help
      MrC0de
    • Seeking Advice

      Hello,

         Just started screeps and hoping to work at for awhile. I put my current screeps on my github http://www.github.com/MrC0de  and I am hoping folks can advise me on any topics they see as relevant. I am becoming increasingly concerned over the cpu spikes I see that I am pretty sure are my fault.

          I'm basically collecting advice to ponder while optimizing later, looking for things to consider, feel free to bash my scripts I welcome your constructive criticism.

       

      posted in Help
      MrC0de