 |
zendril Newbie
Joined: 23 Jan 2003 Posts: 4 Location: USA
|
Posted: Thu Jan 23, 2003 6:19 am
trigger to capture multiline *help* |
I want to be able to capture a chat channel that can be anywhere from 1 line to 4 lines long, and send it to a new window. The channel will always have in it the name surrounded by angle brackets, each line after the first starts with 4 spaces.
Here is an example:
Noname <krypt> here is the first line and
here is the second line
and the third line
How in the world is this possible? I've tried all kinds of variations and seem to get strange and inconsistent results. I have
no problem sending things to a new window, etc. but how do i set this up so that it will trigger on a single line, *or* two lines *or* three lines.. you get the point.
oh, and i'm a good boy and have a registered 6.4 running
thanks :) |
|
|
 |
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Thu Jan 23, 2003 6:58 am |
zMUD (by default) indents 3 spaces when it does the wordwrapping (see Preferences/General/Wordwrap), so this is probably a single line from the MUD. Try just using a one-line trigger and see what happens.
#TR {~<krypt~>} {#CAPTURE Krypt}
LightBulb
Senior Member |
|
|
 |
TonDiening GURU

Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Thu Jan 23, 2003 7:02 am |
What normally comes after a chat line?
A blank line? Something that doesn't have 4 spaces?
#TRIGGER "ChatCapture" {^%w ~<%w~>} {#CAPTURE Social;#TEMP {^{^ }} {#STATE ChatCapture 0}}
#COND "ChatCapture" {^ } {#CAPTURE Social} {looppat|param=3}
I think that will work. It looks for something that doesn't start with white space to return its state back to zero.
Very much like the capture inventory example:here.
Ton Diening |
|
|
 |
zendril Newbie
Joined: 23 Jan 2003 Posts: 4 Location: USA
|
Posted: Thu Jan 23, 2003 3:06 pm |
thanks for both the replies. lemme start with lightbulb, that could very well be. I will have to look into it tonight. i'm somewhat unsure of this one tho because for a different 'chat line' and for tells, there is no spacing on the next line.
now, for tondiening:
there is just another line that follows the chat line and it starts at the first character (no blank line and no spaces to start)
that is sort of what i'm asking about and leaning towards is how do i capture a line, move to the next, if indented capture that line, move to the next, if not indented reset the state of the whole trigger.
thanks again and i'll be working at it again tonight, please keep me updated if you think of anything new :) |
|
|
 |
zendril Newbie
Joined: 23 Jan 2003 Posts: 4 Location: USA
|
Posted: Thu Jan 23, 2003 3:16 pm |
i looked at the link you posted tondiening. I was looking over that thing for what seemed like hours last night. Somehow i totally skipped over that section, i don't even remember seeing it.
I think what you posted will work (assuming that zmud isn't the cause of the indentation as lightbulb suggested). Probably without any modification even. :) Now my problem is that i have to wait all day to get home and try it ;)
thanks again. |
|
|
 |
zendril Newbie
Joined: 23 Jan 2003 Posts: 4 Location: USA
|
Posted: Thu Jan 23, 2003 11:53 pm |
quote:
#TRIGGER "ChatCapture" {^%w ~<%w~>} {#CAPTURE Social;#TEMP {^{^ }} {#STATE ChatCapture 0}}
#COND "ChatCapture" {^ } {#CAPTURE Social} {looppat|param=3}
hrm, it seems to be having a problem with the:
{^{^ }}
the syntax checker is having fits..
if i take out the inner {^ }
and replace it, it doesn't have a problem, but we kinda need that in there somehow :)
it just doesn't like having braces inside of braces.. so whats the alternative?
thanks (soooo close) |
|
|
 |
TonDiening GURU

Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Fri Jan 24, 2003 5:20 am |
Tested it and it works if you ignore the
syntax warning.
If you don't like ignoring the syntax warning
try:
#EXECUTE "#TEMP {^{^ }} {#STATE ChatCapture 0}"
Ton Diening |
|
|
 |
|
|