cmd_manip.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <html><head><title>Python: cmd_manip</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>cmd_manip</strong></big></big></font></td
  8. ><td align=right valign=bottom
  9. ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/Users/hollis/Desktop/nakedmud/lib/pymodules/cmd_manip.py">/Users/hollis/Desktop/nakedmud/lib/pymodules/cmd_manip.py</a></font></td></tr></table>
  10. <p><tt>cmd_manip.py<br>
  11. &nbsp;<br>
  12. a&nbsp;set&nbsp;of&nbsp;commands&nbsp;that&nbsp;NakedMud(tm)&nbsp;comes&nbsp;with&nbsp;that&nbsp;allows&nbsp;characters&nbsp;to<br>
  13. manipulate&nbsp;various&nbsp;things.&nbsp;These&nbsp;commands&nbsp;are&nbsp;mostly&nbsp;directed&nbsp;towards<br>
  14. manipulating&nbsp;objects&nbsp;(e.g.&nbsp;get,&nbsp;put,&nbsp;drop,&nbsp;etc...)&nbsp;but&nbsp;can&nbsp;also&nbsp;affect&nbsp;other<br>
  15. things&nbsp;like&nbsp;exits&nbsp;(e.g.&nbsp;open,&nbsp;close)</tt></p>
  16. <p>
  17. <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
  18. <tr bgcolor="#aa55cc">
  19. <td colspan=3 valign=bottom>&nbsp;<br>
  20. <font color="#fffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
  21. <tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
  22. <td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="hooks.html">hooks</a><br>
  23. <a href="inform.html">inform</a><br>
  24. </td><td width="25%" valign=top><a href="movement.html">movement</a><br>
  25. <a href="mud.html">mud</a><br>
  26. </td><td width="25%" valign=top><a href="obj.html">obj</a><br>
  27. <a href="mudsys.html">mudsys</a><br>
  28. </td><td width="25%" valign=top><a href="utils.html">utils</a><br>
  29. </td></tr></table></td></tr></table><p>
  30. <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
  31. <tr bgcolor="#eeaa77">
  32. <td colspan=3 valign=bottom>&nbsp;<br>
  33. <font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
  34. <tr><td bgcolor="#eeaa77"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
  35. <td width="100%"><dl><dt><a name="-chk_can_manip"><strong>chk_can_manip</strong></a>(ch, cmd)</dt></dl>
  36. <dl><dt><a name="-cmd_close"><strong>cmd_close</strong></a>(ch, cmd, arg)</dt><dd><tt>Usage:&nbsp;close&nbsp;&lt;direction&nbsp;|&nbsp;door&nbsp;|&nbsp;container&gt;<br>
  37. &nbsp;<br>
  38. Attempts&nbsp;to&nbsp;close&nbsp;the&nbsp;specified&nbsp;door,&nbsp;direction,&nbsp;or&nbsp;container.</tt></dd></dl>
  39. <dl><dt><a name="-cmd_drop"><strong>cmd_drop</strong></a>(ch, cmd, arg)</dt><dd><tt>Usage:&nbsp;drop&nbsp;&lt;item&gt;<br>
  40. &nbsp;<br>
  41. Attempts&nbsp;to&nbsp;move&nbsp;an&nbsp;object&nbsp;from&nbsp;your&nbsp;inventory&nbsp;to&nbsp;the&nbsp;ground.</tt></dd></dl>
  42. <dl><dt><a name="-cmd_get"><strong>cmd_get</strong></a>(ch, cmd, arg)</dt><dd><tt>Usage:&nbsp;get&nbsp;[the]&nbsp;&lt;item&gt;&nbsp;[[from]&nbsp;&lt;other&nbsp;item&gt;]<br>
  43. &nbsp;<br>
  44. Attempts&nbsp;to&nbsp;move&nbsp;an&nbsp;object&nbsp;from&nbsp;the&nbsp;room&nbsp;to&nbsp;your&nbsp;inventory.&nbsp;If&nbsp;an<br>
  45. addition&nbsp;argument&nbsp;is&nbsp;supplied,&nbsp;the&nbsp;command&nbsp;assumes&nbsp;it&nbsp;is&nbsp;a&nbsp;container&nbsp;and<br>
  46. instead&nbsp;tries&nbsp;to&nbsp;move&nbsp;an&nbsp;object&nbsp;from&nbsp;the&nbsp;container&nbsp;to&nbsp;your&nbsp;inventory.</tt></dd></dl>
  47. <dl><dt><a name="-cmd_give"><strong>cmd_give</strong></a>(ch, cmd, arg)</dt><dd><tt>Usage:&nbsp;give&nbsp;&lt;object&gt;&nbsp;[to]&nbsp;&lt;person&gt;<br>
  48. &nbsp;<br>
  49. Attempts&nbsp;to&nbsp;transfer&nbsp;an&nbsp;object&nbsp;from&nbsp;your&nbsp;inventory&nbsp;to&nbsp;the&nbsp;specified<br>
  50. person.&nbsp;You&nbsp;can&nbsp;give&nbsp;multiple&nbsp;objects&nbsp;at&nbsp;a&nbsp;time&nbsp;by&nbsp;using&nbsp;the&nbsp;all.<br>
  51. prefix.&nbsp;For&nbsp;example:<br>
  52. &nbsp;<br>
  53. &gt;&nbsp;give&nbsp;all.cookie&nbsp;george<br>
  54. &nbsp;<br>
  55. Would&nbsp;give&nbsp;all&nbsp;of&nbsp;the&nbsp;cookies&nbsp;in&nbsp;your&nbsp;inventory&nbsp;to&nbsp;George.&nbsp;If&nbsp;you&nbsp;only<br>
  56. want&nbsp;to&nbsp;give&nbsp;him&nbsp;the&nbsp;raisin&nbsp;cookie,&nbsp;which&nbsp;also&nbsp;happens&nbsp;to&nbsp;be&nbsp;the&nbsp;third<br>
  57. cookie&nbsp;in&nbsp;your&nbsp;inventory,&nbsp;you&nbsp;can&nbsp;use&nbsp;a&nbsp;numeric&nbsp;prefix&nbsp;instead&nbsp;of<br>
  58. the&nbsp;all&nbsp;prefix.&nbsp;For&nbsp;example:<br>
  59. &nbsp;<br>
  60. &gt;&nbsp;give&nbsp;3.cookie&nbsp;george</tt></dd></dl>
  61. <dl><dt><a name="-cmd_lock"><strong>cmd_lock</strong></a>(ch, cmd, arg)</dt><dd><tt>Usage:&nbsp;lock&nbsp;&lt;direction&nbsp;|&nbsp;door&nbsp;|&nbsp;container&gt;<br>
  62. &nbsp;<br>
  63. Attempts&nbsp;to&nbsp;lock&nbsp;a&nbsp;specified&nbsp;door,&nbsp;direction,&nbsp;or&nbsp;container.</tt></dd></dl>
  64. <dl><dt><a name="-cmd_open"><strong>cmd_open</strong></a>(ch, cmd, arg)</dt><dd><tt>Usage:&nbsp;open&nbsp;[the]&nbsp;&lt;direction&nbsp;|&nbsp;door&nbsp;|&nbsp;container&gt;<br>
  65. &nbsp;<br>
  66. Attempts&nbsp;to&nbsp;open&nbsp;the&nbsp;speficied&nbsp;door,&nbsp;direction,&nbsp;or&nbsp;container.</tt></dd></dl>
  67. <dl><dt><a name="-cmd_put"><strong>cmd_put</strong></a>(ch, cmd, arg)</dt><dd><tt>Usage:&nbsp;put&nbsp;[the]&nbsp;&lt;item&gt;&nbsp;[in&nbsp;the]&nbsp;&lt;container&gt;<br>
  68. &nbsp;<br>
  69. Attempts&nbsp;to&nbsp;move&nbsp;an&nbsp;object&nbsp;from&nbsp;your&nbsp;inventory&nbsp;into&nbsp;a&nbsp;specified<br>
  70. container.&nbsp;The&nbsp;container&nbsp;must&nbsp;be&nbsp;in&nbsp;the&nbsp;room,&nbsp;in&nbsp;your&nbsp;inventory,&nbsp;or<br>
  71. worn.</tt></dd></dl>
  72. <dl><dt><a name="-cmd_remove"><strong>cmd_remove</strong></a>(ch, cmd, arg)</dt><dd><tt>Usage:&nbsp;remove&nbsp;&lt;item&nbsp;|&nbsp;all&gt;<br>
  73. &nbsp;<br>
  74. Attempts&nbsp;to&nbsp;remove&nbsp;an&nbsp;item&nbsp;you&nbsp;have&nbsp;equipped.&nbsp;If&nbsp;you&nbsp;would&nbsp;like&nbsp;to<br>
  75. remove&nbsp;everything&nbsp;you&nbsp;are&nbsp;wearing,&nbsp;you&nbsp;may&nbsp;instead&nbsp;specify&nbsp;'all'<br>
  76. instead&nbsp;of&nbsp;a&nbsp;specific&nbsp;item.&nbsp;If&nbsp;you&nbsp;would&nbsp;like&nbsp;to&nbsp;remove&nbsp;all&nbsp;of&nbsp;a&nbsp;certain<br>
  77. type&nbsp;of&nbsp;object&nbsp;(for&nbsp;instance,&nbsp;rings)&nbsp;you&nbsp;can&nbsp;use&nbsp;an&nbsp;all.&nbsp;prefix.&nbsp;For<br>
  78. example:<br>
  79. &nbsp;<br>
  80. &gt;&nbsp;remove&nbsp;all.ring<br>
  81. &nbsp;<br>
  82. This&nbsp;command&nbsp;will&nbsp;remove&nbsp;everything&nbsp;you&nbsp;are&nbsp;wearing&nbsp;with&nbsp;the&nbsp;'ring'<br>
  83. keyword.&nbsp;If&nbsp;you&nbsp;would&nbsp;instead&nbsp;like&nbsp;to&nbsp;remove,&nbsp;say,&nbsp;the&nbsp;second&nbsp;thing&nbsp;you<br>
  84. are&nbsp;wearing&nbsp;with&nbsp;the&nbsp;'ring'&nbsp;keyword,&nbsp;you&nbsp;can&nbsp;supply&nbsp;a&nbsp;numeric&nbsp;prefix.<br>
  85. For&nbsp;example:<br>
  86. &nbsp;<br>
  87. &gt;&nbsp;remove&nbsp;2.ring</tt></dd></dl>
  88. <dl><dt><a name="-cmd_unlock"><strong>cmd_unlock</strong></a>(ch, cmd, arg)</dt><dd><tt>Usage:&nbsp;unlock&nbsp;&lt;door&nbsp;|&nbsp;direction&nbsp;|&nbsp;container&gt;<br>
  89. &nbsp;<br>
  90. Attempts&nbsp;to&nbsp;unlock&nbsp;the&nbsp;specified&nbsp;door,&nbsp;direction,&nbsp;or&nbsp;container.</tt></dd></dl>
  91. <dl><dt><a name="-cmd_wear"><strong>cmd_wear</strong></a>(ch, cmd, arg)</dt><dd><tt>Usage:&nbsp;wear&nbsp;&lt;item&gt;&nbsp;[where]<br>
  92. &nbsp;<br>
  93. Attempts&nbsp;to&nbsp;equip&nbsp;an&nbsp;item&nbsp;from&nbsp;your&nbsp;inventory.&nbsp;If&nbsp;you&nbsp;would&nbsp;like&nbsp;to<br>
  94. equip&nbsp;it&nbsp;to&nbsp;a&nbsp;non-default&nbsp;location,&nbsp;you&nbsp;can&nbsp;supply&nbsp;where&nbsp;on&nbsp;your&nbsp;body<br>
  95. you&nbsp;would&nbsp;like&nbsp;to&nbsp;wear&nbsp;it.&nbsp;For&nbsp;example,&nbsp;if&nbsp;you&nbsp;would&nbsp;like&nbsp;to&nbsp;equip&nbsp;a<br>
  96. torch,&nbsp;but&nbsp;in&nbsp;your&nbsp;offhand&nbsp;instead&nbsp;of&nbsp;your&nbsp;mainhand:<br>
  97. &nbsp;<br>
  98. &gt;&nbsp;wear&nbsp;torch&nbsp;offhand<br>
  99. &nbsp;<br>
  100. If&nbsp;an&nbsp;item&nbsp;covers&nbsp;multiple&nbsp;locations&nbsp;on&nbsp;your&nbsp;body,&nbsp;you&nbsp;can&nbsp;specify&nbsp;where<br>
  101. all&nbsp;you&nbsp;would&nbsp;like&nbsp;to&nbsp;equip&nbsp;the&nbsp;item&nbsp;as&nbsp;a&nbsp;comma-separated&nbsp;list:<br>
  102. &nbsp;<br>
  103. &gt;&nbsp;wear&nbsp;gloves&nbsp;left&nbsp;hand,&nbsp;right&nbsp;hand</tt></dd></dl>
  104. <dl><dt><a name="-do_drop"><strong>do_drop</strong></a>(ch, obj)</dt><dd><tt>handles&nbsp;object&nbsp;dropping</tt></dd></dl>
  105. <dl><dt><a name="-do_get"><strong>do_get</strong></a>(ch, obj, cont)</dt><dd><tt>transfers&nbsp;an&nbsp;item&nbsp;from&nbsp;the&nbsp;ground&nbsp;to&nbsp;the&nbsp;character</tt></dd></dl>
  106. <dl><dt><a name="-do_give"><strong>do_give</strong></a>(ch, recv, obj)</dt><dd><tt>does&nbsp;the&nbsp;handling&nbsp;of&nbsp;the&nbsp;give&nbsp;command</tt></dd></dl>
  107. <dl><dt><a name="-do_put"><strong>do_put</strong></a>(ch, obj, cont)</dt><dd><tt>handles&nbsp;the&nbsp;putting&nbsp;of&nbsp;objects</tt></dd></dl>
  108. <dl><dt><a name="-do_remove"><strong>do_remove</strong></a>(ch, obj)</dt><dd><tt>handles&nbsp;equipment&nbsp;removing</tt></dd></dl>
  109. <dl><dt><a name="-do_wear"><strong>do_wear</strong></a>(ch, obj, where)</dt><dd><tt>handles&nbsp;object&nbsp;wearing</tt></dd></dl>
  110. <dl><dt><a name="-try_get_from"><strong>try_get_from</strong></a>(ch, cont, arg)</dt><dd><tt>tries&nbsp;to&nbsp;get&nbsp;one&nbsp;item&nbsp;from&nbsp;inside&nbsp;another</tt></dd></dl>
  111. <dl><dt><a name="-try_manip_other_exit"><strong>try_manip_other_exit</strong></a>(room, ex, closed, locked)</dt><dd><tt>used&nbsp;by&nbsp;open,&nbsp;close,&nbsp;lock,&nbsp;and&nbsp;unlock.&nbsp;When&nbsp;an&nbsp;exit&nbsp;is&nbsp;manipulated&nbsp;on&nbsp;one<br>
  112. side,&nbsp;it&nbsp;is&nbsp;the&nbsp;case&nbsp;that&nbsp;we'll&nbsp;want&nbsp;to&nbsp;do&nbsp;an&nbsp;identical&nbsp;manipulation&nbsp;on<br>
  113. the&nbsp;other&nbsp;side.&nbsp;That's&nbsp;what&nbsp;we&nbsp;do&nbsp;here.&nbsp;Note:&nbsp;Can&nbsp;only&nbsp;do&nbsp;close&nbsp;OR&nbsp;lock<br>
  114. with&nbsp;one&nbsp;call&nbsp;to&nbsp;this&nbsp;function.&nbsp;Cannot&nbsp;handle&nbsp;both&nbsp;at&nbsp;the&nbsp;same&nbsp;time!</tt></dd></dl>
  115. </td></tr></table><p>
  116. <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
  117. <tr bgcolor="#55aa55">
  118. <td colspan=3 valign=bottom>&nbsp;<br>
  119. <font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
  120. <tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
  121. <td width="100%"><strong>cmd</strong> = 'unlock'</td></tr></table>
  122. </body></html>