Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ Directions / speed walk storage question

Directions / speed walk storage question

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Rhien   (13 posts)  Bio
Date Mon 11 Dec 2017 03:52 PM (UTC)
Message
Just switched to MushClient and loving it so far (don't know why I didn't switch a long time ago). I've been able to get everything converted from my old client but there's one thing I'm missing.

What is the best way to store directions for quick usage (without having to remember alias names for 50 places). In Zmud, I either used custom buttons or the right click context menu.

I downloaded the MushClient source and I was going to add a "Directions" menu item (maybe with a dialog to add them in) but before I go to that length I was curious what other people do or how they manage speed walks.
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #1 on Tue 12 Dec 2017 03:34 AM (UTC)

Amended on Tue 12 Dec 2017 03:41 AM (UTC) by Nick Gammon

Message
First, there is a plugin that implements buttons you can click (in a miniwindow). You can make those buttons do anything, such as speedwalking:

http://www.gammon.com.au/forum/?id=9280




Alternatively, if you want a menu you can do this:

1. Make an alias that uses the Menu function to pop up a menu in the command window. Like this:


<aliases>
  <alias
   match="speedwalk_menu"
   enabled="y"
   send_to="12"
   sequence="100"
  >
  <send>

local locations = {
  ['Inn'] = '(recall) 2n 3w',
  ['Blacksmith shop'] = '(recall) 5s 2e d',
  ['Food and drink'] = '(recall) 2w',

-- add more here

  }  -- end of locations

-- build place names
local places = { }
for k, v in pairs (locations) do
  table.insert (places, k)
end -- for

-- sort into alphabetic order
table.sort (places)

-- show the menu
local dest = Menu (table.concat (places, "|"))

-- check if cancelled
if dest == "" then
  return  -- nothing selected
end -- if

-- evaluate the corresponding speedwalk from the table
local speedwalk = EvaluateSpeedwalk ( locations [dest] )

-- see if an error in it
if string.sub (speedwalk, 1, 1) == '*' then
  ColourNote ("red", "", speedwalk )
  ColourNote ("red", "", "**Could not evaluate speedwalk string: '" .. locations [dest] .. "'")
  return
end -- if bad speedwalk

-- if OK, send to the MUD
Send (speedwalk)

</send>
  </alias>
</aliases>



Template:pasting For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.


The part in bold is what you could change to suit your MUD, or indeed keep them in a table which can be updated by using another alias (eg. "add_speedwalk name directions").

For saving tables see the post about serializing Lua tables:

http://www.gammon.com.au/forum/?id=4960

That would let you gradually build up the speedwalks as you wanted to and make the alias be non-specific to a particular set of directions.

With that alias installed, if you type "speedwalk_menu" then the alias is invoked, and pops up a menu. If you cancel by hitting Esc then nothing else is done. Otherwise it looks up the speedwalk in the table, evaluates it (turns it into real directions) and sends that to the MUD.

To save typing you can now use the Macros configuration window and make a certain key (eg. F2) send "speedwalk_menu" which means now you just hit F2 and choose a destination.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Rhien   (13 posts)  Bio
Date Reply #2 on Tue 12 Dec 2017 01:18 PM (UTC)
Message
Thank you Nick, I think these will do the trick.

Also, thank you for all you've contributed to the mudding community through the years, both through here and with MUSHclient your work on Smaug.
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


14,987 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.