Difference between revisions of "CMud Auto Rescue"

From AvatarWiki
Jump to navigation Jump to search
m (Updating for CMud v3.32)
m
Line 1: Line 1:
 
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.
 
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.
 +
 +
This script has been updated for CMud v3.32.
  
 
== How to Use It ==
 
== How to Use It ==

Revision as of 11:01, 4 December 2010

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.

This script has been updated for CMud v3.32.

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">
    <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" color="#F0F0F0" priority="5619">
    <caption>Rescue Off</caption>
    <value>#class Rescue 1
#echo ---- RESCUE MODE ON ----</value>
    <button>
      <caption>Rescue On</caption>
      <value>#Class Rescue 0
#echo ---- RESCUE MODE OFF ----</value>
    </button>
  </button>
</cmud>


Designer comments

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