OK, so you just want to capture something you sent to the MUD? This might be easier:
To save and install the
RememberName plugin do this:
- Copy the code below (in the code box) to the Clipboard
- Open a text editor (such as Notepad) and paste the plugin code into it
- Save to disk on your PC, preferably in your plugins directory, as
RememberName.xml
- The "plugins" directory is usually under the "worlds" directory inside where you installed MUSHclient.
- Go to the MUSHclient File menu -> Plugins
- Click "Add"
- Choose the file
RememberName.xml (which you just saved in step 3) as a plugin
- Click "Close"
- Save your world file, so that the plugin loads next time you open it.
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<muclient>
<plugin
name="RememberName"
author="Nick Gammon"
id="8bc26701e42113bb048c48d3"
language="Lua"
purpose="Remembers something sent to the MUD"
date_written="2018-02-06 12:06:32"
requires="5.00"
version="1.0"
>
</plugin>
<!-- Script -->
<script>
<![CDATA[
function OnPluginConnect ()
justConnected = true
end -- function
--
-- MUSHclient is definitely sending 'sText' to the MUD
--
function OnPluginSent (sText)
-- only do it after connecting
if not justConnected then
return
end -- if
local name = string.match (sText, "^My name is (%a+)$")
if name then -- if matched
myName = name
justConnected = false
ColourNote ("orange", "", "Detected name: " .. myName) -- debugging
end -- if
end -- function
]]>
</script>
</muclient>
This is examining everything you send to the MUD, and uses string.match to see if it is the special thing you want. If so, it remembers it, and then sets a flag so it doesn't do it again this session (you could omit that part if you want).
Since this isn't an alias as such, the original text you send is going to be sent to the MUD anyway.
You would need to change the string.match regular expression to be whatever-it-is that you send, that you want to remember. If it happens to be the very first thing you send, then omit the test and just save the first thing that this matches on.