Entirely depends on how your mud handles those things. If it sends them (or can be told to) all on one line, then lets the client wrap the text, its really easy. If it does like where I play and wraps it to a fixed column... You're hosed. Well, not really, but it gets *way* more complicated, since there is no such thing as a multi-line, "Keep finding lines until you see this line!", type trigger in Mushclient. Nick is paranoid about the potential for infinite loops and other problems, so instead of having a, "stop looking after x lines", as a safe guard, he used a, "I am expecting **exactly** x lines." system. Other clients treat incoming text and triggers in a very different way, so can deal with these things better, though with their own problems that can arise due to not being specific enough.
The triggers and code I use, and which "usually" work, as long as some admin doesn't spoof things or some clown doesn't put a line in mudmail or a board that contains the same types of info, is as follows:
<triggers>
<trigger
custom_colour="17"
enabled="y"
group="channels"
keep_evaluating="y"
match="^(\d\d:\d\d\s)?([(bs|ooc)])(.*)"
name="bs"
regexp="y"
script="setcolorgrab"
sequence="5"
other_text_colour="#0953FF"
other_back_colour="#661C00"
>
</trigger>
<trigger
custom_colour="17"
enabled="y"
group="channels"
keep_evaluating="y"
match="^(\d\d:\d\d\s)?([aod])(.*)"
name="aod"
regexp="y"
script="setcolorgrab"
sequence="5"
other_text_colour="#FEF7CD"
other_back_colour="#000001"
>
</trigger>
<trigger
custom_colour="17"
enabled="y"
group="channels"
keep_evaluating="y"
match="^(\d\d:\d\d\s)?([arena])(.*)"
name="arena"
regexp="y"
script="setcolorgrab"
sequence="5"
other_text_colour="#E0AF2E"
>
</trigger>
<trigger
custom_colour="17"
enabled="y"
group="channels"
keep_evaluating="y"
match="^(\d\d:\d\d\s)?([bardic])(.*)"
name="bardic"
regexp="y"
script="setcolorgrab"
sequence="5"
other_text_colour="moccasin"
other_back_colour="#5E2F0D"
>
</trigger>
<trigger
custom_colour="17"
enabled="y"
group="channels"
keep_evaluating="y"
match="^(\d\d:\d\d\s)?([cleric])(.*)"
name="cleric"
regexp="y"
script="setcolorgrab"
sequence="5"
other_text_colour="#FFFBD9"
other_back_colour="#000001"
>
</trigger>
<trigger
custom_colour="17"
enabled="y"
group="channels"
keep_evaluating="y"
match="^(\d\d:\d\d\s)?([druid])(.*)"
name="druid"
regexp="y"
script="setcolorgrab"
sequence="5"
other_text_colour="#CEFFCE"
other_back_colour="#000001"
>
</trigger>
<trigger
custom_colour="17"
enabled="y"
group="channels"
keep_evaluating="y"
match="^(\d\d:\d\d\s)?([game])(.*)"
name="Game"
regexp="y"
script="setcolorgrab"
sequence="5"
other_text_colour="gold"
other_back_colour="midnightblue"
>
</trigger>
<trigger
custom_colour="17"
enabled="y"
group="channels"
keep_evaluating="y"
match="^(\d\d:\d\d\s)?([healer])(.*)"
name="healer"
regexp="y"
script="setcolorgrab"
sequence="5"
other_text_colour="#D9FFF7"
other_back_colour="#000001"
>
</trigger>
<trigger
custom_colour="1"
enabled="y"
group="channels"
keep_evaluating="y"
match="^(\d\d:\d\d\s)?([hero])(.*)"
name="Hero"
regexp="y"
script="setcolorgrab"
sequence="5"
>
</trigger>
<trigger
custom_colour="8"
enabled="y"
group="channels"
keep_evaluating="y"
match="^(\d\d:\d\d\s)?([newbie])(.*)"
name="Newbie"
regexp="y"
script="setcolorgrab"
sequence="5"
>
</trigger>
<trigger
custom_colour="17"
enabled="y"
group="channels"
keep_evaluating="y"
match="^(\d\d:\d\d\s)?([rp])(.*)"
name="rp"
regexp="y"
script="setcolorgrab"
sequence="5"
other_text_colour="bisque"
other_back_colour="#000001"
>
</trigger>
<trigger
custom_colour="9"
enabled="y"
group="channels"
keep_evaluating="y"
match="^(\d\d:\d\d\s)?([sales])(.*)"
name="Sales"
regexp="y"
script="setcolorgrab"
sequence="5"
>
</trigger>
<trigger
enabled="y"
group="channels"
keep_evaluating="y"
match="^()(\S{1,})(.*)"
name="General2"
regexp="y"
script="setcolorgrab"
sequence="6"
>
</trigger>
<trigger
enabled="y"
group="channels"
keep_evaluating="y"
match="^()([(gossip|events|ghost|Auctioneer)])(.*)"
name="General"
regexp="y"
script="setcolorgrab"
sequence="7"
>
</trigger>
</triggers>
sub setcolorgrab (trigname, output, wildcards)
dim exptemp
dim CheckList
CheckList = "[gossip],[bs],[ooc],[aod],[events],[druid],[healer],[bardic],[newbie],[sales],[hero],[cleric],[rp],[arena]"
exptemp = "^" & space(len(trigname) + 4) & "(\S*)(.*)" '***
dim temp, temp2, count
temp = split(CheckList,",")
temp2 = 1
if instr(wildcards(2), ":") then
temp2 = 0
else
for count = 0 to ubound(temp)
if instr(wildcards(2),temp(count)) then
temp2 = 0
exit for
end if
next
end if
if trigname <> "General2" or (trigname = "General2" and temp2) then
addtrigger "colorcode", exptemp, "", 1065, gettriggerinfo(trigname,19), 0, "", "SendWindow"
if gettriggerinfo(trigname,19) = 16 then
SetTriggerOption "colorcode", "custom_colour", 17
settriggeroption "colorcode", "other_text_colour", gettriggeroption(trigname, "other_text_colour")
settriggeroption "colorcode", "other_back_colour", gettriggeroption(trigname, "other_back_colour")
end if
end if
end sub
Basically, any line you want to capture you set up like the lines with a 'sequence="5"', so that the color you want is automatically used for the first line. This trigger also calls the "setcolorgrab" script, which checks to see what color was last used, then sets a new trigger called "colorcode" which will capture any additional lines and color them the same way. When a line is recieved that has no indent in it, another trigger fires to set this same trigger so it doesn't change the line color when it sees one. This "assumes", in my case, that the line is indented, and by the length of the channel name (see the line with '*** above). So, the following is what channels looks like on my mud:
[events]: Glug drowns beneath the ocean waves, as he desperately
tries to swim!
[gossip] Fred: That Glug... When will the fool ever learn how to
swim?
You would almost certainly have to make adjustments to the '*** line to reflect how your mud indents lines in tells, etc. If it doesn't.... Then the problem is going to be a lot harder to solve. |