The chat redirector that I am currently using works for the most part, it just will not redirect any names with prefixes when someone says anything. The other chat channels all work since they strip out prefixes and just use the name. This is the same chat redirector that was created by Nick Gammon on the MUSH forums.
How can I modify this so that it will capture chat that begins with prefixes? I tried what I thought would work adding a wildcard (.*?) before the name wildcard, but I failed so I removed that trigger.
CODE
<!-- Triggers -->
<triggers>
<trigger
enabled="y"
match="^(\(.+\): )?[A-Za-z]+ (says|say|asks|yells|tells you), ".+"
regexp="y"
script="redirect"
sequence="100"
>
</trigger>
<trigger
enabled="y"
match="^You (tell (.*?)|whisper|say|whisper|whine|sing), ".+"
regexp="y"
script="redirect"
sequence="100"
>
</trigger>
<trigger
enabled="y"
match="^(.*?) (says to|whispers|whines|asks|says) (.*?)\, ".+"
regexp="y"
script="redirect"
sequence="100"
>
</trigger>
<trigger
enabled="n"
match="*"
script="redirect"
name="multi_line_chat"
sequence="10"
>
</trigger>
</triggers>
<!-- Script -->
<script>
<![CDATA[
chat_world = "Chats"
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>
</muclient>
<triggers>
<trigger
enabled="y"
match="^(\(.+\): )?[A-Za-z]+ (says|say|asks|yells|tells you), ".+"
regexp="y"
script="redirect"
sequence="100"
>
</trigger>
<trigger
enabled="y"
match="^You (tell (.*?)|whisper|say|whisper|whine|sing), ".+"
regexp="y"
script="redirect"
sequence="100"
>
</trigger>
<trigger
enabled="y"
match="^(.*?) (says to|whispers|whines|asks|says) (.*?)\, ".+"
regexp="y"
script="redirect"
sequence="100"
>
</trigger>
<trigger
enabled="n"
match="*"
script="redirect"
name="multi_line_chat"
sequence="10"
>
</trigger>
</triggers>
<!-- Script -->
<script>
<![CDATA[
chat_world = "Chats"
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>
</muclient>
