There are various ways you could do this, including using a COM object to access the Excel database, but I think this would be slow, as that would mean Excel has to load every time.
The solution below will be nice and fast. :)
- Save the plugin below to disk as directed in the instructions.
- Open Excel to get at your database of speedwalks, and then "save as comma-delimited" file (CSV file). That should give you a file like this:
kitchen, w;s;s;s
liveroom, n;n;u
stable, w;s;s;n;nw
Open that file in a text editor and copy those lines into the plugin, replacing the example three lines (in bold) with your 1000 or so lines.
- Save the amended plugin (and do a plugin reinstall if you have already installed it).
- Now you can just type "goto kitchen" and it will do the speedwalk.
If you need to add or amend speedwalks just open the plugin in a text editor and fix up the list in the speedwalks part.
To save and install the
Speedwalker 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
Speedwalker.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
Speedwalker.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>
<!-- Saved on Tuesday, September 08, 2009, 6:59 AM -->
<!-- MuClient version 4.43 -->
<!-- Plugin "Speedwalker" generated by Plugin Wizard -->
<muclient>
<plugin
name="Speedwalker"
author="Nick Gammon"
id="fa0ecbb1922e2aa85abf94d1"
language="Lua"
purpose="Goes to a place from a speedwalk table"
date_written="2009-09-08 06:58:32"
requires="4.40"
version="1.0"
>
<description trim="y">
<![CDATA[
Type : goto <place>
Edit the plugin to add more places.
]]>
</description>
</plugin>
<!-- Aliases -->
<aliases>
<alias
match="goto *"
enabled="y"
send_to="12"
sequence="100"
>
<send>
-- lookup place
sw = speedwalk_table [trim ("%1")]
if not sw then
ColourNote ("white", "red", "Place '%1' not in database")
else
Execute ((string.gsub (sw, ";", "\\n")))
end -- if
</send>
</alias>
</aliases>
<!-- Script -->
<script>
<![CDATA[
-- trim leading and trailing spaces from a string
function trim (s)
return (string.gsub (s, "^%s*(.-)%s*$", "%1"))
end -- trim
-- PUT SPEEDWALKS HERE BETWEEN BRACKETS:
speedwalks = [[
kitchen, w;s;s;s
liveroom, n;n;u
stable, w;s;s;n;nw
]]
speedwalk_table = {}
-- copy into table
for name, sw in string.gmatch (speedwalks, "([A-Za-z]+),(.-)\n") do
speedwalk_table [trim (name)] = trim (sw)
end -- for
]]>
</script>
</muclient>