CMud Auto Rescue

From AvatarWiki
Revision as of 20:32, 6 September 2010 by Shalineth (talk | contribs) (CMud auto rescue trigger)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Your basic Auto Rescue trigger, it will check if someone is getting hit, compare their name to your rescue list and rescue if you have the trigger turned on, which is done by a button at the top of your main window.

How to Use It

addrescue <name> - Adds <name> to the rescue list. Can also be accessed by a drop down menu when the Auto Rescue button is enabled.
removerescue <name> - Removes <name> from the rescue list. Also available in the drop down.
clearrescue - Clears the rescue list.
reportrescue - Reports the rescue list to grouptell.
showrescue - Reports the rescue list to local echo.

The Script

Save the following code as an .xml file, and import it into Cmud:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
  <class name="Rescue" enabled="false">
    <var name="rescuelist" type="Literal"/>
    <trigger priority="5470">
      <pattern>(%*) attack[s ]{strike|strikes} (%w) with (*)</pattern>
      <value>#if %ismember(%1,@rescuelist) {rescue %1} {}</value>
    </trigger>
    <alias name="addrescue">
      <value>#ec adding %1 to autorescue;
#var rescuelist %additem(%lower(%1),@rescuelist)
#ec
#ec ---  CHARACTERS IN THE RESCUE LIST  ---
#ec
#fo @rescuelist {#ec %i}</value>
    </alias>
    <alias name="clearrescue">
      <value>#var rescuelist ""
#echo ---- RESCUE LIST CLEARED ----</value>
    </alias>
    <alias name="removerescue">
      <value>#ec Removing %1 from rescue list
#var rescuelist %delitem(%lower(%1),@rescuelist)
#ec
#ec ---  CHARACTERS IN THE RESCUE LIST  ---
#ec
#fo @Rescuelist {#ec %i}
</value>
    </alias>
    <alias name="showrescue">
      <value>#ec
#ec ---  CHARACTERS IN THE RESCUE LIST  ---
#ec
#fo @rescuelist {#ec %i}</value>
    </alias>
    <alias name="reportrescue">
      <value>gt my rescue list is: @rescuelist</value>
    </alias>
    <menu priority="5530">
      <caption>addrescue</caption>
      <value>addrescue %selword</value>
    </menu>
    <menu priority="5540">
      <caption>remove from rescue</caption>
      <value>removerescue %selword</value>
    </menu>
    <menu priority="5550">
      <caption>show rescue</caption>
      <value>showrescue</value>
    </menu>
    <menu priority="5560">
      <caption>clear rescue</caption>
      <value>clearrescue</value>
    </menu>
    <trigger priority="5570">
      <pattern>(%*) attack[s ]haven't hurt (%w)</pattern>
      <value>#if %ismember(%1,@rescuelist) {rescue %1} {}</value>
    </trigger>
  </class>
</cmud>

The Button

You'll also need to include this button to toggle the Auto Rescue trigger on and off.

<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
  <button type="Toggle" autosize="false" width="72" height="23" autopos="false" left="401" priority="5618">
    <caption>Rescue Off</caption>
    <value>#class Rescue 1
#echo ---- RESCUE MODE ON ----</value>
    <state caption="Rescue On">#Class Rescue 0
#echo ---- RESCUE MODE OFF ----</state>
  </button>
</cmud>

Designer comments

Feel free to note me here or on board 2 to Shalineth with any feedback or suggestions.