Yeah, its working beautifully. Until we have scrolling miniwindows, the dummy window will work really well. I am not even sure if I will use a miniwindow even if it becomes available because I have had such a tough time with it.
This may be the wrong forum, but is there a somewhat easy way to replace the dummy window with a miniwindow?
Also, I've been having a bit of trouble. I'm not sure if its just a limitation of the presented output, but when the group command is called, I am only able to (currently) detect the . denoting the last member of the group, then its a blank line, then the prompt. Something like this:
A crazy-eyed woman [******] (guarding) (guarded), leading:
a wheat-haired man [******] (guarding),
a comely-faced man [******] (guarded),
a golden-haired man [******],
a lithe man [******].
<prompt>
It also has the quirk of capturing everything until the first timer of group executes, I am fairly sure just making it also send the group command when I type chatson will be an easy work around though.
So, is there a better way I could be using triggers to deal with the blank lines. I've included the plugin thusfar below.
The code
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Saturday, June 30, 2007, 10:48 -->
<!-- MuClient version 4.13 -->
<!-- Plugin "Chat_Redirector" generated by Plugin Wizard -->
<muclient>
<plugin
name="Chat_Redirector"
author="Nick Gammon"
id="cb84a526b476f69f403517da"
language="Lua"
purpose="Redirects Things and Notifies to Another window"
date_written="2007-06-30 10:45:35"
requires="4.08"
version="1.0"
>
<description trim="y">
<![CDATA[
Redirects Triggered Info to another Window named soichats
]]>
</description>
</plugin>
<!-- Triggers -->
<triggers>
<!-- Captures Notify message and sends it to dummy world via redirect script -->
<trigger
name="chats_trigger1"
enabled="y"
match="^[(.*?)$"
regexp="n"
script="redirect"
sequence="100"
>
</trigger>
<!-- Captures Triggering Group message and toggles milti_line_chat trigger if applicable -->
<trigger
name="chats_trigger2"
enabled="y"
match="^(.*?) leading\:$"
regexp="y"
omit_from_output="y"
script="redirect"
sequence="100"
>
</trigger>
<trigger
enabled="n"
match="*"
script="redirect"
omit_from_output="y"
name="multi_line_chat"
sequence="10"
>
</trigger>
</triggers>
<!-- Aliases -->
<aliases>
<alias
name="chatson"
match="chatson"
enabled="y"
send_to="12"
sequence="100"
>
<send>
EnableTrigger ("chats_trigger1", true)
EnableTrigger ("chats_trigger2", true)
EnableTrigger ("multi_line_chat", true)
EnableTimer ("group", true)
Note("Chats are Enabled.")
</send>
</alias>
<alias
name="chatsoff"
match="chatsoff"
send_to="12"
enabled="y"
sequence="100"
>
<send>
EnableTrigger ("chats_trigger1", false)
EnableTrigger ("chats_trigger2", false)
EnableTrigger ("multi_line_chat", false)
EnableTimer ("group", false)
Note("Chats are Disabled.")
</send>
</alias>
</aliases>
<!-- End Aliases -->
<!-- Timers -->
<timers>
<timer
name="group"
enabled="y"
second="10.00"
omit_from_output="y"
>
<send>
group
</send>
</timer>
</timers>
<!-- Script -->
<script>
<![CDATA[
chat_world = "soichats"
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
-- if ends with . 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>
|