Difference between revisions of "CMud Auto Rescue"

From AvatarWiki
Jump to navigation Jump to search
m (Updating for CMud v3.32)
(made some upgrades to the rescue trigger that prevent significant amounts of rescue lag in larger groups (eha, lord))
 
(2 intermediate revisions by one other user not shown)
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 ==
Line 14: Line 16:
 
<?xml version="1.0" encoding="ISO-8859-1" ?>
 
<?xml version="1.0" encoding="ISO-8859-1" ?>
 
<cmud>
 
<cmud>
   <class name="Rescue" enabled="false">
+
   <class name="Rescue">
     <var name="rescuelist" type="Literal"/>
+
      
    <trigger priority="5470">
+
       <value>lollipot|atreyu|renculos|mactabion|seperia|styrr|murugan|druidess|daripper</value>
       <pattern>(%*) attack[s ]{strike|strikes} (%w) with (*)</pattern>
+
       <json>["lollipot","atreyu","renculos","mactabion","seperia","styrr","murugan","druidess","daripper"]</json>
       <value>#if %ismember(%1,@rescuelist) {rescue %1} {}</value>
+
      
     </trigger>
 
 
     <alias name="addrescue">
 
     <alias name="addrescue">
 
       <value>#ec adding %1 to autorescue;
 
       <value>#ec adding %1 to autorescue;
#var rescuelist %additem(%lower(%1),@rescuelist)
+
        #var rescuelist %additem(%lower(%1),@rescuelist)
#ec
+
        #ec
#ec ---  CHARACTERS IN THE RESCUE LIST  ---
+
        #ec ---  CHARACTERS IN THE RESCUE LIST  ---
#ec
+
        #ec
#fo @rescuelist {#ec %i}</value>
+
        #fo @rescuelist {#ec %i}</value>
 
     </alias>
 
     </alias>
 
     <alias name="clearrescue">
 
     <alias name="clearrescue">
 
       <value>#var rescuelist ""
 
       <value>#var rescuelist ""
#echo ---- RESCUE LIST CLEARED ----</value>
+
        #var rescwho ""
 +
        #echo ---- RESCUE LIST CLEARED ----</value>
 
     </alias>
 
     </alias>
 
     <alias name="removerescue">
 
     <alias name="removerescue">
 
       <value>#ec Removing %1 from rescue list
 
       <value>#ec Removing %1 from rescue list
#var rescuelist %delitem(%lower(%1),@rescuelist)
+
        #var rescuelist %delitem(%lower(%1),@rescuelist)
#ec
+
        #ec
#ec ---  CHARACTERS IN THE RESCUE LIST  ---
+
        #ec ---  CHARACTERS IN THE RESCUE LIST  ---
#ec
+
        #ec
#fo @Rescuelist {#ec %i}
+
        #fo @Rescuelist {#ec %i}</value>
</value>
 
 
     </alias>
 
     </alias>
 
     <alias name="showrescue">
 
     <alias name="showrescue">
 
       <value>#ec
 
       <value>#ec
#ec ---  CHARACTERS IN THE RESCUE LIST  ---
+
        #ec ---  CHARACTERS IN THE RESCUE LIST  ---
#ec
+
        #ec
#fo @rescuelist {#ec %i}</value>
+
        #fo @rescuelist {#ec %i}</value>
 
     </alias>
 
     </alias>
     <alias name="reportrescue">
+
     <alias name="reportresc">
 
       <value>gt my rescue list is: @rescuelist</value>
 
       <value>gt my rescue list is: @rescuelist</value>
 
     </alias>
 
     </alias>
 
     <menu priority="5530">
 
     <menu priority="5530">
       <caption>addrescue</caption>
+
       addrescue
 
       <value>addrescue %selword</value>
 
       <value>addrescue %selword</value>
 
     </menu>
 
     </menu>
 
     <menu priority="5540">
 
     <menu priority="5540">
       <caption>remove from rescue</caption>
+
       remove from rescue
 
       <value>removerescue %selword</value>
 
       <value>removerescue %selword</value>
 
     </menu>
 
     </menu>
 
     <menu priority="5550">
 
     <menu priority="5550">
       <caption>show rescue</caption>
+
       show rescue
       <value>showrescue</value>
+
       <value>showresc</value>
 
     </menu>
 
     </menu>
 
     <menu priority="5560">
 
     <menu priority="5560">
       <caption>clear rescue</caption>
+
       clear rescue
 
       <value>clearrescue</value>
 
       <value>clearrescue</value>
 
     </menu>
 
     </menu>
     <trigger priority="5570">
+
     <class name="Resc" initenable="true">
      <pattern>(%*) attack[s ]haven't hurt (%w)</pattern>
+
      <trigger priority="5470">
      <value>#if %ismember(%1,@rescuelist) {rescue %1} {}</value>
+
        <pattern>* attack{s|} strike{s|} (%w)[1234567890 times,]with *</pattern>
 +
        <value>#if %ismember(%1,@rescuelist) {rescue %1;#var rescwho %1;#class Resc 0} {}</value>
 +
      </trigger>
 +
      <trigger priority="5570">
 +
        <pattern>* attack{s|} haven't hurt (%w)</pattern>
 +
        <value>#if %ismember(%1,@rescuelist) {rescue %1;#var rescwho %1;#class Resc 0} {}</value>
 +
      </trigger>
 +
    </class>
 +
    Seperia
 +
    <trigger priority="6040">
 +
      <pattern>^@rescwho doesn't NEED rescuing!$</pattern>
 +
      <value>#class Resc 1</value>
 +
    </trigger>
 +
    <trigger priority="6050">
 +
      <pattern>^You successfully rescue @rescwho from (%*)</pattern>
 +
      <value>#class Resc 1</value>
 +
    </trigger>
 +
    <trigger priority="6060">
 +
      <pattern>^You fail to rescue @rescwho from (%*)</pattern>
 +
      <value>#class Resc 1</value>
 
     </trigger>
 
     </trigger>
 
   </class>
 
   </class>
 
</cmud>
 
</cmud>
 
 
</pre>
 
</pre>
  

Latest revision as of 13:19, 12 February 2011

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">
    
      <value>lollipot|atreyu|renculos|mactabion|seperia|styrr|murugan|druidess|daripper</value>
      <json>["lollipot","atreyu","renculos","mactabion","seperia","styrr","murugan","druidess","daripper"]</json>
    
    <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 ""
        #var rescwho ""
        #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="reportresc">
      <value>gt my rescue list is: @rescuelist</value>
    </alias>
    <menu priority="5530">
      addrescue
      <value>addrescue %selword</value>
    </menu>
    <menu priority="5540">
      remove from rescue
      <value>removerescue %selword</value>
    </menu>
    <menu priority="5550">
      show rescue
      <value>showresc</value>
    </menu>
    <menu priority="5560">
      clear rescue
      <value>clearrescue</value>
    </menu>
    <class name="Resc" initenable="true">
      <trigger priority="5470">
        <pattern>* attack{s|} strike{s|} (%w)[1234567890 times,]with *</pattern>
        <value>#if %ismember(%1,@rescuelist) {rescue %1;#var rescwho %1;#class Resc 0} {}</value>
      </trigger>
      <trigger priority="5570">
        <pattern>* attack{s|} haven't hurt (%w)</pattern>
        <value>#if %ismember(%1,@rescuelist) {rescue %1;#var rescwho %1;#class Resc 0} {}</value>
      </trigger>
    </class>
    Seperia
    <trigger priority="6040">
      <pattern>^@rescwho doesn't NEED rescuing!$</pattern>
      <value>#class Resc 1</value>
    </trigger>
    <trigger priority="6050">
      <pattern>^You successfully rescue @rescwho from (%*)</pattern>
      <value>#class Resc 1</value>
    </trigger>
    <trigger priority="6060">
      <pattern>^You fail to rescue @rescwho from (%*)</pattern>
      <value>#class Resc 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.