SHOW:
|
|
- or go back to the newest paste.
| 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 | ||
| 40 | <trigger | |
| 41 | enabled="y" | |
| 42 | match="^You (page|page-pose), (.*?)$" | |
| 43 | omit_from_output="n" | |
| 44 | omit_from_log="y" | |
| 45 | regexp="y" | |
| 46 | script="redirect" | |
| 47 | sequence="100" | |
| 48 | > | |
| 49 | </trigger> | |
| 50 | ||
| 51 | ||
| 52 | <trigger | |
| 53 | enabled="y" | |
| 54 | match="^Somewhere on the muck\, (.*?)connected\.$" | |
| 55 | omit_from_output="n" | |
| 56 | omit_from_log="y" | |
| 57 | regexp="y" | |
| 58 | script="redirect" | |
| 59 | sequence="100" | |
| 60 | > | |
| 61 | </trigger> | |
| 62 | ||
| 63 | ||
| 64 | <trigger | |
| 65 | enabled="y" | |
| 66 | match="^(\<Inside Your Womb\> |)\<OOC\> (.*?)$" | |
| 67 | omit_from_output="n" | |
| 68 | regexp="y" | |
| 69 | script="redirect" | |
| 70 | sequence="100" | |
| 71 | > | |
| 72 | </trigger> | |
| 73 | ||
| 74 | ||
| 75 | <trigger | |
| 76 | enabled="y" | |
| 77 | match="^\[Page\] (.*?)$" | |
| 78 | omit_from_output="n" | |
| 79 | omit_from_log="y" | |
| 80 | ignore_case="y" | |
| 81 | regexp="y" | |
| 82 | script="redirect" | |
| 83 | sequence="100" | |
| 84 | > | |
| 85 | </trigger> | |
| 86 | ||
| 87 | ||
| 88 | <trigger | |
| 89 | enabled="y" | |
| 90 | - | match="^\[(Zephyr Inc|Promethean|RSX Solutions|sisterhood of fox)\] (.*?)$" |
| 90 | + | match="^\[(Zephyr Inc|Promethean|RSX Solutions|GROUP NAME HERE)\] (.*?)$" |
| 91 | omit_from_output="y" | |
| 92 | omit_from_log="y" | |
| 93 | ignore_case="y" | |
| 94 | regexp="y" | |
| 95 | script="redirect" | |
| 96 | sequence="100" | |
| 97 | > | |
| 98 | </trigger> | |
| 99 | ||
| 100 | ||
| 101 | <trigger | |
| 102 | enabled="y" | |
| 103 | - | match="^\[(wc|Judge|Public|Lfg|Auction|Badges|Pickup|Bile|Science|Newbie|Market|Tick|Update|Radio|Rp|SYSTEM|Tg|Links)\] (.*?)$" |
| 103 | + | match="^\[(naughty|writing|wc|Judge|Public|Lfg|Auction|Badges|Pickup|Bile|Science|Newbie|Market|Tick|Update|Radio|Rp|SYSTEM|Tg|Links)\] (.*?)$" |
| 104 | omit_from_output="y" | |
| 105 | omit_from_log="y" | |
| 106 | ignore_case="y" | |
| 107 | regexp="y" | |
| 108 | script="redirect" | |
| 109 | sequence="100" | |
| 110 | > | |
| 111 | </trigger> | |
| 112 | ||
| 113 | </triggers> | |
| 114 | ||
| 115 | <!-- Script --> | |
| 116 | ||
| 117 | ||
| 118 | <script> | |
| 119 | <![CDATA[ | |
| 120 | chat_world = "Chat window" | |
| 121 | local first_time = true | |
| 122 | ||
| 123 | function redirect (name, line, wildcards, styles) | |
| 124 | ||
| 125 | -- try to find "chat" world | |
| 126 | local w = GetWorld (chat_world) -- get "chat" world | |
| 127 | ||
| 128 | -- if not found, try to open it | |
| 129 | if first_time and not w then | |
| 130 | local filename = GetInfo (67) .. chat_world .. ".mcl" | |
| 131 | Open (filename) | |
| 132 | w = GetWorld (chat_world) -- try again | |
| 133 | if not w then | |
| 134 | ColourNote ("white", "red", "Can't open chat world file: " .. filename)
| |
| 135 | first_time = false -- don't repeatedly show failure message | |
| 136 | end -- can't find world | |
| 137 | end -- can't find world first time around | |
| 138 | ||
| 139 | if w then -- if present | |
| 140 | for _, v in ipairs (styles) do | |
| 141 | w:ColourTell (RGBColourToName (v.textcolour), | |
| 142 | RGBColourToName (v.backcolour), | |
| 143 | v.text) | |
| 144 | end -- for each style run | |
| 145 | w:Note ("") -- wrap up line
| |
| 146 | ||
| 147 | end -- world found | |
| 148 | ||
| 149 | end -- function redirect | |
| 150 | ||
| 151 | ]]> | |
| 152 | </script> | |
| 153 | ||
| 154 | ||
| 155 | </muclient> |