Posted by
| Nick Gammon
Australia (23,162 posts) Bio
Forum Administrator |
Message
| Yes you can do that. First I would make a trigger that matches on the "who" line regardless of colour.
Then look at one of the relevant (PK) lines by double-clicking a word in it, go to the menu Display -> Text Attributes -> Line Info. You should see something like this:
1: Offset = 0, Length = 12, Text = "Swordsman <"
No action.
Flags = Hilite: no, Underline: no, Blink: no, Inverse: no, Changed: no
Foreground colour ANSI : 7 (White)
Background colour ANSI : 0 (Black)
2: Offset = 12, Length = 2, Text = "PK"
No action.
Flags = Hilite: no, Underline: no, Blink: no, Inverse: no, Changed: no
Foreground colour ANSI : 1 (Red)
Background colour ANSI : 0 (Black)
3: Offset = 14, Length = 5, Text = ">Nick"
No action.
Flags = Hilite: no, Underline: no, Blink: no, Inverse: no, Changed: no
Foreground colour ANSI : 7 (White)
Background colour ANSI : 0 (Black)
19 columns in 3 style runs
------ (end line information) ------
In this example you can see that the letters "PK" are in the second style run for the line (in your MUD's case it might be the third or fourth, which is why you do this).
Knowing this, you can then make a trigger script along these lines...
if getlineinfo (getlinesinbuffercount, 11) >= 3 then
if getstyleinfo (getlinesinbuffercount, 2, 14) = 128 and _
getstyleinfo (getlinesinbuffercount, 2, 15) = 0 and _
getstyleinfo (getlinesinbuffercount, 2, 1) = "PK" then
ColourNote "white", "red", wildcards (10)
else
ColourNote "white", "black", wildcards (10)
else
ColourNote "white", "black", wildcards (10)
end if
What this is going to do is re-colour the line if it is red on black, has "PK" in it, for style number 2 on the line.
You would make the trigger omit the original line from output, and use the script to redraw it. You need to use a script file and not "send to script" or you won't see the new line.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|