OK, still having a little trouble with the multi-line thing. The channel lines that come out don't have anything to wrap them with, so from what I understand I should make a new script file with this.
I currently have these two triggers:
<triggers>
<trigger
custom_colour="11"
enabled="y"
group="channelcolors"
make_bold="y"
match="^(\<|\{|\[)(arena|chat|fflchat|gamerchat|genechat|mentor|retro|sales)(\>|\}|\])\: .+$"
regexp="y"
sequence="100"
>
</trigger>
</triggers>
<triggers>
<trigger
custom_colour="11"
enabled="y"
group="channelcolors"
make_bold="y"
match="^.+ (\<|\{|\[)(arena|chat|fflchat|gamerchat|genechat|mentor|retro|sales)(\>|\}|\])\: .+$"
regexp="y"
sequence="100"
>
</trigger>
</triggers>
So they work fine and cover all of the stuff that comes out of the channels except for multi-line. Now for multi-line I believe I'm supposed to use something a trigger and a script?
<trigger
enabled="n"
match="*"
script="redirect"
name="multi_line_chat"
sequence="10"
>
</trigger>
<script>
<![CDATA[
chat_world = "retro"
local first_time = true
function redirect (name, line, wildcards, styles)
-- try to find "chat" world
local w = GetWorld (chat_world) -- get "chat" world
-- if not found, try to open it
if first_time and not w then
local filename = GetInfo (67) .. chat_world .. ".mcl"
Open (filename)
w = GetWorld (chat_world) -- try again
if not w then
ColourNote ("white", "red", "Can't open chat world file: " .. filename)
first_time = false -- don't repeatedly show failure message
end -- can't find world
end -- can't find world first time around
if w then -- if present
for _, v in ipairs (styles) do
w:ColourTell (RGBColourToName (v.textcolour),
RGBColourToName (v.backcolour),
v.text)
end -- for each style run
w:Note ("") -- wrap up line
end -- world found
-- if ends with quote, end of multi-line chat
if line:sub (-1) == '"' then
EnableTrigger ("multi_line_chat", false) -- no more lines to go
else
EnableTrigger ("multi_line_chat", true) -- capture subsequent lines
end -- if
end -- function redirect
]]>
</script>
So the trigger...calls the script? Is that it? I know I'm probably doing something wrong here but I've never worked with scripting before and have no idea what's going on; I'm not trying to send the chats to a new window, just color them the same way as the first 2 triggers.
Thanks. |