mud.html 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <html><head><title>Python: mud</title>
  3. </head><body bgcolor="#f0f0f8">
  4. <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
  5. <tr bgcolor="#7799ee">
  6. <td valign=bottom>&nbsp;<br>
  7. <font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>mud</strong></big></big></font></td
  8. ><td align=right valign=bottom
  9. ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br>(built-in)</font></td></tr></table>
  10. <p><tt>The&nbsp;mud&nbsp;module,&nbsp;for&nbsp;all&nbsp;MUD&nbsp;misc&nbsp;mud&nbsp;utils.</tt></p>
  11. <p>
  12. <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
  13. <tr bgcolor="#eeaa77">
  14. <td colspan=3 valign=bottom>&nbsp;<br>
  15. <font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
  16. <tr><td bgcolor="#eeaa77"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
  17. <td width="100%"><dl><dt><a name="-erase_global"><strong>erase_global</strong></a>(...)</dt><dd><tt><a href="#-erase_global">erase_global</a>(name)<br>
  18. &nbsp;<br>
  19. Delete&nbsp;a&nbsp;value&nbsp;from&nbsp;the&nbsp;global&nbsp;variable&nbsp;table.</tt></dd></dl>
  20. <dl><dt><a name="-expand_text"><strong>expand_text</strong></a>(...)</dt><dd><tt><a href="#-expand_text">expand_text</a>(text,&nbsp;dict={},&nbsp;newline=False)<br>
  21. &nbsp;<br>
  22. Take&nbsp;text&nbsp;with&nbsp;embedded&nbsp;Python&nbsp;statements.&nbsp;Statements&nbsp;can&nbsp;be&nbsp;embedded<br>
  23. between&nbsp;[&nbsp;and&nbsp;].&nbsp;Expand&nbsp;them&nbsp;out&nbsp;and&nbsp;return&nbsp;the&nbsp;new&nbsp;text.&nbsp;Variables&nbsp;can<br>
  24. be&nbsp;added&nbsp;to&nbsp;the&nbsp;scripting&nbsp;environment&nbsp;by&nbsp;specifying&nbsp;their&nbsp;names&nbsp;and<br>
  25. values&nbsp;in&nbsp;an&nbsp;optional&nbsp;dictionary.&nbsp;Statements&nbsp;are&nbsp;expanded&nbsp;in&nbsp;the&nbsp;default<br>
  26. scripting&nbsp;environment.</tt></dd></dl>
  27. <dl><dt><a name="-extract"><strong>extract</strong></a>(...)</dt><dd><tt><a href="#-extract">extract</a>(thing)<br>
  28. &nbsp;<br>
  29. Extracts&nbsp;an&nbsp;object,&nbsp;character,&nbsp;or&nbsp;room&nbsp;from&nbsp;the&nbsp;game.</tt></dd></dl>
  30. <dl><dt><a name="-format_string"><strong>format_string</strong></a>(...)</dt><dd><tt><a href="#-format_string">format_string</a>(text,&nbsp;indent=True,&nbsp;width=80)<br>
  31. &nbsp;<br>
  32. Format&nbsp;a&nbsp;block&nbsp;of&nbsp;text&nbsp;to&nbsp;be&nbsp;of&nbsp;the&nbsp;specified&nbsp;width,&nbsp;possibly&nbsp;indenting<br>
  33. paragraphs.</tt></dd></dl>
  34. <dl><dt><a name="-generic_find"><strong>generic_find</strong></a>(...)</dt><dd><tt>Deprecated.&nbsp;Use&nbsp;mud.parse_args&nbsp;instead.</tt></dd></dl>
  35. <dl><dt><a name="-get_global"><strong>get_global</strong></a>(...)</dt><dd><tt><a href="#-get_global">get_global</a>(name)<br>
  36. &nbsp;<br>
  37. Return&nbsp;a&nbsp;non-persistent&nbsp;global&nbsp;variable,&nbsp;or&nbsp;None.</tt></dd></dl>
  38. <dl><dt><a name="-get_greeting"><strong>get_greeting</strong></a>(...)</dt><dd><tt><a href="#-get_greeting">get_greeting</a>()<br>
  39. &nbsp;<br>
  40. returns&nbsp;the&nbsp;mud's&nbsp;connection&nbsp;greeting.</tt></dd></dl>
  41. <dl><dt><a name="-get_hour"><strong>get_hour</strong></a>(...)</dt><dd><tt><a href="#-get_hour">get_hour</a>()<br>
  42. &nbsp;<br>
  43. Return&nbsp;the&nbsp;current&nbsp;in-game&nbsp;hour&nbsp;of&nbsp;day.</tt></dd></dl>
  44. <dl><dt><a name="-get_motd"><strong>get_motd</strong></a>(...)</dt><dd><tt><a href="#-get_motd">get_motd</a>()<br>
  45. &nbsp;<br>
  46. Returns&nbsp;the&nbsp;mud's&nbsp;message&nbsp;of&nbsp;the&nbsp;day.</tt></dd></dl>
  47. <dl><dt><a name="-get_time"><strong>get_time</strong></a>(...)</dt><dd><tt><a href="#-get_time">get_time</a>()<br>
  48. &nbsp;<br>
  49. Return&nbsp;time&nbsp;of&nbsp;day&nbsp;(morning,&nbsp;afternoon,&nbsp;evening,&nbsp;night).</tt></dd></dl>
  50. <dl><dt><a name="-is_afternoon"><strong>is_afternoon</strong></a>(...)</dt><dd><tt>True&nbsp;or&nbsp;False&nbsp;if&nbsp;it&nbsp;is&nbsp;afternoon.</tt></dd></dl>
  51. <dl><dt><a name="-is_evening"><strong>is_evening</strong></a>(...)</dt><dd><tt>True&nbsp;or&nbsp;False&nbsp;if&nbsp;it&nbsp;is&nbsp;evening.</tt></dd></dl>
  52. <dl><dt><a name="-is_morning"><strong>is_morning</strong></a>(...)</dt><dd><tt>True&nbsp;or&nbsp;False&nbsp;if&nbsp;it&nbsp;is&nbsp;morning.</tt></dd></dl>
  53. <dl><dt><a name="-is_night"><strong>is_night</strong></a>(...)</dt><dd><tt>True&nbsp;or&nbsp;False&nbsp;if&nbsp;it&nbsp;is&nbsp;night.</tt></dd></dl>
  54. <dl><dt><a name="-is_race"><strong>is_race</strong></a>(...)</dt><dd><tt><a href="#-is_race">is_race</a>(name)<br>
  55. &nbsp;<br>
  56. Returns&nbsp;True&nbsp;or&nbsp;False&nbsp;if&nbsp;the&nbsp;string&nbsp;is&nbsp;a&nbsp;valid&nbsp;race&nbsp;name.</tt></dd></dl>
  57. <dl><dt><a name="-ite"><strong>ite</strong></a>(...)</dt><dd><tt><a href="#-ite">ite</a>(logic_statement,&nbsp;if_statement,&nbsp;else_statement=None)<br>
  58. &nbsp;<br>
  59. A&nbsp;functional&nbsp;form&nbsp;of&nbsp;if/then/else.</tt></dd></dl>
  60. <dl><dt><a name="-keys_equal"><strong>keys_equal</strong></a>(...)</dt><dd><tt><a href="#-keys_equal">keys_equal</a>(key1,&nbsp;key2)<br>
  61. &nbsp;<br>
  62. Returns&nbsp;whether&nbsp;two&nbsp;world&nbsp;database&nbsp;keys&nbsp;are&nbsp;equal,&nbsp;relative&nbsp;to&nbsp;the<br>
  63. locale&nbsp;(if&nbsp;any)&nbsp;that&nbsp;the&nbsp;current&nbsp;script&nbsp;is&nbsp;running&nbsp;in.</tt></dd></dl>
  64. <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>
  65. &nbsp;<br>
  66. Return&nbsp;a&nbsp;list&nbsp;of&nbsp;available&nbsp;races.&nbsp;If&nbsp;player_only&nbsp;is&nbsp;True,&nbsp;list&nbsp;only&nbsp;the<br>
  67. races&nbsp;that&nbsp;players&nbsp;have&nbsp;access&nbsp;to.</tt></dd></dl>
  68. <dl><dt><a name="-log_string"><strong>log_string</strong></a>(...)</dt><dd><tt><a href="#-log_string">log_string</a>(mssg)<br>
  69. Send&nbsp;a&nbsp;message&nbsp;to&nbsp;the&nbsp;mud's&nbsp;log.</tt></dd></dl>
  70. <dl><dt><a name="-message"><strong>message</strong></a>(...)</dt><dd><tt><a href="#-message">message</a>(ch,&nbsp;vict,&nbsp;obj,&nbsp;vobj,&nbsp;show_invis,&nbsp;range,&nbsp;mssg)<br>
  71. &nbsp;<br>
  72. Send&nbsp;a&nbsp;message&nbsp;via&nbsp;the&nbsp;mud&nbsp;messaging&nbsp;system&nbsp;using&nbsp;$&nbsp;expansions.&nbsp;Range<br>
  73. can&nbsp;be&nbsp;'to_room',&nbsp;'to_char',&nbsp;'to_vict',&nbsp;or&nbsp;'to_world'.</tt></dd></dl>
  74. <dl><dt><a name="-parse_args"><strong>parse_args</strong></a>(...)</dt><dd><tt><a href="#-parse_args">parse_args</a>(ch,&nbsp;show_usage_errors,&nbsp;cmd,&nbsp;args,&nbsp;format)<br>
  75. &nbsp;<br>
  76. equivalent&nbsp;to&nbsp;parse_args&nbsp;written&nbsp;in&nbsp;C.&nbsp;See&nbsp;parse.h&nbsp;for&nbsp;information.</tt></dd></dl>
  77. <dl><dt><a name="-send"><strong>send</strong></a>(...)</dt><dd><tt><a href="#-send">send</a>(list,&nbsp;mssg,&nbsp;dict&nbsp;=&nbsp;None,&nbsp;newline&nbsp;=&nbsp;True)<br>
  78. &nbsp;<br>
  79. Sends&nbsp;a&nbsp;message&nbsp;to&nbsp;a&nbsp;list&nbsp;of&nbsp;characters.&nbsp;Messages&nbsp;can&nbsp;have&nbsp;scripts<br>
  80. embedded&nbsp;in&nbsp;them,&nbsp;using&nbsp;[&nbsp;and&nbsp;].&nbsp;If&nbsp;so,&nbsp;a&nbsp;variable&nbsp;dictionary&nbsp;must&nbsp;be<br>
  81. provided.&nbsp;By&nbsp;default,&nbsp;'ch'&nbsp;references&nbsp;each&nbsp;character&nbsp;being&nbsp;sent&nbsp;the<br>
  82. message,&nbsp;for&nbsp;embedded&nbsp;scripts.</tt></dd></dl>
  83. <dl><dt><a name="-set_global"><strong>set_global</strong></a>(...)</dt><dd><tt><a href="#-set_global">set_global</a>(name,&nbsp;val)<br>
  84. &nbsp;<br>
  85. Sets&nbsp;a&nbsp;non-persistent&nbsp;global&nbsp;variable.&nbsp;Val&nbsp;can&nbsp;be&nbsp;any&nbsp;type.</tt></dd></dl>
  86. </td></tr></table>
  87. </body></html>