<?xml version="1.1" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on 星期六, 三月 07, 2009, 9:05 下午 -->
<!-- MuClient version 4.37 -->

<!-- Plugin "color_chat" generated by Plugin Wizard -->

<muclient>
<plugin
   name="color_chat"
   author="Nick Gammon"
   id="1c6f23705043cda566f01135"
   language="Lua"
   purpose="抓取聊天訊息至另外的視窗"
   date_written="2009-03-07 20:58:07"
   requires="4.08"
   version="1.0"
   >
<description trim="y">
<![CDATA[
   可以把聊天信息按照原來的顏色抓取到另外的視窗，參考Nick Gammon的版本製作。
   使用前要新建一個遊戲視窗，名稱需與下方程式碼中「chat_world = ""」雙引號中的名稱相同(可自行修改)
   ip地址為0.0.0.0，並且和該遊戲檔案(*.mcl)置於同一個資料夾下。
   omit_from_output="y" 表示在主視窗中不顯示聊天信息，="n" 表示顯示聊天信息。
   要增加或減少頻道請修改對應的trigger。
   參考的英文原版地址為：http://w...content-available-to-author-only...m.au/forum/?id=7991
]]>
</description>

</plugin>

<!--  Triggers  -->

<triggers>
  <trigger
   enabled="y"
   match="^(&gt;)*( )*(.*偷偷的告訴|〔隊伍頻道〕|大呼：|＄友克鑫拍賣|【聖殿八卦|.*\)說道：|你的技能|你技能中的|.*頻道－|【閒聊)"
   omit_from_output="n"
   regexp="y"
   script="color_chats"
   sequence="100"
  >
  </trigger>
</triggers>

<!--  Script  -->


<script>
<![CDATA[
chat_world = "sanc_name"
local first_time = true

function color_chats (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
    w:ColourTell ("silver", "", os.date ("[%H:%M:%S] "))
    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

end -- function redirect 
]]>
</script>
</muclient>