Advertisement
Guest User

IC LotJ

a guest
Jul 12th, 2012
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.31 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="cb84a526b476f69f403517db"
  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="*say*'*'"
  43.    regexp="n"
  44.    script="redirect"
  45.    sequence="100"
  46.   >
  47.   </trigger>  
  48.  
  49.   <trigger
  50.    enabled="y"
  51.    match="'*'*say*"
  52.    regexp="n"
  53.    script="redirect"
  54.    sequence="100"
  55.   >
  56.   </trigger>
  57.     <trigger
  58.    enabled="y"
  59.    match="*A comlink buzzes *"
  60.    regexp="n"
  61.    script="redirect"
  62.    sequence="100"
  63.   >
  64.   </trigger>
  65.  
  66.   <trigger
  67.    enabled="y"
  68.    match="*ask*'*'"
  69.    regexp="n"
  70.    script="redirect"
  71.    sequence="100"
  72.   >
  73.   </trigger>  
  74.  
  75.   <trigger
  76.    enabled="y"
  77.    match="'*'*ask*"
  78.    regexp="n"
  79.    script="redirect"
  80.    sequence="100"
  81.   >
  82.   </trigger>
  83.  
  84.   <trigger
  85.    enabled="y"
  86.    match="*exclaim*'*'"
  87.    regexp="n"
  88.    script="redirect"
  89.    sequence="100"
  90.   >
  91.   </trigger>  
  92.  
  93.   <trigger
  94.    enabled="y"
  95.    match="'*'*exclaim*"
  96.    regexp="n"
  97.    script="redirect"
  98.    sequence="100"
  99.   >
  100.   </trigger>
  101.  
  102.   <trigger
  103.    enabled="y"
  104.    match="CREDITS:*BANK:*"
  105.    regexp="n"
  106.    script="redirect"
  107.    sequence="100"
  108.   >
  109.   </trigger>
  110.  
  111.   <trigger
  112.    enabled="y"
  113.    match="*{*}<*>[*]*:*"
  114.    regexp="n"
  115.    script="redirect"
  116.    sequence="100"
  117.   >
  118.   </trigger>
  119.  
  120.   <trigger
  121.    enabled="y"
  122.    match="CommNet*:*"
  123.    regexp="n"
  124.    script="redirect"
  125.    sequence="100"
  126.   >
  127.   </trigger>
  128.  
  129.   <trigger
  130.    enabled="y"
  131.    match="Broadcasting Network*:*"
  132.    regexp="n"
  133.    script="redirect"
  134.    sequence="100"
  135.   >
  136.   </trigger>
  137.  
  138.  
  139.  
  140. </triggers>
  141.  
  142. <!--  Script  -->
  143.  
  144.  
  145. <script>
  146. <![CDATA[
  147. chat_world = "ICLotj"
  148. local first_time = true
  149.  
  150. function redirect (name, line, wildcards, styles)
  151.  
  152.   -- try to find "chat" world
  153.   local w = GetWorld (chat_world)  -- get "chat" 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 ("\n")  -- 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