Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Troubadour
GURU


Joined: 14 Oct 2000
Posts: 556
Location: USA

PostPosted: Fri Mar 29, 2002 5:49 pm   

argh - another rescue trigger set not working =(
 
Rather than try to troubleshoot what you've written here, I'd like to bring to your attention a couple of tools which will make your script a lot simpler, faster, and more efficient. First, be aware that you can place a string list inside a trigger pattern and zMUD will compare the MUD text to each of the items in the string list to see if there is a match. For example, given the string list: #VAR petlist {snake|dog|cat|turtle}, and the trigger #TR {I love my {@petlist}}, zMUD will successfully match the text "I love my dog". Note the curly braces around the string variable's name in the trigger. If you place parentheses around the curly braces, ala #TR {I love my ({@petlist})}, then the item will be captured and stored as a parameter. #TR {I love my ({@petlist})} {#VAR mypet %1} will match "I love my dog" and store "dog" to @mypet. This basic tool can be used to simplify your script.

Make a string list variable with all the attack_levels: #VAR attack_levels {intensity|viciousness|strength|passion|force|power|might|ferocity|rage|savagery|brutality}
Rewrite your group_list alias to store the names as a string list:
#ALIAS group_list {#VAR gmem %replace("%-1", " ", "|")}
This alias will take all the parameters (names of members) and replace the space between the names with a "|", thus making it a string list.

Finally, replace all of your triggers with the following two:
#TRIGGER {({@gmem}) %d times, with %x {@attack_levels}} {rescue %1}
#TRIGGER {({@gmem}) with %x {@attack_levels}} {rescue %1}


These two triggers use the tool I discussed above. The triggers will look at individual items in the string list gmem, and if successful, capture it to %1. The triggers will also compare each item in @attack_levels, but since it is not enclosed in parentheses, will not capture it.

After simplifying your script in this fashion, I'm sure you'll be able to troubleshoot it more easily.

Troubadour
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat Mar 30, 2002 12:04 am   
 
To simplify matters further, you can use the #ADDITEM and #DELITEM commands to change the members of your rescue group one at a time. So when Troubadour leaves for the day and you decide to let LightBulb join the group instead you don't have to redo the entire list.

#AL addrescue {#ADDITEM gmem %1}
#AL stoprescue {#DELITEM gmem %1}


LightBulb
All scripts untested unless otherwise noted
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net