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
Lasivian
Wanderer


Joined: 25 Jan 2002
Posts: 76
Location: USA

PostPosted: Sat Dec 22, 2007 8:47 am   

Multi-line triggers
 
I'm not sure how to make a trigger that will capture multiple lines at once.

I'm trying to make a database of Identified items, but since the format is like this:

Code:
Object: luxuriant serpent valise     Type: container
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Flags: none
Weight: 0     Value: 410     Level: 10
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


I don't know how to keep several lines together.

Thanks
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Sat Dec 22, 2007 12:07 pm   
 
Use a multistate trigger rather than a multiline trigger. Something like this perhaps:

#trig {Object: ([a-z ]) %s Type: (%w)} {do whatever}
#cond {Flags: ([a-z ])} {do whatever}
#cond {Weight: (%d) %s Value: (%d) %s Level: (%d)} {do whatever}

This creates a single trigger with three states. The first state is active to begin - once it's matched, the second state becomes active and the first state is no longer matched. Once 2 matches, 3 is active. Then it loops round. So if any of the lines are optional, this approach won't work, but if they're not, you're good.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
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