Hi, I'm trying to filter out the following to a new window:
Quote: =====================<+CDB Info for Jan (1473) - Male PC>=====================
Fullname: Jan Marbrand
Family: Son of Ser Joslan Marbrand and Janysa Falwell. Unmarried.
Age: 22 (b. 9-11-140) Religion: The Seven
House: Marbrand Allegiance: Marbrand
Region: The Westerlands Location: King's Landing
------------------------------------------------------------------------------
Status: A scion of a lesser lordly house.
Title: Knight
------------------------------------------------------------------------------
Hair: Dark Auburn Height: 1.88m/6'02"
Eyes: Grey Weight: 80kg/176lbs
Shortdesc: A rangy young man with dark auburn hair and grey eyes, clad in
simple but fine clothing.
==============================================================================
This is my code:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Thursday, May 31, 2012, 4:48 PM -->
<!-- MuClient version 4.73 -->
<!-- Plugin "CBDRedirect" generated by Plugin Wizard -->
<muclient>
<plugin
name="CBDRedirect"
author="NY"
id="2a58766aa2f7611113dbbcbc"
language="Lua"
purpose="To redirect CDB"
date_written="2012-05-31 16:48:13"
requires="4.73"
version="1.0"
>
</plugin>
<!-- Triggers -->
<triggers>
<trigger
enabled="y"
match="CDB"
omit_from_output="y"
regexp="y"
script="redirect"
sequence="100"
>
</trigger>
<trigger
enabled="n"
match="*"
omit_from_output="y"
script="redirect"
name="multi_line_chat"
sequence="10"
>
</trigger>
</triggers>
<!-- Script -->
<script>
<![CDATA[
chat_world = "BoD cdb"
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
-- 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 -- world found
end -- function redirect
]]>
</script>
</muclient>
I can get it to filter the text I want, but after that it filters everything else coming from the 'main' world. Am I missing a command to switch the multi-line filter off?
Thanks |