Help

JS-ROOM

For immortals Also: JAVASCRIPT-ROOM

The Room object represents rooms.

Class Methods:

at( number )     Returns a reference to the room at the specified number.
at( address )    The room at that address: Room.at( 'club.clubroom' ) (see JS-NAMES).
is( room, address )  Whether room is the room the address names: Room.is( actor.inRoom, 'moz.post-office' ). False for null.

Properties:

inRoomReturns a reference to itself.
inRoomNumberThe room number of this room (the old form: use inRoom and is()).
inZoneZone object that this room is in (see JS-ZONE).
inWorldWorld object that this room is in (see JS-WORLD).
vnumThe room number of this room.
dbThe database object for this room (see JS-DB)
shortDescThe name of this room.
longDescThe description of this room.
terrainThe terrain of this room (see TERRAIN).
controllerWho is this room's controller? (see JS-CONTROLLER)

Methods:

isActive()Returns true if the room is active.
isAura()Returns false
isMobile()Returns false
isObj()Returns false
isRoom()Returns true
isControlledByPC()Returns true if this room is under the control of a PC.
like()See JS-LIKE.
hasChars()Returns true if the room has mobiles or players in it.
hasPlayers()Returns true if the room has players in it.
hasSky()Returns true if the open sky is over the room, so weather and the sun reach it. Use this rather than testing the indoors flag.
cast()Casts a spell. See JS-ELEMENT-CAST.
damage()Does damage. See JS-ELEMENT-DAMAGE.
msg( string )Sends a message to characters in this room. See JS-MSG for more information.
amsg( string )Sends a message to characters in this room. See JS-MSG for more information.
hasFlag( f )Returns true if the room has the specified room flag (see ROOM-FLAGS). This method supports cardinalities -- see JS-CARDINALITY.
setFlag( f, v )Sets the room flag "f" to the value "v" which should evaluate to true or false.
dir( d )Returns the room object that the exit in the specified direction leads to.
getExitRoom( d )Returns the room that the specified direction leads to.
setExitRoom( d,r )Sets the room that the specified direction leads to. The room is an address ('moz.cellar') or, the old form, a number. Use -1 to remove an exit. You can also specify the optional 'reverse' option to set the reverse direction as well.
hasExitFlag( d,f )Returns true if the direction specified by 'd' has the specified flag 'f' (see EXITFLAGS). This method supports cardinalities -- see JS-CARDINALITY. Example: inRoom.hasExitFlag( 'n', 'any', 'locked', 'closed' );
setExitFlag(d,f,v)Sets the exit flag "f" for the direction 'd' to the value 'v' which should evaluate to true or false. Example: inRoom.setExitFlag( 'n', 'locked', true ); You can also optionally specify a fourth 'reverse' parameter which will cause the flag to be set in the reverse exit as well. inRoom.setExitFlag( 'n', 'locked', true, 'reverse' );
getExitDesc( d )Sets the exit description for direction d.
setExitDesc( d,s )Sets the exit description for direction d to sn.
waterLevel()Returns a number between 1 (100% water) and 0 (0% water) based upon how much water is in the room.
hasChar( v )Returns true if a mobile by the specified vnum is in the room. This method supports cardinalities -- see JS-CARDINALITY.
hasObj( v )Returns true if an object by the specified address ('moz.brass-key', or the old number) is in the room. This method supports cardinalities -- see JS-CARDINALITY.
findPath( t, d )This method returns an array containing the directions to take to get from the current room to the target t (which can be a room, object, mobile, or room number). The optional argument d specifies the number of rooms to search. By default 100 rooms will be searched. This method will return null if the target cannot be reached. Try not to use this function too frequently as it involves a lot of searching.
findChar( v )Finds and returns a mobile by the specified address (or the old number) in the room.
findObj( v )Finds and returns an object by the specified address (or the old number) in the room.
randomRoom()This returns a room at random. See JS-RANDOM-ROOM.
randomChar()This returns a character in this room at random or null if the room is empty of characters. See JS-RANDOM-CHAR.
randomObj()This returns an object in this room at random or null if the room has no objects.
visitChars( f )Applies the passed in function or array to all of the chars in this room. See JS-ROOM-VISIT for more information.
visitPlayers( f )Applies the passed in function or array to all of the players in this room. See JS-ROOM-VISIT for more information.
visitObjs( f )Applies the passed in function or array to all of the objects in this room. See JS-VISIT for more information. If the first argument is a vnum, then only objects with that vnum will be visited.
toString()Returns the name of the room.
valueOf()Returns the name of the room.
hasAura( n )Returns true if the room has this aura. This method supports cardinalities -- JS-CARDINALITY.
addAura()See JS-ELEMENT.
removeAura()See JS-ELEMENT.
addAuraCat()See JS-ELEMENT.
removeAuraCat()See JS-ELEMENT.