<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><head><title>Python: obj</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>obj</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 game objects. Also contains utilities<br> for listing, storing, and generating objects from prototypes.</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="obj.html#Obj">Obj</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="Obj">class <strong>Obj</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="#Obj">Obj</a>/<a href="#Obj">Obj</a> objects<br> </tt></td></tr> <tr><td> </td> <td width="100%">Methods defined here:<br> <dl><dt><a name="Obj-__cmp__"><strong>__cmp__</strong></a>(...)</dt><dd><tt>x.<a href="#Obj-__cmp__">__cmp__</a>(y) <==> cmp(x,y)</tt></dd></dl> <dl><dt><a name="Obj-__init__"><strong>__init__</strong></a>(...)</dt><dd><tt>x.<a href="#Obj-__init__">__init__</a>(...) initializes x; see x.__class__.__doc__ for signature</tt></dd></dl> <dl><dt><a name="Obj-attach"><strong>attach</strong></a>(...)</dt><dd><tt><a href="#Obj-attach">attach</a>(trigger)<br> <br> Attach a trigger to the <a href="__builtin__.html#object">object</a> by key name.</tt></dd></dl> <dl><dt><a name="Obj-aux"><strong>aux</strong></a>(...)</dt><dd><tt>Alias for obj.<a href="#Obj">Obj</a>.<a href="#Obj-getAuxiliary">getAuxiliary</a>(name)</tt></dd></dl> <dl><dt><a name="Obj-copy"><strong>copy</strong></a>(...)</dt><dd><tt><a href="#Obj-copy">copy</a>()<br> <br> Returns a copy of the <a href="__builtin__.html#object">object</a>.</tt></dd></dl> <dl><dt><a name="Obj-deletevar"><strong>deletevar</strong></a>(...)</dt><dd><tt><a href="#Obj-deletevar">deletevar</a>(name)<br> <br> Deletes a special variable from an <a href="__builtin__.html#object">object</a> if they have one by the<br> given name.</tt></dd></dl> <dl><dt><a name="Obj-delvar"><strong>delvar</strong></a>(...)</dt><dd><tt>Alias for obj.<a href="#Obj">Obj</a>.<a href="#Obj-deletevar">deletevar</a>(name)</tt></dd></dl> <dl><dt><a name="Obj-detach"><strong>detach</strong></a>(...)</dt><dd><tt><a href="#Obj-detach">detach</a>(trigger)<br> <br> Detach a trigger from the <a href="__builtin__.html#object">object</a> by key name.</tt></dd></dl> <dl><dt><a name="Obj-do_trigs"><strong>do_trigs</strong></a>(...)</dt><dd><tt><a href="#Obj-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 <a href="__builtin__.html#object">object</a>. 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="Obj-edesc"><strong>edesc</strong></a>(...)</dt><dd><tt><a href="#Obj-edesc">edesc</a>(keywords, desc)<br> <br> Create an extra description for the <a href="__builtin__.html#object">object</a>, accessible via a comma-<br> separated list of keywords.</tt></dd></dl> <dl><dt><a name="Obj-fromall"><strong>fromall</strong></a>(...)</dt><dd><tt><a href="#Obj-fromall">fromall</a>()<br> <br> Remove <a href="__builtin__.html#object">object</a> from whichever room, character, or container it is in.</tt></dd></dl> <dl><dt><a name="Obj-getAuxiliary"><strong>getAuxiliary</strong></a>(...)</dt><dd><tt><a href="#Obj-getAuxiliary">getAuxiliary</a>(name)<br> <br> Returns <a href="__builtin__.html#object">object</a>'s auxiliary data of the specified name.</tt></dd></dl> <dl><dt><a name="Obj-get_type_data"><strong>get_type_data</strong></a>(...)</dt><dd><tt><a href="#Obj-get_type_data">get_type_data</a>(item_type)<br> <br> Returns Python item type data if it exists, or None.</tt></dd></dl> <dl><dt><a name="Obj-get_types"><strong>get_types</strong></a>(...)</dt><dd><tt><a href="#Obj-get_types">get_types</a>()<br> <br> Returns a comma-separated list of item types this <a href="__builtin__.html#object">object</a> has.</tt></dd></dl> <dl><dt><a name="Obj-getvar"><strong>getvar</strong></a>(...)</dt><dd><tt><a href="#Obj-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="Obj-hasvar"><strong>hasvar</strong></a>(...)</dt><dd><tt><a href="#Obj-hasvar">hasvar</a>(name)<br> <br> Return True if <a href="__builtin__.html#object">object</a> has the given special variable. False otherwise.</tt></dd></dl> <dl><dt><a name="Obj-isinstance"><strong>isinstance</strong></a>(...)</dt><dd><tt><a href="#Obj-isinstance">isinstance</a>(prototype)<br> <br> returns whether the <a href="__builtin__.html#object">object</a> inherits from a specified obj prototype.</tt></dd></dl> <dl><dt><a name="Obj-istype"><strong>istype</strong></a>(...)</dt><dd><tt><a href="#Obj-istype">istype</a>(item_type)<br> <br> Returns True or False if the <a href="__builtin__.html#object">object</a> is of the specified item type.</tt></dd></dl> <dl><dt><a name="Obj-settype"><strong>settype</strong></a>(...)</dt><dd><tt><a href="#Obj-settype">settype</a>(item_type)<br> <br> Make an <a href="__builtin__.html#object">object</a> be the specified item type.</tt></dd></dl> <dl><dt><a name="Obj-setvar"><strong>setvar</strong></a>(...)</dt><dd><tt><a href="#Obj-setvar">setvar</a>(name, val)<br> <br> Set value of a special variable for the <a href="__builtin__.html#object">object</a>. Values must be strings<br> or numbers. This function is intended to allow scripts and triggers toopen-endedly add variables to objects.</tt></dd></dl> <dl><dt><a name="Obj-store"><strong>store</strong></a>(...)</dt><dd><tt><a href="#Obj-store">store</a>()<br> <br> Return a storage set representing the <a href="__builtin__.html#object">object</a>.</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="#Obj-__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>age</strong> = <attribute 'age' of 'obj.Obj' objects><dd><tt>Value is the difference between the <a href="__builtin__.html#object">object</a>'s creation time and the<br> current system time. Immutable.</tt></dl> <dl><dt><strong>birth</strong> = <attribute 'birth' of 'obj.Obj' objects><dd><tt>Value is the <a href="__builtin__.html#object">object</a>'s creation time (system time). Immutable.</tt></dl> <dl><dt><strong>bits</strong> = <attribute 'bits' of 'obj.Obj' objects><dd><tt>A comma-separated list of bits currently toggled for this <a href="__builtin__.html#object">object</a>.</tt></dl> <dl><dt><strong>carrier</strong> = <attribute 'carrier' of 'obj.Obj' objects><dd><tt>The character whose inventory this <a href="__builtin__.html#object">object</a> is currently in, or None.</tt></dl> <dl><dt><strong>chars</strong> = <attribute 'chars' of 'obj.Obj' objects><dd><tt>A list of characters currently sitting/riding this <a href="__builtin__.html#object">object</a>. Immutable.<br> See char.Char.furniture for changing a character's furniture.</tt></dl> <dl><dt><strong>container</strong> = <attribute 'container' of 'obj.Obj' objects><dd><tt>The container this <a href="__builtin__.html#object">object</a> is currently in, or None.</tt></dl> <dl><dt><strong>container_capacity</strong> = <attribute 'container_capacity' of 'obj.Obj' objects><dd><tt>The maximum amount of weight c container can hold.</tt></dl> <dl><dt><strong>container_is_closable</strong> = <attribute 'container_is_closable' of 'obj.Obj' objects><dd><tt>True or False if the container can be closed.</tt></dl> <dl><dt><strong>container_is_closed</strong> = <attribute 'container_is_closed' of 'obj.Obj' objects><dd><tt>True or False if the container is closed.</tt></dl> <dl><dt><strong>container_is_locked</strong> = <attribute 'container_is_locked' of 'obj.Obj' objects><dd><tt>True or False if the container is locked.</tt></dl> <dl><dt><strong>container_key</strong> = <attribute 'container_key' of 'obj.Obj' objects><dd><tt>An <a href="__builtin__.html#object">object</a> prototype that acts as a key for this container.</tt></dl> <dl><dt><strong>container_pick_diff</strong> = <attribute 'container_pick_diff' of 'obj.Obj' objects><dd><tt>An integer representing how difficult a container's lock is to pick.</tt></dl> <dl><dt><strong>contents</strong> = <attribute 'contents' of 'obj.Obj' objects><dd><tt>A list of other objects contained within this one. Immutable.<br> See obj.<a href="#Obj">Obj</a>.container for changing an <a href="__builtin__.html#object">object</a>'s container.</tt></dl> <dl><dt><strong>desc</strong> = <attribute 'desc' of 'obj.Obj' objects><dd><tt>An <a href="__builtin__.html#object">object</a>'s verbose description e.g., for when it is looked at.</tt></dl> <dl><dt><strong>furniture_capacity</strong> = <attribute 'furniture_capacity' of 'obj.Obj' objects><dd><tt>The number of characters a furniture <a href="__builtin__.html#object">object</a> can accomodate.</tt></dl> <dl><dt><strong>furniture_type</strong> = <attribute 'furniture_type' of 'obj.Obj' objects><dd><tt>The type of furniture this is: 'at' or 'on' like e.g., tables vs. couches.</tt></dl> <dl><dt><strong>hidden</strong> = <attribute 'hidden' of 'obj.Obj' objects><dd><tt>Integer value representing how hard this <a href="__builtin__.html#object">object</a> is to see.</tt></dl> <dl><dt><strong>keywords</strong> = <attribute 'keywords' of 'obj.Obj' objects><dd><tt>A comma-separated list of keywords for referencing the <a href="__builtin__.html#object">object</a>.</tt></dl> <dl><dt><strong>mdesc</strong> = <attribute 'mdesc' of 'obj.Obj' objects><dd><tt>the equivalent of mname, for room descriptions.</tt></dl> <dl><dt><strong>mname</strong> = <attribute 'mname' of 'obj.Obj' objects><dd><tt>The <a href="__builtin__.html#object">object</a>'s name for describing packs, e.g.,<br> a stack of 12 linen towels. The number should be replaced by %d, or<br> not included.</tt></dl> <dl><dt><strong>name</strong> = <attribute 'name' of 'obj.Obj' objects><dd><tt>The <a href="__builtin__.html#object">object</a>'s name e.g., a longsword</tt></dl> <dl><dt><strong>objs</strong> = <attribute 'objs' of 'obj.Obj' objects><dd><tt>Alias for obj.<a href="#Obj">Obj</a>.contents</tt></dl> <dl><dt><strong>portal_dest</strong> = <attribute 'portal_dest' of 'obj.Obj' objects><dd><tt>A string key specifying the destination of the portal. Can be set by<br> a string or the actual room.</tt></dl> <dl><dt><strong>portal_enter_mssg</strong> = <attribute 'portal_enter_mssg' of 'obj.Obj' objects><dd><tt>The message shown to the desination room when a character enters portal.</tt></dl> <dl><dt><strong>portal_leave_mssg</strong> = <attribute 'portal_leave_mssg' of 'obj.Obj' objects><dd><tt>The message shown to a room after a character leaves it via a portal.</tt></dl> <dl><dt><strong>prototypes</strong> = <attribute 'prototypes' of 'obj.Obj' objects><dd><tt>A comma-separated list of prototypes this <a href="__builtin__.html#object">object</a> inherits from. Immutable</tt></dl> <dl><dt><strong>rdesc</strong> = <attribute 'rdesc' of 'obj.Obj' objects><dd><tt>The <a href="__builtin__.html#object">object</a>'s description when seen in a room, e.g.,<br> a longsword is here, gleaming in the sun.</tt></dl> <dl><dt><strong>room</strong> = <attribute 'room' of 'obj.Obj' objects><dd><tt>The room this <a href="__builtin__.html#object">object</a> is current in, or None.</tt></dl> <dl><dt><strong>uid</strong> = <attribute 'uid' of 'obj.Obj' objects><dd><tt>The <a href="__builtin__.html#object">object</a>'s unique identification number. Immutable.</tt></dl> <dl><dt><strong>wearer</strong> = <attribute 'wearer' of 'obj.Obj' objects><dd><tt>The character who is currently wearing this <a href="__builtin__.html#object">object</a>, or None.</tt></dl> <dl><dt><strong>weight</strong> = <attribute 'weight' of 'obj.Obj' objects><dd><tt>The <a href="__builtin__.html#object">object</a>'s weight (plus contents). When setting a new value, <br> sets raw weight (minus contents).</tt></dl> <dl><dt><strong>weight_raw</strong> = <attribute 'weight_raw' of 'obj.Obj' objects><dd><tt>The <a href="__builtin__.html#object">object</a>'s weight (minus contents)</tt></dl> <dl><dt><strong>worn_locs</strong> = <attribute 'worn_locs' of 'obj.Obj' objects><dd><tt>The position names this worn type must be equipped to. Immutable.</tt></dl> <dl><dt><strong>worn_type</strong> = <attribute 'worn_type' of 'obj.Obj' objects><dd><tt>The type of worn item this is.</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="-count_objs"><strong>count_objs</strong></a>(...)</dt><dd><tt><a href="#-count_objs">count_objs</a>(keyword, loc = None)<br> <br> count how many occurences of an <a href="__builtin__.html#object">object</a> with the specified keyword, uid,<br> or prototype exist at a location. If loc is None, search the entire mud.<br> Loc can be a room, character, or container <a href="__builtin__.html#object">object</a>.</tt></dd></dl> <dl><dt><a name="-find_obj"><strong>find_obj</strong></a>(...)</dt><dd><tt>function has been deprecated. Entrypoint for generic_find().<br> Use mud.parse_args instead.</tt></dd></dl> <dl><dt><a name="-find_obj_key"><strong>find_obj_key</strong></a>(...)</dt><dd><tt>function has been deprecated. Entrypoint for generic_find().<br> Use mud.parse_args instead.</tt></dd></dl> <dl><dt><a name="-load_obj"><strong>load_obj</strong></a>(...)</dt><dd><tt><a href="#-load_obj">load_obj</a>(prototype, where=None, equip_to='')<br> <br> Generate a new <a href="__builtin__.html#object">object</a> from the specified prototype. Add it to where.<br> Where can be a room, character, or container. If where is a character,<br> add the <a href="__builtin__.html#object">object</a> to the character's inventory unless a comma-separated<br> list of bodypart name of positions is specified. Return the created <a href="__builtin__.html#object">object</a>.</tt></dd></dl> <dl><dt><a name="-obj_list"><strong>obj_list</strong></a>(...)</dt><dd><tt><a href="#-obj_list">obj_list</a>()<br> <br> Return a list containing every <a href="__builtin__.html#object">object</a> in the game.</tt></dd></dl> <dl><dt><a name="-read"><strong>read</strong></a>(...)</dt><dd><tt><a href="#-read">read</a>(storage_set)<br> <br> Read and return an <a href="__builtin__.html#object">object</a> from a storage set.</tt></dd></dl> </td></tr></table> </body></html>