Search for a room through this name

Suppose I store the name of the room in memory - "1-1". How can I get around accessing a room object without accessing any creep / structure in this room? Sort of:

function(roomName){
  var room = Game.rooms.roomName; //what would the simplest and quickest code be?
}

Thanks in advance.

+4
source share
1 answer

You cannot access a room if there are no objects in it. It is like a fog of war. To see what is inside (in other words, to access an instance of a room object), you must send some of your creeps.

Property added to API

The UPDATE : Game.rooms.

+6
source

All Articles