Technical issues with a road builder



  • http://pastebin.com/Z9Kudkh8

    this road builder script I wrote shows an error message that one of the rooms im cyceling through is not defined... 

    for(let room in Game.rooms){
    Game.rooms[room].lookAt(x,y)

    (well not that easy but essentially its that ... and is it normal that "for(let room of Game.rooms){/* stuff */}" doesnt work?)

    it works on every other server but not on screeps.com... tested it on 2 other private servers without mods, with mods, on my own private server and on screeps.com ... screeps.com is the only one showing this error.

    i suspect theres something broken with one of the rooms...


  • YP

    have you tried to find out which room breaks ? 😉 Maybe try the command in the console and add a log so you see which one won't work. I have no problem with running 

       for(let room in Game.rooms){ Game.rooms[room].lookAt(15,15) }

    in my console.



  • yes i have tried that

     strangely there is only 4 rooms in the Game.rooms variable (which i checked with Object.keys(Game.rooms).length ) but sometimes its more sometimes its less...



  • Your script can only see rooms you have "visibility" in.  IE You have a creep in, or you have a building in that you own.  So send a 1MOVE part scout in the room you need visibility in and handle it there.