Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ MU* Chatting

MU* Chatting

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Cbscoob   (9 posts)  Bio
Date Tue 04 May 2004 05:48 AM (UTC)
Message
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.
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #1 on Tue 04 May 2004 09:59 PM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Cbscoob   (9 posts)  Bio
Date Reply #2 on Wed 05 May 2004 02:30 AM (UTC)
Message
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!
Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #3 on Wed 05 May 2004 03:59 AM (UTC)

Amended on Wed 05 May 2004 07:55 PM (UTC) by Flannel

Message
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.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
Top

Posted by Cbscoob   (9 posts)  Bio
Date Reply #4 on Wed 05 May 2004 04:39 PM (UTC)
Message
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.
Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #5 on Wed 05 May 2004 07:55 PM (UTC)
Message
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)?

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
Top

Posted by Cbscoob   (9 posts)  Bio
Date Reply #6 on Thu 06 May 2004 05:33 PM (UTC)
Message
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.
Top

Posted by Metsuro   USA  (389 posts)  Bio
Date Reply #7 on Thu 06 May 2004 05:54 PM (UTC)
Message
Not to be rude or anything but if thats achaea just type config colour and it will make your life easier *grin*

Everything turns around in the end
Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #8 on Thu 06 May 2004 06:44 PM (UTC)

Amended on Thu 06 May 2004 06:45 PM (UTC) by Flannel

Message
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.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
Top

Posted by Cbscoob   (9 posts)  Bio
Date Reply #9 on Fri 07 May 2004 01:21 AM (UTC)
Message
Saito, you're the man.
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


25,237 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.