Advertisement
Guest User

OOC LotJ Capture

a guest
Jul 12th, 2012
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.78 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.   <trigger
  40.    enabled="y"
  41.    match="( IMM | CHAT )*"
  42.    regexp="n"
  43.    script="redirect"
  44.    sequence="100"
  45.   >
  46.   </trigger>
  47.  
  48.   <trigger
  49.    enabled="y"
  50.    match="You have now obtained * level *!"
  51.    regexp="n"
  52.    script="redirect"
  53.    sequence="100"
  54.   >
  55.   </trigger>
  56.  
  57.   <trigger
  58.    enabled="y"
  59.    match="(R|P|C)*"
  60.    regexp="n"
  61.    script="redirect"
  62.    sequence="100"
  63.   >
  64.   </trigger>
  65.   <trigger
  66.    enabled="y"
  67.    match="(OOC) *"
  68.    regexp="n"
  69.    script="redirect"
  70.    sequence="100"
  71.   >
  72.   </trigger>
  73.  
  74.   <trigger
  75.    enabled="y"
  76.    match="(NEWBIE) *"
  77.    regexp="n"
  78.    script="redirect"
  79.    sequence="100"
  80.   >
  81.   </trigger>
  82.  
  83.   <trigger
  84.    enabled="y"
  85.    match="(IMM) *"
  86.    regexp="n"
  87.    script="redirect"
  88.    sequence="100"
  89.   >
  90.   </trigger>
  91.  
  92.   <trigger
  93.    enabled="y"
  94.    match="(RPC) *"
  95.    regexp="n"
  96.    script="redirect"
  97.    sequence="100"
  98.   >
  99.   </trigger>
  100.  
  101.  
  102.  
  103. </triggers>
  104.  
  105. <!--  Script  -->
  106.  
  107.  
  108. <script>
  109. <![CDATA[
  110. chat_world = "OOCLOTJ"
  111. local first_time = true
  112.  
  113. function redirect (name, line, wildcards, styles)
  114.  
  115.   -- try to find "chat" world
  116.   local w = GetWorld (chat_world)  -- get "chat" world
  117.  
  118.   -- if not found, try to open it
  119.   if first_time and not w then
  120.     local filename = GetInfo (67) .. chat_world .. ".mcl"
  121.     Open (filename)
  122.     w = GetWorld (chat_world)  -- try again
  123.     if not w then
  124.       ColourNote ("white", "red", "Can't open chat world file: " .. filename)
  125.       first_time = false  -- don't repeatedly show failure message
  126.     end -- can't find world
  127.   end -- can't find world first time around
  128.  
  129.   if w then  -- if present
  130.     for _, v in ipairs (styles) do
  131.       w:ColourTell (RGBColourToName (v.textcolour),
  132.                     RGBColourToName (v.backcolour),
  133.                     v.text)
  134.     end -- for each style run
  135.     w:Note ("\n")  -- wrap up line
  136.  
  137.   end -- world found
  138.  
  139. end -- function redirect
  140.  
  141. ]]>
  142. </script>
  143.  
  144.  
  145. </muclient>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement