Well perhaps I didn't explain myself very well. :P
First let's set up a test. Press Ctrl+Shift+F12 (Game menu -> Test Trigger) and enter this:
Nick says B\1B[34mO\1B[31mO\1B[33mOO\1B[37mO !
Press Ctrl+Enter to get the blank lines.
Now when you hit OK you should see this in the output window:
(With the O's in different colours).
Now let's make a trigger to match that:
<triggers>
<trigger
enabled="y"
match="Nick says BOOOOO !"
script="my_trigger"
sequence="100"
>
</trigger>
</triggers>
Now we need a script to handle my_trigger, which you can put in your script file:
require "getstyle"
function my_trigger (name, line, wildcards, styles)
-- find location of word
col = string.find (line, "OOOOO")
if not col then
return
end -- word not found
for i = col, col + 4 do
-- get style at that location
style = GetStyle (styles, i)
-- display it
print ("column", i, "is in colour", RGBColourToName (style.textcolour))
end -- for
end -- my_trigger
When you hit Ctrl+Shift+F12 again and send the test data you should now see:
Nick says BOOOOO !
column 12 is in colour navy
column 13 is in colour maroon
column 14 is in colour olive
column 15 is in colour olive
column 16 is in colour silver
That is the basic idea.