Vanisse Immortal
Joined: 06 Jan 2006 Posts: 2793 Location: inside a tree
|
Posted: Mon May 20, 2013 2:51 pm Post subject: Mushclient chat capture plugin |
|
|
Hi folks, as a longtime (and utterly shameless) GMUD user finally making the move to MUSHclient, I decided I'd add a how-to for something that I found useful and cool as I switch over. I'm sure this is old hat to a lot of you but I am completely new to this, and I guess it might help other new players down the road
Here is how to set up MUSHclient to have AR running in one window and all the chat (tells, says, gtells, gossip, cabal chat) captured with timestamps in the second window. I optimized it from a plugin written by Nick Gammon. The original post can be found here.
***NOTE: This does not capture esays since I haven't figured that out yet***
1. Create a world for AR if you don't already have it. (Ctrl-N), enter your world name (I named mine "AR"), and the following:
IP address: abandonedrealms.wolfpaw.net
Port: 9000
2. Create a second world for your chat window. I named mine "ARchat."
IP address: 0.0.0.0
Port: 4000
3. Open AR. Press Ctrl-Alt-W to open a Notepad window. Copy paste the following, and save as Chat_Redirector.xml in the plugins folder:
Code: |
<?xml version="1.0" encoding="iso-8859-1"?>
<!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="Chat_Redirector"
author="Nick Gammon"
id="cb84a526b476f69f403517da"
language="Lua"
purpose="Redirects chat messages to another world"
date_written="2007-06-30 10:45:35"
requires="4.08"
version="1.0"
>
<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"
name="general"
match="^[A-Za-z]+ (says|tells you|yells) \'(.*?)\'$"
regexp="y"
script="redirect"
sequence="100"
>
</trigger>
<trigger
enabled="y"
name="heraldgossip"
match="^\<[A-Z]+\> [A-Za-z]+ gossips: \'(.*?)\'$"
regexp="y"
script="redirect"
sequence="100"
>
</trigger>
<trigger
enabled="y"
name="mysticgossip"
match="^\[[A-Z]+\] [A-Za-z]+ gossips: \'(.*?)\'$"
regexp="y"
script="redirect"
sequence="100"
>
</trigger>
<trigger
enabled="y"
name="plaingossip"
match="^[A-Za-z]+ gossips: \'(.*?)\'$"
regexp="y"
script="redirect"
sequence="100"
>
</trigger>
<trigger
enabled="y"
match="^You (say|pray|yell) \'(.*?)\'$"
regexp="y"
script="redirect"
sequence="100"
>
</trigger>
<trigger
enabled="y"
match="^You tell (.*?) \'(.*?)\'$"
regexp="y"
script="redirect"
sequence="100"
>
</trigger>
</triggers>
<!-- Script -->
<script>
<![CDATA[
chat_world = "ARchat"
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
w:ColourTell ("white", "", os.date ("%H:%M:%S : "))
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> |
4. Go back to the main AR window and type Ctrl-Shift-P to open the Plugins window. Add Chat_Redirector. Whee! You now have a window that stores the communication in AR.
5. If you want to be able to reply directly from the chat window, open your ARchat world, type Ctrl-Alt-W. Copy-paste the following and save as Redirect_Input.xml in the plugins folder:
Code: |
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Saturday, June 30, 2007, 10:14 -->
<!-- MuClient version 4.13 -->
<!-- Plugin "Redirect_Input" generated by Plugin Wizard -->
<muclient>
<plugin
name="Redirect_Input"
author="Nick Gammon"
id="fefa658aa8caca3cb5e2fa81"
language="Lua"
purpose="Redirects commands to another world"
date_written="2007-06-30 10:08:32"
requires="4.00"
version="1.0"
>
</plugin>
<!-- Script -->
<script>
<![CDATA[
world_name = "AR"
function OnPluginCommandEntered (command)
local w = GetWorld (world_name) -- find world
-- not found? show error
if not w then
ColourNote ("white", "red", "World " .. world_name .. " is not open")
else
w:Execute (command) -- execute command (handle aliases, etc.)
PushCommand (command) -- save in command history
end -- if
return ("\t") -- clear command
end -- OnPluginCommandEntered
]]>
</script>
</muclient> |
6. Go back to the ARchat window and type Ctrl-Shift-P to open the Plugins window. Add Redirect_Input. Whee! Now you can type commands to the game through the chat window without having to switch worlds.
You can feel free to edit any of these for your own liking. If you're not familiar with regular expressions like me, you can use this handy reference. Once you do make a change and save it, you must reinstall the plugin before it will respond to your changes (Ctrl-Shift-P, highlight your plugin, click Reinstall). |
|