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


Joined: 30 Oct 2002
Posts: 4

PostPosted: 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.)
Reply with quote
Emit
Magician


Joined: 24 Feb 2001
Posts: 342
Location: USA

PostPosted: 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.
Reply with quote
Lalaynya
Wanderer


Joined: 23 Aug 2002
Posts: 96

PostPosted: 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.
Reply with quote
celticshiva
Newbie


Joined: 30 Oct 2002
Posts: 4

PostPosted: 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.
Reply with quote
Daagar
Magician


Joined: 25 Oct 2000
Posts: 461
Location: USA

PostPosted: 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.
Reply with quote
celticshiva
Newbie


Joined: 30 Oct 2002
Posts: 4

PostPosted: 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)
Reply with quote
Valdar
Novice


Joined: 17 May 2003
Posts: 30
Location: USA

PostPosted: 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 :)
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