MU* Chatting

Posted by Cbscoob on Tue 04 May 2004 05:48 AM — 10 posts, 34,170 views.

#0
I have a quick question. I started playing on a MU* that uses completely original code, and I'm trying to color the various chat channels so that I can distinguish them easily. However, the problem arises when text carries over to the next line, as when it does so the text returns to that normal gray color, and not the color assigned to it and the color that's shown on the first line of text. The channel colors correctly if there's only line of text, but if there's more than that, it reverts back to gray. Any help? Thanks.
Australia Forum Administrator #1
Your problem is an old one (and a good one). :)

It sounds like the chats lines are ending with a "hard" newline, which then stops the trigger match. The easy way to solve this, if possible, is if the MU* has an option to allow longer lines (ie. defeat its line-wrapping).

MUSHclient will wrap anyway, so you will still see the lines wrapped, and that will get rid of the newline. See if there is a command "linelength" or something like that. If so, set it as high as you can.

Failing that it gets much harder, as you need to work out how to tell the end of a chat, if you can. If, say, the chats end with the " character then the trigger that matches the first line could turn on a second trigger for subsequent lines, which colour all subsequent lines until it gets one with " at the end of it.
#2
Okay, the MU* doesn't offer any such changeable value for line length or anything of the sort. But, the chat does end with ", so how would I go about setting up the dual trigger? I'm a bit of a newb at this stuff, so any help is appreciated. Thanks!
USA #3
Well, first youd paste us some output of the exact text, since specifics are easier to work with than generalities.

However, Bascially, You match on the beginning of a chat group (XXX chats: ") then you have that enable a trigger which matches (") (A Regexp) as well as a trigger to catch EVERYTHING in between. Then youd concatenate the line(s) together. And do whatever parsing...

Erm no. You just want to color, so, isntead of joining them all in a script, you'd merely color all the lines in your EVERYTHING trigger. And then your END trigger as well.

This runs into a bit of problems with someone saying something someone else said:

XXX says "YYY says "Hello, This is a confusing trigger""

However, you can get around that with using some specific regexps.

Begin:
^\w+ says "
Flags: Regexp, Keep Evaluating, Send to Script and I think thats it. Name it something, Ill reference it as Begin.
Send:
Enabletrigger "Middle", 1
EnableTrigger "End", 1

Middle:
.*
Flags: RegExp, Keep Evaluating, Color.
Name it: Middle (you can change to whatever, just make sure everything references the correct things)

End:
"$
IF your mud has trailing spaces after the " you may need to change this to.. say
" $
You can copy your mud output, and we'll be able to let you know.
Flags: Regexp, Keep Evaluating, Color, Send To Script
Send:
Enabletrigger "Middle", 0
EnableTrigger "End", 0

That SHOULD do it. Im sorry these arent XML, I dont have MC on this computer at the moment.

Nick, and others:
Think we should set the sequences to be well, sequential?

Also, will this actually catch ALL of the stuff? The first one will color stuff, then the second will take over, then the last should work as well... I think. I was thinking you might have problems with only certain bits being colored, but now I think itll work again.

Also, Nick, With multiline triggers, cant this all be done in one trigger? Just have :
^XXX Says "(.*\n)+?"$
Or, would that not work? I havent looked into ML triggers much, just a thought though.

Edit: Removed something stupid.
Amended on Wed 05 May 2004 07:55 PM by Flannel
#4
Okay, I input everything as you said, and the only change is that the last " after someone speaks changes to the color that was selected for the text. Here's a sample output of chat text though:

(Chaotes): Oblib says, "Hello Murrk."

That's how all the channels are, and I just want to color each one differently. Thanks again for the help.
USA #5
Erm, The last trigger shouldnt disable begin.

Ive edited the post, to not lead others astray, make that change.

Also, Can you turn trace on (then post the stuff that shows up around the line to be triggered)? And post your Exact triggers (copy them, then paste them here)?
#6
You say, "Asdasd."
TRACE: Matched trigger Begin
951h, 1455m ex-
TRACE: Matched trigger Middle
(Chaotes): Monica says, "Shouldn't be that bad =)"
TRACE: Matched trigger End

That's what shows up around the trigger, and as far as the triggers themselves are concerned, they are input exactly as you mentioned in your previous post.
USA #7
Not to be rude or anything but if thats achaea just type config colour and it will make your life easier *grin*
USA #8
just copy/paste the triggers. Itll make editing and looking for typos/dropped spaces/etc easier.

Also, Can you show some output of a say thats multiple lines? As that is what were trying to accomplish. Although, this should work for one line triggers too I would think.
Amended on Thu 06 May 2004 06:45 PM by Flannel
#9
Saito, you're the man.