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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
nazzireth
Beginner


Joined: 26 Jun 2007
Posts: 12

PostPosted: Sat Jul 13, 2013 1:52 am   

using a defined variable in a trigger patteren?
 
HI guys,

lets say i made a trigger for:

[ Joe ] [ Chuck ] [ Pete ]

where Joe is %1, Chuck is %2, and Pete is %3

#var groupmemeber1 (%1)
#var groupmemeber2 (%2)
#var groupmemeber3 (%3)

Now I can make a trigger using the in game group member prompt:

[Chuck ][CLE][ lv 22| 396/ 396hp 695/ 695m 530/ 530mv]

which i made into a trigger:

(*)~[(*)~]~[(*)~]~[ lv (%n)~|(%s)(%n)/(%s)(%n)hp(%s)(%n)/(%s)(%n)m(%s)(%n)/(*)(*)

this matches of course.
but can i make this work?:

(*)~[(@groupmember2)~]~[(*)~]~[ lv (%n)~|(%s)(%n)/(%s)(%n)hp(%s)(%n)/(%s)(%n)m(%s)(%n)/(*)(*)

And have it only trigger if Chuck is groupmemeber2?

I just am not sure how or if it works this way?

I tried using {@groupmemebr2} instead of (*) but it didn't work.


Thanx in advance for any help =)
Reply with quote
Anaristos
Sorcerer


Joined: 17 Jul 2007
Posts: 821
Location: California

PostPosted: Sun Jul 14, 2013 12:35 am   
 
The general pattern:
Code:

*~[ (@groupmember2) ~]*~[ lv (%n)~|(%s)(%n)/(%s)(%n)hp(%s)(%n)/(%s)(%n)m(%s)(%n)/(*)(*)

should work. Notice that since you don't care about the first or third name the parentheses are removed from the trigger. You do have to include the blanks surrounding the second name because you don't have them in the variable. Also, if you are looking for the match you really don't need the parentheses around the second name either since you already know what it is. You would only use the parentheses if this was a capture pattern not a matching one.
_________________
Sic itur ad astra.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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