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


Joined: 05 May 2002
Posts: 1

PostPosted: Sun May 05, 2002 11:49 pm   

Multiple line trigger problem
 
Hello. I am writing a script to capture information about equipment to a database. My main problem is that some of the information is displayed in paragraph form, possibly broken up across lines.

Basically I am trying to combine these three triggers into one:

#TRIGGER {Strength of (%d)} ...

#TRIGGER {Strength of$(%d)} ...
#TRIGGER {Strength$of (%d)} ...


I have tried the following, and none of them work. Apparently the $ symbol does not function when inside of a list of options for a string to match.

#TRIGGER {Strength{$| }of{$| }(%d)} ...

#TRIGGER {Strength{ of |$of | of$}(%d)} ...


Is there any neater way to do this than have 3 triggers, one for every line break possibility? Some things even have 3 spaces, and so 4 possible arrangements of line breaks.

On a side note, is there a way to have a trigger that will fire multiple times within a line? So that...

Foo is 5, Bar is 8


being the text in the mud would cause this trigger

#TRIGGER {{Foo|Bar} is (%d)} ...


to fire twice, once with 5 in %1, once with 8?

Any help at all will be most appreciated, thanks.

-illusion
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon May 06, 2002 1:31 am   
 
For the second question, the easiest way would be to make two triggers instead of one.

#TR {Foo is (%d)}
#TR {Bar is (%d)}

These will both fire on that sample line, with the appropriate numbers in %1.

As for the first question, three triggers is your best bet. You might be able to do it with one using trigger on prompt instead of trigger on newline, but I haven't tested it, don't recommend it, and don't really expect it to work.

LightBulb
Vague questions get vague answers
Reply with quote
Sildaren
Wanderer


Joined: 19 Jul 2001
Posts: 59
Location: Germany

PostPosted: Mon May 06, 2002 5:21 pm   
 
Might be possible to collect the 'broken' lines in a variable, while #GAGing them on the screen,
and using #SHOW at the end of the sequence to display all of it in one line (so one trigger can work on it).

You'd need to find a pattern to start 'string collection', and one that tells the script that all the info has been received.
If or not this approach works completly depends on the mud output.
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