Advertisement
MrBobBarker

HellMOO Chat Redirector

Aug 14th, 2015
359
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 3.49 KB | None | 0 0
  1. Example Screenshot: http://i.imgur.com/HKD9Dsf.png
  2.  
  3. Modified from Nick Gammon's original chat redirector to work with HellMOO, reference link that includes setup instructions: http://mushclient.com/forum/?id=7991
  4.  
  5. 1. Save below script as HellMOO_ChatRedirector.xml
  6. 2. Create a new world called "HellMOO Chat" (IMPORTANT!) using 0.0.0.0 as IP (see reference link for more details)
  7. 3. Load plugin into your main HellMOO world (not the new chat world)
  8.  
  9. =changelog=
  10. 1.0 initial
  11. 1.1 fixed syntax with exceptions, removed unused code from original plugin
  12. 1.2 added wristpad trigger, disabled local emote triggers by default (remove comment marks to enable)
  13. 1.3 added playnet, zotnet and maybe something else I forget it's been awhile.
  14. ===Save Below as HellMOO_ChatRedirector.xml===
  15. <!DOCTYPE muclient>
  16. <!-- Saved on Saturday, June 30, 2007, 10:48  -->
  17. <!-- MuClient version 4.13 -->
  18.  
  19. <!-- Plugin "Chat_Redirector" generated by Plugin Wizard -->
  20.  
  21. <!--
  22. Edit plugin and change "chat_world" variable to be the name of the world you want chats to go to.
  23. -->
  24. <muclient>
  25. <plugin
  26.   name="HellMOO_ChatRedirector"
  27.   author="Bob Barker"
  28.   id="cb84a526b476f69f403517da"
  29.   language="Lua"
  30.   purpose="Redirects chat messages to another world modified for HellMOO"
  31.   date_written="2007-06-30 10:45:35"
  32.   requires="4.08"
  33.   version="1.2"
  34.   >
  35. <description trim="y">
  36. <![CDATA[
  37. Redirects chats to the specified world.
  38.  
  39. Add or modify "chat" triggers to capture different sorts of message.
  40.  
  41. Change the variable "chat_world" to be the name of the world chats are to go
  42.  to.
  43. ]]>
  44. </description></plugin>
  45.  
  46. <!--  Triggers  -->
  47. <triggers>
  48.   <trigger
  49.   enabled="y"
  50.   match="^\[( GONDO |chatnet|dongnet|mailnet|tradenet|party|zotnet|playnet)\].*$"
  51.   omit_from_output="y"
  52.   regexp="y"
  53.   script="redirect"
  54.   sequence="100"
  55.  >
  56.   </trigger>
  57.   <trigger
  58.   enabled="y"
  59.   match="^From your wristpad: .*$"
  60.   omit_from_output="y"
  61.   regexp="y"
  62.   script="redirect"
  63.   sequence="100"
  64.  >
  65.   </trigger>
  66.   <trigger
  67.   enabled="y"
  68.   match="^(?!\[cam\])(?!21Jack)[^\s]+ (says|asks|exclaims), \&quot;.+\&quot;$"
  69.   omit_from_output="y"
  70.   regexp="y"
  71.   script="redirect"
  72.   sequence="100"
  73.  >
  74.   </trigger>
  75. <!-- delete these comment marks if you want to enable these emotes, I don't think I like them on.
  76.  <trigger
  77.   enabled="y"
  78.   match="^(?!\[cam\])[/[^\s]+ (purr|points|salute|wave).*$"
  79.   omit_from_output="y"
  80.   regexp="y"
  81.   script="redirect"
  82.   sequence="100"
  83.  >
  84.  </trigger>
  85. -->
  86. </triggers>
  87.  
  88. <!--  Script  -->
  89. <script>
  90. <![CDATA[
  91. chat_world = "HellMOO Chat"
  92. local first_time = true
  93.  
  94. function redirect (name, line, wildcards, styles)
  95.  -- try to find "chat" world
  96.  local w = GetWorld (chat_world)  -- get "chat" world
  97.  
  98.  -- if not found, try to open it
  99.  if first_time and not w then
  100.    local filename = GetInfo (67) .. chat_world .. ".mcl"
  101.    Open (filename)
  102.    w = GetWorld (chat_world)  -- try again
  103.    if not w then
  104.      ColourNote ("white", "red", "Can't open chat world file: " .. filename)
  105.      first_time = false  -- don't repeatedly show failure message
  106.    end -- can't find world
  107.  end -- can't find world first time around
  108.  
  109.  if w then  -- if present
  110.    for _, v in ipairs (styles) do
  111.      w:ColourTell (RGBColourToName (v.textcolour),
  112.                    RGBColourToName (v.backcolour),
  113.                    v.text)  
  114.    end -- for each style run
  115.    
  116.    w:Note ("")  -- wrap up line
  117.  end -- world found
  118. end -- function redirect
  119. ]]>
  120. </script></muclient>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement