Navigation

    forum

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

    UncreativeUsername

    @UncreativeUsername

    10
    Posts
    1335
    Profile views
    0
    Followers
    1
    Following
    Joined Last Online

    UncreativeUsername Follow

    Posts made by UncreativeUsername

    • RE: Claiming a new room, please help

      confirmed, role.claimer is functional!

      posted in Help
      UncreativeUsername
    • RE: Claiming a new room, please help

      @Calfa thank you this is a huge help.

      posted in Help
      UncreativeUsername
    • RE: Claiming a new room, please help

      or, could I do somthing like this in the module:

      var roleclaimer = {

      run: function(creep) {

      let flag = Game.flags[creep.memory.targetFlag];
      
      let ctrl = creep.room.controller;
      
      if(flag){
          
          if(creep.room == flag.room){
      
              let claimResult = creep.claimController(ctrl);
      
              if(claimResult == ERR_NOT_IN_RANGE){
      
                  creep.moveTo(ctrl, {visualizePathStyle: {stroke: '#cc00cc'}});
      
              }
      
          }
          else{
      
              creep.moveTo(flag, {visualizePathStyle: {stroke: '#cc00cc'}});
      
          }
      
      }
      

      } }; module.exports = roleclaimer;

      and then, since i will only use each creep once, spawn the creep like this : Game.spawns['S1'].spawnCreep( [CLAIM, MOVE], 'Claimer1', { memory: { role: 'claimer' } {targetFlag: 'flag1'} );

      posted in Help
      UncreativeUsername
    • RE: Claiming a new room, please help

      so, i I just want one of my roles to involve flags, because my other roles are already working, how could I tell the one role to be assigned to a flag? like, without using assign new flag, and encorperating it into the same module?

      posted in Help
      UncreativeUsername
    • RE: Claiming a new room, please help

      so i am guessing flagmanager is its own module?

      posted in Help
      UncreativeUsername
    • RE: Claiming a new room, please help

      const AssignNewFlag = require('routines.assignNewFlag');

      does this assign the creep to a flag? how do you control wich flag if you have multiple flags?

      edit: nvm i found at the bottom that you assign by color.

      posted in Help
      UncreativeUsername
    • RE: Harvesting energy from an unclaimed room

      @Lisp thank you for telling me how to format my code in the forum. thanks for editing the code, ill try it and see if it works.

      posted in Help
      UncreativeUsername
    • RE: Claiming a new room, please help

      so creeps can see flags in other rooms? or do you place the flag on the border of the first room so the creep goes into the second room?

      I would love your code, but I also will want to know how it works, so if you are willing to give it to me expect potential questions on the how and why of the code.

      posted in Help
      UncreativeUsername
    • Claiming a new room, please help

      I have recently reached GCL 2 and am trying to claim a new room. i have been trying to use
      creep.moveTo(new RoomPosition(47, 25, 'E15S5'));
      however it is giving me error messages that make no sense. please give me a code that will tell my creep to move to a specific room, go to the controler in that room, and claim it

      posted in Help
      UncreativeUsername
    • Harvesting energy from an unclaimed room

      I am trying to get a creep to harvest energy from an unclaimed room adjacent to mine then return to mine to deposit the energy in an extension in my room, but it tells me that else is undefined. Please help!

      Here is my code:

      var roleouterharvester = {

      run: function(creep) {

          if(creep.carry.energy < creep.carryCapacity) 
      

      { creep.moveTo(new RoomPosition(4, 13, 'W58S46'));

      { var sources = creep.room.find(FIND_SOURCES);

              if(creep.harvest(sources[0]) == ERR_NOT_IN_RANGE) {
      
                  creep.moveTo(sources[0], {visualizePathStyle: {stroke: '#ffaa00'}});
      
              }
      
          }
      

      }

          Else { 
      

      {creep.moveTo(new RoomPosition(48, 15, ' W59S46'));

      { var targets = creep.pos.findClosestByRange (FIND_STRUCTURES, {

                      filter: (structure) => {
      
                          return (structure.structureType == 
      

      STRUCTURE_EXTENSION)

                          && structure.energy < structure.energyCapacity;
      
                      }
      
              }
      

      });

              if(targets.length > 0) {
      
                  if(creep.transfer(targets[0], RESOURCE_ENERGY) == 
      

      ERR_NOT_IN_RANGE) {

                      creep.moveTo(targets[0], {visualizePathStyle: {stroke: '#ffffff'}});
      
                  }
      
              }
      
          }
      
      }
      

      };

      module.exports = roleouterharvester;

      Please excuse the weird formatting, it pasted weirdly.

      posted in Help
      UncreativeUsername