Advertisement
Hitman69

Chat Separator FS RuP

Oct 4th, 2014
319
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 3.70 KB | None | 0 0
  1. <?xml version="1.0" encoding="iso-8859-1"?>
  2. <!DOCTYPE muclient>
  3. <!-- Saved on Saturday, June 30, 2007, 10:48  -->
  4. <!-- MuClient version 4.13 -->
  5.  
  6. <!-- Plugin "Chat_Redirector" generated by Plugin Wizard -->
  7.  
  8. <!--
  9. Edit plugin and change "chat_world" variable to be the name of the
  10. world you want chats to go to.
  11. -->
  12.  
  13. <muclient>
  14. <plugin
  15.   name="Chat_Redirector"
  16.   author="Nick Gammon"
  17.   id="cb84a526b476f69f403517da"
  18.   language="Lua"
  19.   purpose="Redirects chat messages to another world"
  20.   date_written="2007-06-30 10:45:35"
  21.   requires="4.08"
  22.   version="1.0"
  23.   >
  24. <description trim="y">
  25. <![CDATA[
  26. Redirects chats to the specified world.
  27.  
  28. Add or modify "chat" triggers to capture different sorts of message.
  29.  
  30. Change the variable "chat_world" to be the name of the world chats are to go to.
  31. ]]>
  32. </description>
  33.  
  34. </plugin>
  35.  
  36. <!--  Triggers  -->
  37.  
  38. <triggers>
  39.  
  40.   <trigger
  41.   enabled="y"
  42.   match="^You (page|page-pose), (.*?)$"
  43.   omit_from_output="n"
  44.   omit_from_log="y"
  45.   regexp="y"
  46.   script="redirect"
  47.   sequence="100"
  48.  >
  49.   </trigger>
  50.  
  51.  
  52.   <trigger
  53.   enabled="y"
  54.   match="^Somewhere on the muck\, (.*?)connected\.$"
  55.   omit_from_output="n"
  56.   omit_from_log="y"
  57.   regexp="y"
  58.   script="redirect"
  59.   sequence="100"
  60.  >
  61.   </trigger>
  62.  
  63.  
  64.   <trigger
  65.   enabled="y"
  66.   match="^(\<Inside Your Womb\> |)\<OOC\> (.*?)$"
  67.    omit_from_output="n"
  68.    regexp="y"
  69.    script="redirect"
  70.    sequence="100"
  71.   >
  72.   </trigger>
  73.  
  74.  
  75.   <trigger
  76.   enabled="y"
  77.   match="^\[Page\] (.*?)$"
  78.   omit_from_output="n"
  79.   omit_from_log="y"
  80.   ignore_case="y"
  81.   regexp="y"
  82.   script="redirect"
  83.   sequence="100"
  84.  >
  85.   </trigger>
  86.  
  87.  
  88.   <trigger
  89.   enabled="y"
  90.   match="^\[(Zephyr Inc|Promethean|RSX Solutions|Adaptable Folk|Apostate|Clever Folk|Graceful Folk|Growing Folk|Heavy Folk|Shelled Folk|Small Folk|Water Folk)\] (.*?)$"
  91.   omit_from_output="y"
  92.   omit_from_log="y"
  93.   ignore_case="y"
  94.   regexp="y"
  95.   script="redirect"
  96.   sequence="100"
  97.  >
  98.   </trigger>
  99.  
  100.  
  101.   <trigger
  102.   enabled="y"
  103.   match="^\[(writing|wc|Judge|Public|Lfg|Auction|Badges|Pickup|Bile|Science|Newbie|Market|Tick|Update|Radio|Rp|Bitch|FS42|Cc|SYSTEM|Guard|Tg|Sports|Nano|Links|Arcana|MMO|Theme|game|Politics|keepalive)\] (.*?)$"
  104.   omit_from_output="y"
  105.   omit_from_log="y"
  106.   ignore_case="y"
  107.   regexp="y"
  108.   script="redirect"
  109.   sequence="100"
  110.  >
  111.   </trigger>
  112.  
  113.   <trigger
  114.   enabled="y"
  115.   match="^(TECH|PDEV)\> (.*?)$"
  116.    omit_from_output="y"
  117.    omit_from_log="y"
  118.    ignore_case="y"
  119.    regexp="y"
  120.    script="redirect"
  121.    sequence="100"
  122.   >
  123.   </trigger>
  124.  
  125. </triggers>
  126.  
  127. <!--  Script  -->
  128.  
  129.  
  130. <script>
  131. <![CDATA[
  132. re =rex.new("(.*?)(?= \-)")
  133. s , e, t = re:match(WorldName())
  134.  
  135. chat_world =  string.format("Chat Window - %s",string.sub(WorldName(),s,e))
  136. local first_time = true
  137.  
  138. function redirect (name, line, wildcards, styles)
  139.  
  140.  -- try to find "chat" world
  141.  local w = GetWorld (chat_world)  -- get "chat" world
  142.  
  143.  -- if not found, try to open it
  144.  if first_time and not w then
  145.    local filename = GetInfo (67) .. chat_world .. ".mcl"
  146.    Open (filename)
  147.    w = GetWorld (chat_world)  -- try again
  148.    if not w then
  149.      ColourNote ("white", "red", "Can't open chat world file: " .. filename)
  150.      first_time = false  -- don't repeatedly show failure message
  151.    end -- can't find world
  152.  end -- can't find world first time around
  153.  
  154.  if w then  -- if present
  155.    for _, v in ipairs (styles) do
  156.      w:ColourTell (RGBColourToName (v.textcolour),
  157.                    RGBColourToName (v.backcolour),
  158.                    v.text)  
  159.    end -- for each style run
  160.    w:Note ("")  -- wrap up line
  161.  
  162.  end -- world found
  163.  
  164. end -- function redirect
  165.  
  166. ]]>
  167. </script>
  168.  
  169.  
  170. </muclient>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement