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
Mathe
Newbie


Joined: 12 Sep 2004
Posts: 2

PostPosted: Sun Sep 12, 2004 2:30 am   

Triggers & Variables
 
Have a trigger question that I can't seem to figure out. Have tried all the expressions in the helps and none are working. Here is what I have:

Pattern:
cast '(%w)' (%w)

Value:
#var target %1
#var spell {%2}

This will successfully capture most of my spell commands such as armor, bless, etc.

The problem comes in when I cast a spell with two words such as "cure light". To fix this problem I edited my pattern to look like this:

cast '(%w%s%w)' (%w)

That works great with two word spells, but now it will not capture the single word spells successfully.

Any suggestions for how I can easily capture a single or two word spell and assign it to the @spell variable with that pattern?

Thanks all and happy mudding!

Mathe
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sun Sep 12, 2004 4:11 am   
 
Sure use a different wildcard. From the Pattern Matching page of the help we find that * is the correct wildcard. Also since you are triggering off your commands it is best to use the proper trigger type and correct the options to ensure a trigger loop does not occur should you ever add more to this trigger.

Pattern:
cast '(*)' (%w)

Value:
#VAR target %2
#VAR spell {%1}

Options: Type=Command Input, Trigger On Trigger=unchecked
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Mathe
Newbie


Joined: 12 Sep 2004
Posts: 2

PostPosted: Mon Sep 13, 2004 1:21 pm   
 
That worked great! I have tried using the (*) before but I did not adjust the options. Thanks again.
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