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


Joined: 03 Feb 2003
Posts: 5
Location: Germany

PostPosted: Mon Feb 03, 2003 2:03 pm   

No idea if anyone asked this before
 
I have a bunch of triggers that will capture different communication channels and tests, but had no luck to capture multiple lines of text, because the mud wraps the text if the first line is longer than 75 chars.

The mud output looks like this:

XXX tells you: blablablabla bla bla bla bla
bla bla bla bla bla bla bla bla

Same goes for all channels.
Is there a way to capture all the lines and place them in proper windows where they belong? (i have separate windows for each channels and for tells ...)
initial trigger #tr {^%w tells you:} {#capture Tell} works perfectly for the first line :)
Reply with quote
Killfile
Novice


Joined: 30 Sep 2002
Posts: 32
Location: USA

PostPosted: Mon Feb 03, 2003 2:33 pm   
 
Well this might help you out...

Most muds force a gramerical construct... so tells look like (in zmud speak)

%w tells you '*.'

If you check for that last quote and period at the end of the line you could chain it to a conditional. I.E. if I see the .' as the last two characters do nothing, if I DO execute the capture on the next line I see.... recurse it for multipule lines.



--Killfile
Reply with quote
Mortigan
Newbie


Joined: 03 Feb 2003
Posts: 5
Location: Germany

PostPosted: Mon Feb 03, 2003 2:39 pm   
 
If i had those single quotes i wouldnt have asked this question :)
Thanks for the help in any case.
The output i guess has no quotes. Just the
%w tells you: *

Not even a dot in the end unless the one who tells you typed it
Reply with quote
Emit
Magician


Joined: 24 Feb 2001
Posts: 342
Location: USA

PostPosted: Mon Feb 03, 2003 3:55 pm   
 
if theres absolutely no way to distinguish the second line from the rest of the mud output, then your best approach is is probably to count the characters:

#tr {(%w tells you: *)} {#if (%len(%1) = 75) {#capture Tell;#t+ getnextline}}
#class getnextline
#tr {*} {#capture Tell;#t- getnextline}
#class 0

of course, this will misfire whenever the message is exactly long enough to reach the end of the line but not long enough to wrap.

--------

moon.icebound.net:9000
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Mon Feb 03, 2003 3:58 pm   
 
The spaces at the start if the second line fail to display on the forum correctly, but I can see them. Anyway, you can use those spaces to figure out if you should capture that line too. Example:
#TRIGGER capTells {^%w tells you:} {#CAP Tell}
#COND {^(*)$} {#IF ("%1" =~ "^%s*$") {#CAP Tell} {#STATE capTells 0}} {manual}

Kjata
Reply with quote
Mortigan
Newbie


Joined: 03 Feb 2003
Posts: 5
Location: Germany

PostPosted: Mon Feb 03, 2003 4:49 pm   
 
Works like a dream. Thank you very much.
Reply with quote
Mortigan
Newbie


Joined: 03 Feb 2003
Posts: 5
Location: Germany

PostPosted: Wed Feb 05, 2003 12:30 pm   
 
I found a slight problem with this trigger that i dont know how to fix. If i get two short one line tells in a short time interval, only the first one is captured. the second one seems to be omitted. I think that the trigger actually waits for a line with blank spaces in front to return itself to state 0.
Any idea on how to fix that ?
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Wed Feb 05, 2003 1:01 pm   
 
Change this:
("%1" =~ "^%s*$")

to:
(("%1" =~ "^%s*$") or ("%1" =~ "^%w tells you: *$"))

Kjata
Reply with quote
Mortigan
Newbie


Joined: 03 Feb 2003
Posts: 5
Location: Germany

PostPosted: Mon Feb 17, 2003 1:01 am   
 
Thanks. That did the trick
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