room
index
(built-in)

The room module, for all MUD room-related stuff.

 
Classes
       
__builtin__.object
Room

 
class Room(__builtin__.object)
    __init__(self, uid_or_string_key)
 
Creates a new Python reference to a room, by uid. If a string database
key is instead supplied, first try to generate a room by an rporoto of
the same name. If no rproto exists, create a new blank room in the room
table, and assign it the given key.
 
  Methods defined here:
__cmp__(...)
x.__cmp__(y) <==> cmp(x,y)
__hash__(...)
x.__hash__() <==> hash(x)
__init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
add_cmd(...)
add_cmd(name, shorthand, cmd_func, user_group, interrupts = False)
 
Add a new player command specific to the room. See mudsys.add_cmd for
documentation on commands.
add_cmd_check(...)
add_cmd_check(cmd_name, check_func)
 
Add a new command check function specific to the room. See 
mudsys.add_cmd_check for documentation on command checks.
attach(...)
attach(trigger)
 
Attach a trigger to the room by key name.
aux(...)
Alias for room.Room.getAuxiliary(name)
deletevar(...)
deletevar(name)
 
Deletes a special variable from a room if they have one by the
given name.
delvar(...)
Alias for room.Room.deletevar(name)
detach(...)
detach(trigger)
 
Detach a trigger from the room by key name.
dig(...)
dig(dir, dest)
 
Link the room to another room via the specified direction. The
destination room can be an actual room or a room key name. Returns
the created exit. If an exit already exists in the specified
direction, change its destination.
edesc(...)
edesc(keywords, desc)
 
Create an extra description for the room, accessible via a comma-
separated list of keywords.
exdir(...)
exdir(exit)
 
Returns the direction for a specified exit, or None.
exit(...)
exit(dir)
 
Returns an exit for the specified direction, or None.
fill(...)
fill(dir)
 
Erases an exit in the specified direction.
getAuxiliary(...)
getAuxiliary(name)
 
Returns room's auxiliary data of the specified name.
getvar(...)
getvar(name)
 
Return value of a special variable. Return 0 if no value has been set.
hasBit(...)
hasBit(name)
 
Return whether room has a bit toggled.
hasvar(...)
hasvar(name)
 
Return True if a room has the given special variable. False otherwise.
isinstance(...)
isinstance(prototype)
 
returns whether the room inherits from a specified room prototype.
reset(...)
reset()
 
Runs a room's reset commands and reset hooks.
send(...)
send(mssg)
 
Send a message to all characters in the room.
setvar(...)
setvar(name, val)
 
Set value of a special variable for the room. Values must be strings 
or numbers. This function is intended to allow scripts and triggers toopen-endedly add variables to rooms.

Data descriptors defined here:
bits
A comma-separated list of setting bits currently toggled on the room.
chars
A list of all characters in the room. Immutable. See char.Char.room
for changing the room a character is in.
contents
A list of objects in the room. Immutable. See obj.Obj.room for
changing the room an object is in.
desc
The room's description when, e.g., looked at.
exnames
A list of the room's exits, by direction. Immutable. See room.Room.dig
for creating new links between rooms.
locale
The zone a room belongs to. Immutable.
name
The room's name, e.g., Town Square.
objs
Alias for room.Room.contents
proto
The room's unique identifier key. For non-instanced rooms, equivalent
to the main room prototype inherited from. Immutable.
protoname
The first half of the room's unique identifier key. Immutable.
protos
A comma-separated list of room prototypes this room inherits from. Immutable.
terrain
The current terrain type of the room.
uid
The room's unique identification number. Immutable.

Data and other attributes defined here:
__new__ = <built-in method __new__ of type object at 0x6d600>
T.__new__(S, ...) -> a new object with type S, a subtype of T

 
Functions
       
get_room(...)
get_room(key)
 
Takes a room key/locale and returns the matching room, or None.
instance(...)
instance(room_proto, as_key = None)
 
Create an instanced copy of a room, specified by a room prototype name.
If as_key is None, the instanced room's key will be a derivation of
the original prototype name, with a uid number appended to it. Otherwise
as_key is used for the room's key.
is_abstract(...)
is_abstract(proto)
 
Returns whether a specified room prototype is abstract. Also return True
if the prototype does not exist.
is_loaded(...)
is_loaded(key)
 
Returns whether a room with the given key currently exists in game.