Advertisement
Guest User

Chat Redirector

a guest
Feb 27th, 2018
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.23 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="Redirect Chats"
  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="^<OOC> .*$"
  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="^OOC> .*$"
  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="^From afar, .*$"
  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="^\<(Mount|Rider|Bun|Oven|Tattoo|TrustMgr)\> (.*$)"
  73. omit_from_output="n"
  74. regexp="y"
  75. script="redirect"
  76. sequence="100"
  77. >
  78. </trigger>
  79.  
  80. <trigger
  81. enabled="y"
  82. match="^(Mount|Rider|Bun|Oven|Tattoo|TrustMgr)\> (.*$)"
  83. omit_from_output="n"
  84. regexp="y"
  85. script="redirect"
  86. sequence="100"
  87. >
  88. </trigger>
  89.  
  90. <trigger enabled="y" match="^You (page|page-pose), (.*?)$" omit_from_output="n" ignore_case="y" regexp="y" script="redirect" sequence="100"></trigger>
  91. <trigger enabled="y" match="^In a page-pose to (.*?)$" omit_from_output="n" ignore_case="y" regexp="y" script="redirect" sequence="100"></trigger>
  92. <trigger enabled="y" match="^([a-zA-Z0-9\-\s]+) pages, (.*?)$" omit_from_output="n" ignore_case="y" regexp="y" script="redirect" sequence="100"></trigger>
  93. <trigger enabled="y" match="^Somewhere on the muck\, (.*?)connected\.$" omit_from_output="n" ignore_case="y" regexp="y" script="redirect" sequence="100"></trigger>
  94. <trigger enabled="y" match="^(?:A note has been added to|The status of) your request.*$" omit_from_output="n" ignore_case="y" regexp="y" script="redirect" sequence="100"></trigger>
  95. <trigger enabled="y" match="^\[(Zephyr|Promethean|Page)\] (.*?)$" omit_from_output="n" ignore_case="y" regexp="y" script="redirect" sequence="100"></trigger>
  96. <trigger enabled="y" match="^\<give\> (.*$)" omit_from_output="n" ignore_case="y" regexp="y" script="redirect" sequence="100"></trigger>
  97. <trigger enabled="y" match="^\w* gives (.*?) to (.*?)\.$" omit_from_output="n" ignore_case="y" regexp="y" script="redirect" sequence="100"></trigger>
  98.  
  99. <trigger
  100. enabled="y"
  101. match="^\[(Public|Theme|Zephyr Inc|Judge|Lfg|Auction|Badges|Rp|Pickup|Game|Newbie|Bile|Update|Science|Market|TG|Party|Links|Naughty|Radio|Sports|Tick|Writing|SYSTEM)\] (.*?)$"
  102. omit_from_output="y"
  103. regexp="y"
  104. script="redirect"
  105. sequence="100"
  106. >
  107. </trigger>
  108.  
  109. </triggers>
  110.  
  111. <!-- Script -->
  112.  
  113.  
  114. <script>
  115. <![CDATA[
  116. chat_world = "Chats"
  117. local first_time = true
  118.  
  119. function redirect (name, line, wildcards, styles)
  120.  
  121. -- try to find "chat" world
  122. local w = GetWorld (chat_world) -- get "chat" world
  123.  
  124. -- if not found, try to open it
  125. if first_time and not w then
  126. local filename = GetInfo (67) .. chat_world .. ".mcl"
  127. Open (filename)
  128. w = GetWorld (chat_world) -- try again
  129. if not w then
  130. ColourNote ("white", "red", "Can't open chat world file: " .. filename)
  131. first_time = false -- don't repeatedly show failure message
  132. end -- can't find world
  133. end -- can't find world first time around
  134.  
  135. if w then -- if present
  136. for _, v in ipairs (styles) do
  137. w:ColourTell (RGBColourToName (v.textcolour),
  138. RGBColourToName (v.backcolour),
  139. v.text)
  140. end -- for each style run
  141. w:Note ("") -- wrap up line
  142.  
  143. end -- world found
  144.  
  145. end -- function redirect
  146.  
  147. ]]>
  148. </script>
  149.  
  150.  
  151. </muclient>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement