Highlighting whole clantells

by Verithrax

Back to Mechanic's Corner.

Verithrax2005-12-01 03:40:29
I figured out a way of highlighting a clantell in MUSHclient, regardless of its size.

First, create a trigger with the text: (ClanName): *, "*"
That'll catch single line clantells. Set it to your favourite colour. Add a sound if you want.

Then create another trigger: (ClanName): *, "*
That'll catch the first line in multi-line clantells. Set it so that it'll send the following text to script:
QUOTE
world.enabletrigger "Clanmiddle", "1"
world.enabletrigger "Clanend", "1"

This is for VBscript. You can figure it out for other languages. Set the sound and colour for that trigger, and move on.

Then, create a trigger to catch the middle: *
Set the colour for it. MAKE SURE IT'S NOT ENABLED BY DEFAULT, as it'll catch EVERYTHING. Name this one 'Clanmiddle'.

Lastly, create a trigger to catch the last line: *"
Set it so that it sends to script. Its value, in VBscript, is:
QUOTE
world.enabletrigger "Clanmiddle", "0"
world.enabletrigger "Clanend", "0"

Set the colour.

This basically makes sure that everything between the first and last line gets highlighted, colouring entire clantells.
Unknown2005-12-01 03:57:18
Can I ask what's the point when there's CONFIG COLOUR?
Verithrax2005-12-01 04:11:10
QUOTE(Kashim @ Dec 1 2005, 12:57 AM)
Can I ask what's the point when there's CONFIG COLOUR?
230784


Ever have more channels than there are ANSI colours for?
Unknown2005-12-01 04:13:30
Yes, I do.
All my clans are white and I just color the name with a simple trigger.
Unknown2005-12-01 05:00:52
Cool, thanks. I needed a way to add more colors.
Unknown2005-12-01 12:11:47
One problem. What happens when you get something like this?

CODE
(Clanname): Member says, "Person tells you, "Ha ha ha.""


I had channel captures working with only one or two triggers, except for the case where it contained inner quotes. Then, I even got it to work for multiple sets of quotes, but not when there was an odd number (i.e., when someone screwed up and didn't close a quote they opened).
Shiri2005-12-01 12:25:07
QUOTE(Zarquan @ Dec 1 2005, 12:11 PM)
(i.e., when someone screwed up and didn't close a quote they opened).
230975



I.e all the time, since people seem to not want to close them all if it's the end of the line. sad.gif
Tiran2005-12-02 18:31:55
I don't know much about MUSH, but I'm wondering if the default pattern matching isn't glob-style, in which case it has to match the entire line. If that's the case, only the last quote matters. If this isn't the case, then use a regexp, and explicitly mark that the quote has to be at the end of the line, like so:
CODE
^(ClanName): *, "*"$

It's not a perfect solution, since the thing can still be fooled if the server puts a line break after an inner quote, but it doesn't care if it's an even or odd number of quotes then.
If you really want to make sure you have it all, you can check the next line to see if it's a continuation somehow, but that might get a little more complicated, since things occasionally aren't followed by a prompt if it starts coming at you fast enough, or so it seems to me.