123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170 |
- <!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
- <html><head><title>Python: cmd_comm</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>cmd_comm</strong></big></big></font></td
- ><td align=right valign=bottom
- ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/Users/hollis/Desktop/nakedmud/lib/pymodules/cmd_comm.py">/Users/hollis/Desktop/nakedmud/lib/pymodules/cmd_comm.py</a></font></td></tr></table>
- <p><tt>cmd_comm.c<br>
- <br>
- Various commands used in NakedMud(tm) for communicating with other<br>
- characters, and NPCs.</tt></p>
- <p>
- <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
- <tr bgcolor="#aa55cc">
- <td colspan=3 valign=bottom> <br>
- <font color="#fffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
-
- <tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
- <td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="history.html">history</a><br>
- <a href="hooks.html">hooks</a><br>
- </td><td width="25%" valign=top><a href="inform.html">inform</a><br>
- <a href="mud.html">mud</a><br>
- </td><td width="25%" valign=top><a href="mudsock.html">mudsock</a><br>
- <a href="mudsys.html">mudsys</a><br>
- </td><td width="25%" valign=top></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="-add_cmd"><strong>add_cmd</strong></a>(...)</dt><dd><tt><a href="#-add_cmd">add_cmd</a>(name, shorthand, cmd_func, user_group, interrupts_action)<br>
- <br>
- Add a new command to the master command table. If a preferred shorthand<br>
- exists, e.g., 'n' for 'north', it can be specified. Otherwise, shorthand<br>
- should be None. Command functions take three arguments: a character<br>
- issuing the command, the command name, and a string argument supplied<br>
- to the command. Commands must be tied to a specific user group, and they<br>
- can optionally interupt character actions.</tt></dd></dl>
- <dl><dt><a name="-add_cmd_check"><strong>add_cmd_check</strong></a>(...)</dt><dd><tt><a href="#-add_cmd_check">add_cmd_check</a>(name, check_func)<br>
- <br>
- Add a new command check to a registered command. Check functions take<br>
- two arguments: the character issuing the command, and the command name.<br>
- If a check fails, it should return False and send the character a<br>
- message why.</tt></dd></dl>
- <dl><dt><a name="-chk_room_communication"><strong>chk_room_communication</strong></a>(ch, cmd)</dt></dl>
- <dl><dt><a name="-cmd_ask"><strong>cmd_ask</strong></a>(ch, cmd, arg)</dt><dd><tt>Usage: ask <person> [about] <question><br>
- <br>
- This command is used to pose a question to another character. Mostly,<br>
- this is intended to be used to carry on dialogs with NPCs. Ask has a<br>
- local range (i.e. you can only ask questions to people in the same room<br>
- as you.</tt></dd></dl>
- <dl><dt><a name="-cmd_chat"><strong>cmd_chat</strong></a>(ch, cmd, arg)</dt><dd><tt>Usage: chat <message><br>
- <br>
- This command will send a message to all players currently logged on.</tt></dd></dl>
- <dl><dt><a name="-cmd_emote"><strong>cmd_emote</strong></a>(ch, cmd, arg)</dt><dd><tt>Usage: emote <text><br>
- <br>
- Send a special text message to the room you are in. The message is<br>
- preceded by your name, unless you put a $n somewhere in the text, in<br>
- which case the $n is replaced by your name. For example:<br>
- <br>
- > emote A gunshot sounds, and $n is laying on the ground, dead.<br>
- <br>
- Would show a message to everyone in the room saying that you are dead<br>
- to a gunshot.</tt></dd></dl>
- <dl><dt><a name="-cmd_gemote"><strong>cmd_gemote</strong></a>(ch, cmd, arg)</dt><dd><tt>Gemote is similar to emote, except that it sends a mud-wide message<br>
- instead of a room-specific message.</tt></dd></dl>
- <dl><dt><a name="-cmd_greet"><strong>cmd_greet</strong></a>(ch, cmd, arg)</dt><dd><tt>Usage: greet <person><br>
- <br>
- NPCs with dialogs will often have something to say when you greet or<br>
- approach then. Greeting an NPC is a way to get them talking.</tt></dd></dl>
- <dl><dt><a name="-cmd_page"><strong>cmd_page</strong></a>(ch, cmd, arg)</dt><dd><tt>Usage: page <person> <message><br>
- <br>
- Paging a person will send them a message, as well as making a beeping<br>
- sound on their computer to get their attention. Page can be used on<br>
- anyone in the mud, regardless if you are in the same room as them or not.</tt></dd></dl>
- <dl><dt><a name="-cmd_say"><strong>cmd_say</strong></a>(ch, cmd, arg)</dt><dd><tt>Usage: say <message><br>
- <br>
- This command will send a message to everyone in the same room as you. Say,<br>
- like ask, can trigger NPC dialogs.</tt></dd></dl>
- <dl><dt><a name="-cmd_tell"><strong>cmd_tell</strong></a>(ch, cmd, arg)</dt><dd><tt>Usage: tell <person> <message><br>
- <br>
- This command sends a message to another character. Primarily intended<br>
- for player-to-player communication. Players can tell other players<br>
- things even if they are not in the same room.<br>
- <br>
- see also: reply</tt></dd></dl>
- <dl><dt><a name="-cmd_wiz"><strong>cmd_wiz</strong></a>(ch, cmd, arg)</dt></dl>
- <dl><dt><a name="-erase_global"><strong>erase_global</strong></a>(...)</dt><dd><tt><a href="#-erase_global">erase_global</a>(name)<br>
- <br>
- Delete a value from the global variable table.</tt></dd></dl>
- <dl><dt><a name="-expand_text"><strong>expand_text</strong></a>(...)</dt><dd><tt><a href="#-expand_text">expand_text</a>(text, dict={}, newline=False)<br>
- <br>
- Take text with embedded Python statements. Statements can be embedded<br>
- between [ and ]. Expand them out and return the new text. Variables can<br>
- be added to the scripting environment by specifying their names and<br>
- values in an optional dictionary. Statements are expanded in the default<br>
- scripting environment.</tt></dd></dl>
- <dl><dt><a name="-extract"><strong>extract</strong></a>(...)</dt><dd><tt><a href="#-extract">extract</a>(thing)<br>
- <br>
- Extracts an object, character, or room from the game.</tt></dd></dl>
- <dl><dt><a name="-format_string"><strong>format_string</strong></a>(...)</dt><dd><tt><a href="#-format_string">format_string</a>(text, indent=True, width=80)<br>
- <br>
- Format a block of text to be of the specified width, possibly indenting<br>
- paragraphs.</tt></dd></dl>
- <dl><dt><a name="-generic_find"><strong>generic_find</strong></a>(...)</dt><dd><tt>Deprecated. Use mud.parse_args instead.</tt></dd></dl>
- <dl><dt><a name="-get_global"><strong>get_global</strong></a>(...)</dt><dd><tt><a href="#-get_global">get_global</a>(name)<br>
- <br>
- Return a non-persistent global variable, or None.</tt></dd></dl>
- <dl><dt><a name="-get_greeting"><strong>get_greeting</strong></a>(...)</dt><dd><tt><a href="#-get_greeting">get_greeting</a>()<br>
- <br>
- returns the mud's connection greeting.</tt></dd></dl>
- <dl><dt><a name="-get_hour"><strong>get_hour</strong></a>(...)</dt><dd><tt><a href="#-get_hour">get_hour</a>()<br>
- <br>
- Return the current in-game hour of day.</tt></dd></dl>
- <dl><dt><a name="-get_motd"><strong>get_motd</strong></a>(...)</dt><dd><tt><a href="#-get_motd">get_motd</a>()<br>
- <br>
- Returns the mud's message of the day.</tt></dd></dl>
- <dl><dt><a name="-get_time"><strong>get_time</strong></a>(...)</dt><dd><tt><a href="#-get_time">get_time</a>()<br>
- <br>
- Return time of day (morning, afternoon, evening, night).</tt></dd></dl>
- <dl><dt><a name="-is_afternoon"><strong>is_afternoon</strong></a>(...)</dt><dd><tt>True or False if it is afternoon.</tt></dd></dl>
- <dl><dt><a name="-is_evening"><strong>is_evening</strong></a>(...)</dt><dd><tt>True or False if it is evening.</tt></dd></dl>
- <dl><dt><a name="-is_morning"><strong>is_morning</strong></a>(...)</dt><dd><tt>True or False if it is morning.</tt></dd></dl>
- <dl><dt><a name="-is_night"><strong>is_night</strong></a>(...)</dt><dd><tt>True or False if it is night.</tt></dd></dl>
- <dl><dt><a name="-is_race"><strong>is_race</strong></a>(...)</dt><dd><tt><a href="#-is_race">is_race</a>(name)<br>
- <br>
- Returns True or False if the string is a valid race name.</tt></dd></dl>
- <dl><dt><a name="-ite"><strong>ite</strong></a>(...)</dt><dd><tt><a href="#-ite">ite</a>(logic_statement, if_statement, else_statement=None)<br>
- <br>
- A functional form of if/then/else.</tt></dd></dl>
- <dl><dt><a name="-keys_equal"><strong>keys_equal</strong></a>(...)</dt><dd><tt><a href="#-keys_equal">keys_equal</a>(key1, key2)<br>
- <br>
- Returns whether two world database keys are equal, relative to the<br>
- locale (if any) that the current script is running in.</tt></dd></dl>
- <dl><dt><a name="-list_races"><strong>list_races</strong></a>(...)</dt><dd><tt><a href="#-list_races">list_races</a>(player_only=False)<br>
- <br>
- Return a list of available races. If player_only is True, list only the<br>
- races that players have access to.</tt></dd></dl>
- <dl><dt><a name="-log_string"><strong>log_string</strong></a>(...)</dt><dd><tt><a href="#-log_string">log_string</a>(mssg)<br>
- Send a message to the mud's log.</tt></dd></dl>
- <dl><dt><a name="-message"><strong>message</strong></a>(...)</dt><dd><tt><a href="#-message">message</a>(ch, vict, obj, vobj, show_invis, range, mssg)<br>
- <br>
- Send a message via the mud messaging system using $ expansions. Range<br>
- can be 'to_room', 'to_char', 'to_vict', or 'to_world'.</tt></dd></dl>
- <dl><dt><a name="-parse_args"><strong>parse_args</strong></a>(...)</dt><dd><tt><a href="#-parse_args">parse_args</a>(ch, show_usage_errors, cmd, args, format)<br>
- <br>
- equivalent to parse_args written in C. See parse.h for information.</tt></dd></dl>
- <dl><dt><a name="-send"><strong>send</strong></a>(...)</dt><dd><tt><a href="#-send">send</a>(list, mssg, dict = None, newline = True)<br>
- <br>
- Sends a message to a list of characters. Messages can have scripts<br>
- embedded in them, using [ and ]. If so, a variable dictionary must be<br>
- provided. By default, 'ch' references each character being sent the<br>
- message, for embedded scripts.</tt></dd></dl>
- <dl><dt><a name="-set_global"><strong>set_global</strong></a>(...)</dt><dd><tt><a href="#-set_global">set_global</a>(name, val)<br>
- <br>
- Sets a non-persistent global variable. Val can be any type.</tt></dd></dl>
- </td></tr></table><p>
- <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
- <tr bgcolor="#55aa55">
- <td colspan=3 valign=bottom> <br>
- <font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
-
- <tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td>
- <td width="100%"><strong>cmd</strong> = ':'</td></tr></table>
- </body></html>
|