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
TaisharMalkier
Novice


Joined: 28 Sep 2001
Posts: 45
Location: USA

PostPosted: Tue Jan 08, 2002 11:29 am   

Autoassist Trigger
 
Im trying to get a this autoassist trigger to work, but dont know what's wrong with it.

#TR {@leader @autoassisting} {#IF {aggy=0} {assist;aggy=1}}
Where @leader is the leader of the party and @autoassisting is all of the hits that my leader could possibly do.
#VAR autoassisting {"incinerated"|"desecrated"|"gutted"|"mutilated"|"thrust"|"grazed"|"poked"|"swatted"|"missed"|"obliterated"|"stabbed"|"prodded"|"gouged"|"bruised"|"smashed"|"cracked"}
@aggy is a counter so that I don't get spammed with the trigger for every hit my leader does. It is reset to 0 whenever something dies via a trigger.
My problem is that the autoassist trigger doesnt fire and when I test it on "Boromir DESECRATED" and Boromir is @leader it says that the pattern is not matched. Some help on this would be greatly appreciated.

Contain rather than hurt.
Hurt rather than maim.
Maim rather than kill.
Kill rather than be killed.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Tue Jan 08, 2002 1:48 pm   
 
You need to enclose the string lists you use in a pattern in braces, like this:
#TR {@leader {@autoassisting}} {#IF {aggy=0} {assist;aggy=1}}

Kjata
Reply with quote
TaisharMalkier
Novice


Joined: 28 Sep 2001
Posts: 45
Location: USA

PostPosted: Tue Jan 08, 2002 2:40 pm   
 
Thank you so much. Just one thing if you dont mind. Can u explain to me why those brackets need to be around that variable? If I know the reason, I can keep myself from having similiar problems later. Thanks.

Contain rather than hurt.
Hurt rather than maim.
Maim rather than kill.
Kill rather than be killed.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Tue Jan 08, 2002 5:28 pm   
 
Sure, no problem. What happens is that when you use a string list in a pattern what you are trying to do is to tell the trigger to match one of the strings inside the stringlist. The syntax zMUD has for this is to enclose it in braces. You can also enclose in braces a manually entered string list and it will work the same. For example:
#TRIGGER {You get a {sword|chest|helmet}} {#SH It matched!}

is the same as:
#VAR items "sword|chest|helmet"
#TRIGGER {You get a {@items}} {#SH It matched!}

In both cases you need the braces to tell zMUD it is a string list of possible matches instead of a single value which must be matched as is.

Kjata
Reply with quote
TaisharMalkier
Novice


Joined: 28 Sep 2001
Posts: 45
Location: USA

PostPosted: Tue Jan 08, 2002 5:52 pm   
 
Ahah! Now i get it. Thanks

Contain rather than hurt.
Hurt rather than maim.
Maim rather than kill.
Kill rather than be killed.
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