Navigation

    forum

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

    Posts made by CharlyCreeper

    • Quickly switching between console and script tabs leads to them automatically switching themselves

      Maybe is my just my computer broken? Here's a video I recorded:

      https://youtu.be/zxWGF-SMFr8

      Thanks in advance!

      Edit: It happens in the steam version

      posted in Technical Issues and Bugs
      CharlyCreeper
    • RE: Hi, here's a little code I wrote to generate random room names, but it gives me the following error:

      thanks everyone, I forgot that silly thing. Problem solved

      posted in Help
      CharlyCreeper
    • Hi, here's a little code I wrote to generate random room names, but it gives me the following error:

      Cannot read property "controller" of undefined, the code is the following:

          function getRandomInt(max) {
              return Math.floor(Math.random() * Math.floor(max));
          }
          function getRoomName(NameOfTheRoom){
              let Yletter = 'S';
              let Ycoord;
              let Xletter = 'E';
              let Xcoord;
              let roomDescomposed;
              
              let numY = NameOfTheRoom.split("S");
              if(numY.length == 1){
                  Yletter = 'N';
                  numY = NameOfTheRoom.split("N");
              }
              let numX = numY[0].split('E');
              if(numX.length == 1){
                  Xletter = 'W';
                  numX = numY[0].split("W");
              }
              Ycoord = numY[1];
              Xcoord = numX[1];
              roomDescomposed = [Xletter, Xcoord, Yletter, Ycoord];
              return roomDescomposed;
          }
           function getRandomRoom(roomArray, limit){
              let newRoom = roomArray;
              if(getRandomInt(2) == 0){
                  newRoom[1] = Number(roomArray[1])+getRandomInt(limit + 1);
                  newRoom[3] = Number(roomArray[3])+getRandomInt(limit + 1);
              }
              else{
                  newRoom[1] = Number(roomArray[1])-getRandomInt(limit + 1);
                  newRoom[3] = Number(roomArray[3])-getRandomInt(limit + 1);
              }
              if(newRoom[1] < 0){
                  newRoom[1] = Math.abs(newRoom[1]);
                  if(newRoom[0] == 'E'){
                      newRoom[0] = 'W';
                  }
                  else{
                      newRoom[0] = 'E';
                  }
              }
              if(newRoom[3] < 0){
                  newRoom[3] = Math.abs(newRoom[3]);
                  if(newRoom[2] == 'N'){
                      newRoom[2] = 'S';
                  }
                  else{
                      newRoom[2] = 'N';
                  }
              }
              newRoom = (newRoom[0]+newRoom[1]+newRoom[2]+newRoom[3]).toString();
              console.log(newRoom); //here it returns the name of the room correctly v(ยท_ยท)v
              if(Game.rooms[newRoom].controller.reservation.my || Game.rooms[newRoom].controller.my){
                  newRoom = undefined;
              }
              return newRoom;
          }
          creep.memory.MyRoom = getRoomName(creep.room.name);
          if(creep.memory.target == undefined || creep.memory.target == creep.memory.MyRoom){
              creep.memory.target = getRandomRoom(creep.memory.MyRoom, 3);
      posted in Help
      CharlyCreeper
    • RE: How can I stay up to date on wars and in-game politics?

      Thanks!

      posted in General Discussion
      CharlyCreeper
    • How can I stay up to date on wars and in-game politics?

      Is there a Discord server or something? I'm really curious abot that. Thanks ๐Ÿ™‚

      posted in General Discussion
      CharlyCreeper
    • RE: How can I know which rampart/wall has the lowest amount of hitpoints?

      @tehfiend That's easier, thanks!

      posted in Help
      CharlyCreeper
    • RE: How can I know which rampart/wall has the lowest amount of hitpoints?

      thanks!

      posted in Help
      CharlyCreeper
    • How can I know which rampart/wall has the lowest amount of hitpoints?

      the tittle

      posted in Help
      CharlyCreeper
    • RE: How does each bodypart affect fatigue?

      thanks!

      posted in Help
      CharlyCreeper
    • How does each bodypart affect fatigue?

      How much fatigue does each bodypart generate?

      posted in Help
      CharlyCreeper
    • RE: This is my code for role.claimer, and it doesn't work, any idea?

      @geir1983 Ok, so I don't have enough gcl, do you know how can I increase it? I'm kinda noob ๐Ÿ˜›

      posted in Help
      CharlyCreeper
    • RE: This is my code for role.claimer, and it doesn't work, any idea?

      Thx, I'll try

      posted in Help
      CharlyCreeper
    • This is my code for role.claimer, and it doesn't work, any idea?

      So the creep moves towards the controller, but then it stands still without claiming it... This is the code

      var roleClaimer = {

      run: function(creep) { 
          creep.memory.target = 'E1S42';
          if(creep.room.name != creep.memory.target){
              var getMeOut = creep.room.findExitTo(creep.memory.target);
              creep.moveTo(creep.pos.findClosestByRange(getMeOut));
          }
          else{
              creep.moveTo(creep.room.controller);
              creep.claimController(creep.room.controller); 
          }
      }    
      

      };

      module.exports = roleClaimer;

      posted in Help
      CharlyCreeper
    • This is my code for role.scout, for some reason it doesn't work

      The creep starts moving the wrong direction and goes into another room. Then it stands still.

      var roleScout = {

      run: function(creep) { 
          creep.memory.target = ('E1S46');
          if(creep.room.name != creep.memory.target){
              var getMeOut = creep.room.findExitTo(creep.memory.target);
              creep.moveTo(creep.pos.findClosestByRange(getMeOut));
              creep.say(':D ?');
          }
          else{
              creep.moveTo(creep.room.controller);
          }
      }
      

      }

      module.exports = roleScout;

      Any idea?

      posted in Help
      CharlyCreeper
    • RE: Can you see anything wrong here in my code?

      @donatzor And... It worked!! Thanks a lot!!!!!

      posted in Help
      CharlyCreeper
    • RE: Can you see anything wrong here in my code?

      @donatzor Thanks! I'll try it out

      posted in Help
      CharlyCreeper
    • Can you see anything wrong here in my code?

      It's a code for role.builder module, I was trying to get him to repair ramparts when built, so they wouldn't be destroyed, but it doesn't work. Is there anything you can see here?

      var roleBuilder = {

      run: function(creep) {
      
          if(creep.memory.building && creep.store[RESOURCE_ENERGY] == 0) {
              creep.memory.building = false;
              creep.say('ENERGY');
          }
          if(!creep.memory.building && creep.store.getFreeCapacity() != creep.store.getCapacity()) {
              creep.memory.building = true;
              creep.say('WORK');
          }
          if(creep.memory.building == true) {
              if(creep.memory.repairing == false){
                  var targets = creep.room.find(FIND_CONSTRUCTION_SITES); 
                  if(targets.length) {
                      if(creep.build(targets[0]) == ERR_NOT_IN_RANGE) {
                        creep.moveTo(targets[0], {visualizePathStyle: {stroke: '#ffffff'}});
                      }
                  }
                  var important = creep.room.find(FIND_STRUCTURES, {
                      filter: (s) => s.hits < 2 && s.structureType == STRUCTURE_RAMPART
                  });
                  if(important != undefined){
                      creep.memory.repairing = true;
                  }
              }
              else{
                  if(creep.repair(important) == ERR_NOT_IN_RANGE){
                      creep.moveTo(important, {visualizePathStyle: {stroke: '#ffffff'}});
                  }
              }
          }
          else {
              creep.memory.repairing = false;
              let container = creep.room.find(FIND_STRUCTURES, {
                  filter: s => s.structureType == STRUCTURE_CONTAINER && s.store[RESOURCE_ENERGY] > 0 
              });
      
              if (container.length > 0) {
      
                  if (creep.withdraw(container[0], RESOURCE_ENERGY) == ERR_NOT_IN_RANGE) {
                      creep.moveTo(container[0]);
                  }
              }
          }
      }
      

      };

      module.exports = roleBuilder;

      posted in Help
      CharlyCreeper