Difference between revisions of "Zmud Auto Rescue"

From AvatarWiki
Jump to navigation Jump to search
(fixed some major bugs I added to the original script)
 
Line 2: Line 2:
  
 
Syntax: addrescue <charname>, adds character to the rescue list.<br>
 
Syntax: addrescue <charname>, adds character to the rescue list.<br>
Syntax: dontrescue <charname>, remove a character from the rescue list.<br>
+
Syntax: remrescue <charname>, remove a character from the rescue list.<br>
 
Syntax: clearrescue, clears the rescue list.<br>
 
Syntax: clearrescue, clears the rescue list.<br>
 +
Syntax: showrescue, shows the rescue list.<br>
  
 
A right click menu also lets you right click on a char name and it will either add or remove depending on what you select.
 
A right click menu also lets you right click on a char name and it will either add or remove depending on what you select.
Line 11: Line 12:
 
<pre>
 
<pre>
 
#CLASS {autorescue}
 
#CLASS {autorescue}
#ALIAS autorescue {#ec autorescue - %1
+
#ALIAS addrescue {#ec autorescue - %1;#var rescuelist %additem( %lower( %1), @rescuelist);#ec %null;#ec --- CHARACTERS IN THE RESCUE LIST ---;#ec %null;#fo @rescuelist {#ec %i}}
#var groupie %additem(%lower(%1),@groupie)
+
#ALIAS remrescue {#ec don't rescue - %1;#var rescuelist %delitem( %lower( %1), @rescuelist);#ec %null;#ec --- CHARACTERS IN THE RESCUE LIST ---;#ec %null;#fo @rescuelist {#ec %i}}
#ec
+
#ALIAS clearrescue {#ye {clear the rescue list?} {yes:rescuelist="";#ec rescue buffer - cleared} {no:}}
#ec --- CHARACTERS IN THE RESCUE LIST ---
+
#ALIAS showrescue {#ec %null;#ec --- CHARACTERS IN THE RESCUE LIST ---;#ec %null;#fo @rescuelist {#ec %i}}
#ec
+
#VAR rescuelist {test|stest}
#fo @groupie {#ec %i}}
+
#MENU {Rescue - Add} {addrescue %selword} ""
#ALIAS dontrescue {#ec don't rescue - %1
+
#MENU {Rescue - Remove} {remrescue %selword} ""
#var groupie %delitem(%lower(%1),@groupie)
+
#MENU {Rescue - Show} {showrescue} ""
#ec
+
#MENU {Rescue - Clear} {clearrescue} ""
#ec --- CHARACTERS IN THE RESCUE LIST ---
 
#ec
 
#fo @groupie {#ec %i}}
 
#ALIAS clearrescue {#ye {clear the rescue list?} {yes:groupie="";#ec rescue buffer - cleared} {no:}}
 
#ALIAS showrescue {#ec
 
#ec --- CHARACTERS IN THE RESCUE LIST ---
 
#ec
 
#fo @groupie {#ec %i}}
 
#VAR groupie {}
 
#MENU {rescue} {autorescue %selword} ""
 
#MENU {don't rescue} {dontrescue %selword} ""
 
#MENU {show rescue} {showrescue} ""
 
#MENU {clear rescue} {clearrescue} ""
 
 
#CLASS 0
 
#CLASS 0
 
#CLASS {autorescue|rescue}
 
#CLASS {autorescue|rescue}
#TRIGGER {(%*) attack[s ]strike[s ](%w)} {#if %ismember( %lower( %2), @groupie) {rescue %2;#t- rescue}}
+
#TRIGGER {(%*) attacks strike (%w)} {#if %ismember( %lower( %2), @rescuelist) {rescue %2;#t- rescue}}
#TRIGGER {(%*) attacks haven't hurt (%w)} {#if %ismember( %lower( %2), @groupie) {rescue %2;#t- rescue}}
+
#TRIGGER {(%*) attacks haven't hurt (%w)} {#if %ismember( %lower( %2), @rescuelist) {rescue %2;#t- rescue}}
 +
#TRIGGER {(%*) attack strikes (%w)} {#if %ismember( %lower( %2), @rescuelist) {rescue %2;#t- rescue}}
 
#CLASS 0
 
#CLASS 0
#CLASS {autorescue|rescue2}
+
#CLASS {autorescue|rescue back on}
 
#TRIGGER {^(%*) is DEAD!!} {#T+ rescue}
 
#TRIGGER {^(%*) is DEAD!!} {#T+ rescue}
 
#TRIGGER {You successfully rescue} {#T+ rescue}
 
#TRIGGER {You successfully rescue} {#T+ rescue}
 
#TRIGGER {doesn't need your help.} {#T+ rescue}
 
#TRIGGER {doesn't need your help.} {#T+ rescue}
 +
#TRIGGER {You fail to rescue} {#T+ rescue}
 +
#TRIGGER {doesn't NEED rescuing!} {#T+ rescue}
 
#CLASS 0
 
#CLASS 0
 
</pre>
 
</pre>
Line 47: Line 38:
 
== Designer comments ==
 
== Designer comments ==
  
All the credits for this trigger set go to amezyarak.  
+
All the credits for the original trigger set go to amezyarak.
 +
 
 +
When archers came in I altered the original trigger line to count for archer mobs, I failed as it would not rescue people if their name began with a S, so split it back into two lines. Also the original trigger would only do one rescue per mob/player killed this was to prevent the trigger spamming rescue, so I have added a couple more trigger lines to turn it back on for player already rescued, failed rescue, a successful rescue and try to rescue when mob is dead.
  
 
[[Category:Zmud Scripting]]
 
[[Category:Zmud Scripting]]

Latest revision as of 20:24, 15 April 2011

This is the Auto rescue set of triggers from the amezyarak site, added as the site is now defunct.

Syntax: addrescue <charname>, adds character to the rescue list.
Syntax: remrescue <charname>, remove a character from the rescue list.
Syntax: clearrescue, clears the rescue list.
Syntax: showrescue, shows the rescue list.

A right click menu also lets you right click on a char name and it will either add or remove depending on what you select.

Code

Copy this section and paste it into a *.txt file. Then, in zMUD, go to "Settings -> File -> Import Text" and select the file you saved to:

#CLASS {autorescue}
#ALIAS addrescue {#ec autorescue - %1;#var rescuelist %additem( %lower( %1), @rescuelist);#ec %null;#ec --- CHARACTERS IN THE RESCUE LIST ---;#ec %null;#fo @rescuelist {#ec %i}}
#ALIAS remrescue {#ec don't rescue - %1;#var rescuelist %delitem( %lower( %1), @rescuelist);#ec %null;#ec --- CHARACTERS IN THE RESCUE LIST ---;#ec %null;#fo @rescuelist {#ec %i}}
#ALIAS clearrescue {#ye {clear the rescue list?} {yes:rescuelist="";#ec rescue buffer - cleared} {no:}}
#ALIAS showrescue {#ec %null;#ec --- CHARACTERS IN THE RESCUE LIST ---;#ec %null;#fo @rescuelist {#ec %i}}
#VAR rescuelist {test|stest}
#MENU {Rescue - Add} {addrescue %selword} ""
#MENU {Rescue - Remove} {remrescue %selword} ""
#MENU {Rescue - Show} {showrescue} ""
#MENU {Rescue - Clear} {clearrescue} ""
#CLASS 0
#CLASS {autorescue|rescue}
#TRIGGER {(%*) attacks strike (%w)} {#if %ismember( %lower( %2), @rescuelist) {rescue %2;#t- rescue}}
#TRIGGER {(%*) attacks haven't hurt (%w)} {#if %ismember( %lower( %2), @rescuelist) {rescue %2;#t- rescue}}
#TRIGGER {(%*) attack strikes (%w)} {#if %ismember( %lower( %2), @rescuelist) {rescue %2;#t- rescue}}
#CLASS 0
#CLASS {autorescue|rescue back on}
#TRIGGER {^(%*) is DEAD!!} {#T+ rescue}
#TRIGGER {You successfully rescue} {#T+ rescue}
#TRIGGER {doesn't need your help.} {#T+ rescue}
#TRIGGER {You fail to rescue} {#T+ rescue}
#TRIGGER {doesn't NEED rescuing!} {#T+ rescue}
#CLASS 0

Designer comments

All the credits for the original trigger set go to amezyarak.

When archers came in I altered the original trigger line to count for archer mobs, I failed as it would not rescue people if their name began with a S, so split it back into two lines. Also the original trigger would only do one rescue per mob/player killed this was to prevent the trigger spamming rescue, so I have added a couple more trigger lines to turn it back on for player already rescued, failed rescue, a successful rescue and try to rescue when mob is dead.