Advertisement
Guest User

Untitled

a guest
Dec 31st, 2008
559
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.43 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="Chatnet"
  16. author="Nick Gammon"
  17. id="cb84a526b476fffffffffffa"
  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="^\[chatnet\].*$"
  43. omit_from_output="y"
  44. regexp="y"
  45. script="redirect"
  46. sequence="100"
  47. >
  48. </trigger>
  49.  
  50. <trigger
  51. enabled="y"
  52. match="^\[djnet\].*$"
  53. omit_from_output="y"
  54. regexp="y"
  55. script="redirect"
  56. sequence="100"
  57. >
  58. </trigger>
  59.  
  60. <trigger
  61. enabled="y"
  62. match="^\[tradenet\].*$"
  63. omit_from_output="y"
  64. regexp="y"
  65. script="redirect"
  66. sequence="100"
  67. >
  68. </trigger>
  69.  
  70. <trigger
  71. enabled="y"
  72. match="^\[zotnet\].*$"
  73. omit_from_output="y"
  74. regexp="y"
  75. script="redirect"
  76. sequence="100"
  77. >
  78. </trigger>
  79.  
  80. <trigger
  81. enabled="y"
  82. match="^\[ \].*$"
  83. omit_from_output="y"
  84. regexp="y"
  85. script="redirect"
  86. sequence="100"
  87. >
  88. </trigger>
  89.  
  90. <trigger
  91. enabled="y"
  92. match="^\[ \* \].*$"
  93. omit_from_output="y"
  94. regexp="y"
  95. script="redirect"
  96. sequence="100"
  97. >
  98. </trigger>
  99.  
  100. <trigger
  101. enabled="y"
  102. match="^\[ B=D \].*$"
  103. omit_from_output="y"
  104. regexp="y"
  105. script="redirect"
  106. sequence="100"
  107. >
  108. </trigger>
  109.  
  110. <trigger
  111. enabled="y"
  112. match="^\[ B===D \].*$"
  113. omit_from_output="y"
  114. regexp="y"
  115. script="redirect"
  116. sequence="100"
  117. >
  118. </trigger>
  119.  
  120. <trigger
  121. enabled="y"
  122. match="^\[B=====D\].*$"
  123. omit_from_output="y"
  124. regexp="y"
  125. script="redirect"
  126. sequence="100"
  127. >
  128. </trigger>
  129.  
  130. <trigger
  131. enabled="y"
  132. match="^\[jailnet\].*$"
  133. omit_from_output="y"
  134. regexp="y"
  135. script="redirect"
  136. sequence="100"
  137. >
  138. </trigger>
  139.  
  140. </triggers>
  141.  
  142. <!-- Script -->
  143.  
  144.  
  145. <script>
  146. <![CDATA[
  147. chat_world = "chatnet"
  148. local first_time = true
  149.  
  150. function redirect (name, line, wildcards, styles)
  151.  
  152. -- try to find "chatnet" world
  153. local w = GetWorld (chat_world) -- get "chatnet" world
  154.  
  155. -- if not found, try to open it
  156. if first_time and not w then
  157. local filename = GetInfo (67) .. chat_world .. ".mcl"
  158. Open (filename)
  159. w = GetWorld (chat_world) -- try again
  160. if not w then
  161. ColourNote ("white", "red", "Can't open chat world file: " .. filename)
  162. first_time = false -- don't repeatedly show failure message
  163. end -- can't find world
  164. end -- can't find world first time around
  165.  
  166. if w then -- if present
  167. for _, v in ipairs (styles) do
  168. w:ColourTell (RGBColourToName (v.textcolour),
  169. RGBColourToName (v.backcolour),
  170. v.text)
  171. end -- for each style run
  172. w:Note ("") -- wrap up line
  173.  
  174. end -- world found
  175.  
  176. end -- function redirect
  177.  
  178. ]]>
  179. </script>
  180.  
  181.  
  182. </muclient>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement