|
celticshiva Newbie
Joined: 30 Oct 2002 Posts: 4
|
Posted: Wed Oct 30, 2002 4:45 pm
Variable Multiline CAptures |
Is there a way to know how many lines ago a triggering event was triggered? The mud I'm on (retromud) sends multiple lines if the chat message is really long. I'd like to be able to send the whole message to my chat child window rather than just the first line.
I got the CAP working for one line, and I know I can put a variable in to capture more than one line.. I just need to be able to know somehow that there is more than one line.
Long lines do something line this;
Aspencia [chat]: This is a sample of a chat =) just so you know
what I'm asking...
(5 spaces indent on the extra lines.) |
|
|
|
Emit Magician
Joined: 24 Feb 2001 Posts: 342 Location: USA
|
Posted: Wed Oct 30, 2002 5:03 pm |
heres what i would do:
#tr {%w ~[chat]:} {#cap @window}
#tr {^ *} {#cap @window}
(that should be five spaces between ^ and *)
where @window is the value of the window you want to send it to. this works as long as the only output from the mud indented five spaces is an extended chat. |
|
|
|
Lalaynya Wanderer
Joined: 23 Aug 2002 Posts: 96
|
Posted: Wed Oct 30, 2002 6:15 pm |
Check out My channel capture script in the finished scripts forum. It demonstrates how to do this (well, one way, at least!)
It was written for Achaea, but it's pretty simple to modify for other muds. |
|
|
|
celticshiva Newbie
Joined: 30 Oct 2002 Posts: 4
|
Posted: Wed Oct 30, 2002 7:15 pm |
emit - tried that, its not going to work, as it often picks up room descriptions too. Some guild rooms have command lists that are indented. Also I'd like them separated into their own windows (but not neccesary)
Lalynya: It ALMOST works, but I don't get a prompt after each that. The prompt only appears if I do something. So if I get a chat, then I go into the next room, the whole room desc will appear in my chat log =Z. Still its a start!
[EDIT]
Okay I edited this several times while I worked on it.. and I solved it.
In the cap class
$tr {^ *} {$alarm +1 {$class cap 0};$cap @cap;$gag}
($ replaces # because I needed to use the # symbol literally in one of my triggers)
This does its thing.. waits a second to make sure the whole chat gets through, then turns itself off. |
|
|
|
Daagar Magician
Joined: 25 Oct 2000 Posts: 461 Location: USA
|
Posted: Wed Oct 30, 2002 10:35 pm |
An alternative way which works really well is to have it capture by color. This requires of course that you use ANSI colors.
As an example:
#TR {%e[31m(%w) ~[chat~]: (%*)} {#GAG; #CAP @window}
#COND {%e[31m(%*)} {#GAG; #CAP @window}
That's it! Make sure you have ANSI Trigger set on the option tab.
What does this do? It first watches for any line in red that has "mudname [chat]:" in it, and captures that to a window. Then it watches for all lines that come after that are red, and captures those as well. It'll automatically stop capturing lines as soon as it receives the first non-red line (blank or otherwise).
Of course, this will break down if the first line you get after a chat is another red line. You may have to adjust your colors to prevent this from happening. |
|
|
|
celticshiva Newbie
Joined: 30 Oct 2002 Posts: 4
|
Posted: Thu Oct 31, 2002 3:25 am |
Thanks Daagar. Its a good idea, but this mud dosn't have customizable chat colours. The alarm thing worked, so I'm going to set it up again (I accidentally crashed ZMUD with an infinate loop when I did a script to get my race oops, so I lost everything)
|
|
|
|
Valdar Novice
Joined: 17 May 2003 Posts: 30 Location: USA
|
Posted: Sat May 17, 2003 8:52 pm |
Actually celticshiva, if you play on RetroMUD you can change chat line color... check the help color help file. for chat lines use "color channels <color>" (I have my chats set to hi_cyan so i would use color "channels hi_cyan") Hope it helps :)
|
|
|
|
|
|