<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><head><title>Python: room</title> </head><body bgcolor="#f0f0f8"> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading"> <tr bgcolor="#7799ee"> <td valign=bottom> <br> <font color="#ffffff" face="helvetica, arial"> <br><big><big><strong>room</strong></big></big></font></td ><td align=right valign=bottom ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br>(built-in)</font></td></tr></table> <p><tt>Contains the Python wrapper for rooms, and utilities for loading and<br> instancing rooms.</tt></p> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#ee77aa"> <td colspan=3 valign=bottom> <br> <font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr> <tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td> <td width="100%"><dl> <dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a> </font></dt><dd> <dl> <dt><font face="helvetica, arial"><a href="room.html#Room">Room</a> </font></dt></dl> </dd> </dl> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#ffc8d8"> <td colspan=3 valign=bottom> <br> <font color="#000000" face="helvetica, arial"><a name="Room">class <strong>Room</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr> <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> <td colspan=2><tt><a href="#Room-__init__">__init__</a>(self, uid_or_string_key)<br> <br> Creates a new Python reference to a room, by uid. If a string database<br> key is instead supplied, first try to generate a room by an rporoto of<br> the same name. If no rproto exists, create a new blank room in the room<br> table, and assign it the given key.<br> </tt></td></tr> <tr><td> </td> <td width="100%">Methods defined here:<br> <dl><dt><a name="Room-__cmp__"><strong>__cmp__</strong></a>(...)</dt><dd><tt>x.<a href="#Room-__cmp__">__cmp__</a>(y) <==> cmp(x,y)</tt></dd></dl> <dl><dt><a name="Room-__hash__"><strong>__hash__</strong></a>(...)</dt><dd><tt>x.<a href="#Room-__hash__">__hash__</a>() <==> hash(x)</tt></dd></dl> <dl><dt><a name="Room-__init__"><strong>__init__</strong></a>(...)</dt><dd><tt>x.<a href="#Room-__init__">__init__</a>(...) initializes x; see x.__class__.__doc__ for signature</tt></dd></dl> <dl><dt><a name="Room-add_cmd"><strong>add_cmd</strong></a>(...)</dt><dd><tt><a href="#Room-add_cmd">add_cmd</a>(name, shorthand, cmd_func, user_group, interrupts = False)<br> <br> Add a new player command specific to the room. See mudsys.add_cmd for<br> documentation on commands.</tt></dd></dl> <dl><dt><a name="Room-add_cmd_check"><strong>add_cmd_check</strong></a>(...)</dt><dd><tt><a href="#Room-add_cmd_check">add_cmd_check</a>(cmd_name, check_func)<br> <br> Add a new command check function specific to the room. See <br> mudsys.add_cmd_check for documentation on command checks.</tt></dd></dl> <dl><dt><a name="Room-attach"><strong>attach</strong></a>(...)</dt><dd><tt><a href="#Room-attach">attach</a>(trigger)<br> <br> Attach a trigger to the room by key name.</tt></dd></dl> <dl><dt><a name="Room-aux"><strong>aux</strong></a>(...)</dt><dd><tt>Alias for room.<a href="#Room">Room</a>.<a href="#Room-getAuxiliary">getAuxiliary</a>(name)</tt></dd></dl> <dl><dt><a name="Room-deletevar"><strong>deletevar</strong></a>(...)</dt><dd><tt><a href="#Room-deletevar">deletevar</a>(name)<br> <br> Deletes a special variable from a room if they have one by the<br> given name.</tt></dd></dl> <dl><dt><a name="Room-delvar"><strong>delvar</strong></a>(...)</dt><dd><tt>Alias for room.<a href="#Room">Room</a>.<a href="#Room-deletevar">deletevar</a>(name)</tt></dd></dl> <dl><dt><a name="Room-detach"><strong>detach</strong></a>(...)</dt><dd><tt><a href="#Room-detach">detach</a>(trigger)<br> <br> Detach a trigger from the room by key name.</tt></dd></dl> <dl><dt><a name="Room-dig"><strong>dig</strong></a>(...)</dt><dd><tt><a href="#Room-dig">dig</a>(dir, dest)<br> <br> Link the room to another room via the specified direction. The<br> destination room can be an actual room or a room key name. Returns<br> the created exit. If an exit already exists in the specified<br> direction, change its destination.</tt></dd></dl> <dl><dt><a name="Room-do_trigs"><strong>do_trigs</strong></a>(...)</dt><dd><tt><a href="#Room-do_trigs">do_trigs</a>(type, ch=None, obj=None, room=None, exit=None, cmd=None,<br> arg=None, opts=None)<br> <br> Run triggers of the specified type on the room. By default, the<br> trigger owner is 'me'. Other variables can be specified. The opts<br> variable can be a dictionary that maps optional variable names to their<br> values.</tt></dd></dl> <dl><dt><a name="Room-edesc"><strong>edesc</strong></a>(...)</dt><dd><tt><a href="#Room-edesc">edesc</a>(keywords, desc)<br> <br> Create an extra description for the room, accessible via a comma-<br> separated list of keywords.</tt></dd></dl> <dl><dt><a name="Room-exdir"><strong>exdir</strong></a>(...)</dt><dd><tt><a href="#Room-exdir">exdir</a>(exit)<br> <br> Returns the direction for a specified exit, or None.</tt></dd></dl> <dl><dt><a name="Room-exit"><strong>exit</strong></a>(...)</dt><dd><tt><a href="#Room-exit">exit</a>(dir)<br> <br> Returns an exit for the specified direction, or None.</tt></dd></dl> <dl><dt><a name="Room-fill"><strong>fill</strong></a>(...)</dt><dd><tt><a href="#Room-fill">fill</a>(dir)<br> <br> Erases an exit in the specified direction.</tt></dd></dl> <dl><dt><a name="Room-getAuxiliary"><strong>getAuxiliary</strong></a>(...)</dt><dd><tt><a href="#Room-getAuxiliary">getAuxiliary</a>(name)<br> <br> Returns room's auxiliary data of the specified name.</tt></dd></dl> <dl><dt><a name="Room-getvar"><strong>getvar</strong></a>(...)</dt><dd><tt><a href="#Room-getvar">getvar</a>(name)<br> <br> Return value of a special variable. Return 0 if no value has been set.</tt></dd></dl> <dl><dt><a name="Room-hasBit"><strong>hasBit</strong></a>(...)</dt><dd><tt><a href="#Room-hasBit">hasBit</a>(name)<br> <br> Return whether room has a bit toggled.</tt></dd></dl> <dl><dt><a name="Room-hasvar"><strong>hasvar</strong></a>(...)</dt><dd><tt><a href="#Room-hasvar">hasvar</a>(name)<br> <br> Return True if a room has the given special variable. False otherwise.</tt></dd></dl> <dl><dt><a name="Room-isinstance"><strong>isinstance</strong></a>(...)</dt><dd><tt><a href="#Room-isinstance">isinstance</a>(prototype)<br> <br> returns whether the room inherits from a specified room prototype.</tt></dd></dl> <dl><dt><a name="Room-reset"><strong>reset</strong></a>(...)</dt><dd><tt><a href="#Room-reset">reset</a>()<br> <br> Runs a room's reset commands and reset hooks.</tt></dd></dl> <dl><dt><a name="Room-send"><strong>send</strong></a>(...)</dt><dd><tt><a href="#Room-send">send</a>(mssg)<br> <br> Send a message to all characters in the room.</tt></dd></dl> <dl><dt><a name="Room-setvar"><strong>setvar</strong></a>(...)</dt><dd><tt><a href="#Room-setvar">setvar</a>(name, val)<br> <br> Set value of a special variable for the room. Values must be strings <br> or numbers. This function is intended to allow scripts and triggers toopen-endedly add variables to rooms.</tt></dd></dl> <hr> Data and other attributes defined here:<br> <dl><dt><strong>__new__</strong> = <built-in method __new__ of type object><dd><tt>T.<a href="#Room-__new__">__new__</a>(S, ...) -> a new <a href="__builtin__.html#object">object</a> with type S, a subtype of T</tt></dl> <dl><dt><strong>bits</strong> = <attribute 'bits' of 'room.Room' objects><dd><tt>A comma-separated list of setting bits currently toggled on the room.</tt></dl> <dl><dt><strong>chars</strong> = <attribute 'chars' of 'room.Room' objects><dd><tt>A list of all characters in the room. Immutable. See char.Char.room<br> for changing the room a character is in.</tt></dl> <dl><dt><strong>contents</strong> = <attribute 'contents' of 'room.Room' objects><dd><tt>A list of objects in the room. Immutable. See obj.Obj.room for<br> changing the room an <a href="__builtin__.html#object">object</a> is in.</tt></dl> <dl><dt><strong>desc</strong> = <attribute 'desc' of 'room.Room' objects><dd><tt>The room's description when, e.g., looked at.</tt></dl> <dl><dt><strong>exnames</strong> = <attribute 'exnames' of 'room.Room' objects><dd><tt>A list of the room's exits, by direction. Immutable. See room.<a href="#Room">Room</a>.dig<br> for creating new links between rooms.</tt></dl> <dl><dt><strong>locale</strong> = <attribute 'locale' of 'room.Room' objects><dd><tt>The zone a room belongs to. Immutable.</tt></dl> <dl><dt><strong>name</strong> = <attribute 'name' of 'room.Room' objects><dd><tt>The room's name, e.g., Town Square.</tt></dl> <dl><dt><strong>objs</strong> = <attribute 'objs' of 'room.Room' objects><dd><tt>Alias for room.<a href="#Room">Room</a>.contents</tt></dl> <dl><dt><strong>proto</strong> = <attribute 'proto' of 'room.Room' objects><dd><tt>The room's unique identifier key. For non-instanced rooms, equivalent<br> to the main room prototype inherited from. Immutable.</tt></dl> <dl><dt><strong>protoname</strong> = <attribute 'protoname' of 'room.Room' objects><dd><tt>The first half of the room's unique identifier key. Immutable.</tt></dl> <dl><dt><strong>protos</strong> = <attribute 'protos' of 'room.Room' objects><dd><tt>A comma-separated list of room prototypes this room inherits from. Immutable.</tt></dl> <dl><dt><strong>terrain</strong> = <attribute 'terrain' of 'room.Room' objects><dd><tt>The current terrain type of the room.</tt></dl> <dl><dt><strong>uid</strong> = <attribute 'uid' of 'room.Room' objects><dd><tt>The room's unique identification number. Immutable.</tt></dl> </td></tr></table></td></tr></table><p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#eeaa77"> <td colspan=3 valign=bottom> <br> <font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr> <tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td> <td width="100%"><dl><dt><a name="-get_room"><strong>get_room</strong></a>(...)</dt><dd><tt><a href="#-get_room">get_room</a>(key)<br> <br> Takes a room key/locale and returns the matching room, or None.</tt></dd></dl> <dl><dt><a name="-instance"><strong>instance</strong></a>(...)</dt><dd><tt><a href="#-instance">instance</a>(room_proto, as_key = None)<br> <br> Create an instanced copy of a room, specified by a room prototype name.<br> If as_key is None, the instanced room's key will be a derivation of<br> the original prototype name, with a uid number appended to it. Otherwise<br> as_key is used for the room's key.</tt></dd></dl> <dl><dt><a name="-is_abstract"><strong>is_abstract</strong></a>(...)</dt><dd><tt><a href="#-is_abstract">is_abstract</a>(proto)<br> <br> Returns whether a specified room prototype is abstract. Also return True<br> if the prototype does not exist.</tt></dd></dl> <dl><dt><a name="-is_loaded"><strong>is_loaded</strong></a>(...)</dt><dd><tt><a href="#-is_loaded">is_loaded</a>(key)<br> <br> Returns whether a room with the given key currently exists in game.</tt></dd></dl> </td></tr></table> </body></html>