Navigation

    forum

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

    brento73

    @brento73

    2
    Posts
    713
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    brento73 Follow

    Posts made by brento73

    • RE: roleFixer not defined

      Thanks, yeah, I was missing that 'require' at the beginning of the main. 

      posted in Help
      brento73
    • roleFixer not defined

      I'm trying to make a creep to go around repairing structures, and I'm having this issue:

       

      I create a module

      role.fixer

      which has this:

      var roleFixer = {

      /** @param {Creep} creep **/
      run: function(creep) {

      //code to fix things
      }
      };

      module.exports = roleFixer;

       

      When I put the following in my main:

       

      if(creep.memory.role == 'fixer') {
      roleFixer.run(creep);
      }

      I get this error:

       

      ReferenceError: roleFixer is not defined
      at Object.module.exports.loop (main:59:13)
      at __mainLoop:1:52

       

      What am I doing wrong? The role.fixer module looks the same as my other roles, so I can't figure out why it's not 'defined'.

      posted in Help
      brento73