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


Joined: 17 Jul 2008
Posts: 1

PostPosted: Thu Jul 17, 2008 3:37 am   

This one should be easy for you coders - Trigger problem
 
Using Zmud 7.21

Playing Avalon - The First Age

Trying to make a trigger for the following lines
Code:
"lyre24239"   a golden lyre.
"lyre9984"   a divine lyre.

Need a trigger that will capture the alphanumeric between the quotes. The spaces between the second quote and the text that follows varies and sometimes there is no space. (e.g. "chainmail12075"a suit of adamant chainmail.)

Just need to be able to distinguish between which lyre i am using by number, otherwise Avalon tends to rotate through each item of the same name but different number

{^"lyre(&%x) %s a divine lyre}

I have tried things such as above to no avail. How do I get what it captures into a variable such as @divine or @golden or am i going about this the wrong way.

Your help is greatly appreciated

surefirewizard
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Thu Jul 17, 2008 9:18 am   
 
#trig {^"lyre(%d)" a ({divine|golden}) lyre} {#var %concat(%2,"_lyre_number") %1}
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Taz
GURU


Joined: 28 Sep 2000
Posts: 1395
Location: United Kingdom

PostPosted: Thu Jul 17, 2008 4:43 pm   
 
I think Fang missed the thing about the spaces and I've edited your post so they can now clearly be seen.

So an amendment to what Fang put is:

#trig {^"lyre(%d)"{%s|} a ({divine|golden}) lyre} {#var %concat(%2,"_lyre_number") %1}

You will need to make sure you change "Preferences\Script Parser\General Parsing\Wildcards in {} triggers" to ticked for it to work.
_________________
Taz :)
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Fri Jul 18, 2008 10:02 am   
 
I actually think ^"lyre(%d)"%sa ({divine|golden}) lyre is a bit more readable, but eh.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Taz
GURU


Joined: 28 Sep 2000
Posts: 1395
Location: United Kingdom

PostPosted: Fri Jul 18, 2008 7:41 pm   
 
It doesn't rely on the preference setting either so it's better!
_________________
Taz :)
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