Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Example Screenshot: http://i.imgur.com/HKD9Dsf.png
- Modified from Nick Gammon's original chat redirector to work with HellMOO, reference link that includes setup instructions: http://mushclient.com/forum/?id=7991
- 1. Save below script as HellMOO_ChatRedirector.xml
- 2. Create a new world called "HellMOO Chat" (IMPORTANT!) using 0.0.0.0 as IP (see reference link for more details)
- 3. Load plugin into your main HellMOO world (not the new chat world)
- =changelog=
- 1.0 initial
- 1.1 fixed syntax with exceptions, removed unused code from original plugin
- 1.2 added wristpad trigger, disabled local emote triggers by default (remove comment marks to enable)
- 1.3 added playnet, zotnet and maybe something else I forget it's been awhile.
- ===Save Below as HellMOO_ChatRedirector.xml===
- <!DOCTYPE muclient>
- <!-- Saved on Saturday, June 30, 2007, 10:48 -->
- <!-- MuClient version 4.13 -->
- <!-- Plugin "Chat_Redirector" generated by Plugin Wizard -->
- <!--
- Edit plugin and change "chat_world" variable to be the name of the world you want chats to go to.
- -->
- <muclient>
- <plugin
- name="HellMOO_ChatRedirector"
- author="Bob Barker"
- id="cb84a526b476f69f403517da"
- language="Lua"
- purpose="Redirects chat messages to another world modified for HellMOO"
- date_written="2007-06-30 10:45:35"
- requires="4.08"
- version="1.2"
- >
- <description trim="y">
- <![CDATA[
- Redirects chats to the specified world.
- Add or modify "chat" triggers to capture different sorts of message.
- Change the variable "chat_world" to be the name of the world chats are to go
- to.
- ]]>
- </description></plugin>
- <!-- Triggers -->
- <triggers>
- <trigger
- enabled="y"
- match="^\[( GONDO |chatnet|dongnet|mailnet|tradenet|party|zotnet|playnet)\].*$"
- omit_from_output="y"
- regexp="y"
- script="redirect"
- sequence="100"
- >
- </trigger>
- <trigger
- enabled="y"
- match="^From your wristpad: .*$"
- omit_from_output="y"
- regexp="y"
- script="redirect"
- sequence="100"
- >
- </trigger>
- <trigger
- enabled="y"
- match="^(?!\[cam\])(?!21Jack)[^\s]+ (says|asks|exclaims), \".+\"$"
- omit_from_output="y"
- regexp="y"
- script="redirect"
- sequence="100"
- >
- </trigger>
- <!-- delete these comment marks if you want to enable these emotes, I don't think I like them on.
- <trigger
- enabled="y"
- match="^(?!\[cam\])[/[^\s]+ (purr|points|salute|wave).*$"
- omit_from_output="y"
- regexp="y"
- script="redirect"
- sequence="100"
- >
- </trigger>
- -->
- </triggers>
- <!-- Script -->
- <script>
- <![CDATA[
- chat_world = "HellMOO Chat"
- local first_time = true
- function redirect (name, line, wildcards, styles)
- -- try to find "chat" world
- local w = GetWorld (chat_world) -- get "chat" world
- -- if not found, try to open it
- if first_time and not w then
- local filename = GetInfo (67) .. chat_world .. ".mcl"
- Open (filename)
- w = GetWorld (chat_world) -- try again
- if not w then
- ColourNote ("white", "red", "Can't open chat world file: " .. filename)
- first_time = false -- don't repeatedly show failure message
- end -- can't find world
- end -- can't find world first time around
- if w then -- if present
- for _, v in ipairs (styles) do
- w:ColourTell (RGBColourToName (v.textcolour),
- RGBColourToName (v.backcolour),
- v.text)
- end -- for each style run
- w:Note ("") -- wrap up line
- end -- world found
- end -- function redirect
- ]]>
- </script></muclient>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement