[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Tips and tricks
. . -> [Subject]  How to automatically evaluate speedwalks - without needing a special prefix

How to automatically evaluate speedwalks - without needing a special prefix

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


Posted by Nick Gammon   Australia  (23,017 posts)  [Biography] bio   Forum Administrator
Date Thu 28 Feb 2008 08:26 PM (UTC)

Amended on Sat 01 Mar 2008 05:25 AM (UTC) by Nick Gammon

Message
MUSHclient supports entering speedwalk strings by using a special "speedwalk identifier" (which defaults to the # character), like this:


# 4w 3s


However the requirement to type the # is one extra keystroke, and can clash with certain other aliases or MUD commands. It would be nice to do away with it.

The alias below does that - it uses a regular expression to match on the normal speedwalk characters n/s/e/w/u/d (north/south/east/west/up/down) as well as digits and spaces (eg. 4n 3w).

If it matches then it assumes you are typing a speedwalk, and sends it to the speedwalk processor.


<aliases>
  <alias
   match="^([nsewud\d\s]|\(.+?\)){2,}$"
   enabled="y"
   regexp="y"
   send_to="11"
   ignore_case="y"
   sequence="100"
  >
  <send>%0</send>
  </alias>
</aliases>


There is also a slightly elaborate provision for using round brackets in speedwalks, for example:


4s (pick lock) 2w (open door) 3(se)


To use this, simply copy from above and paste into your world (see http://www.mushclient.com/pasting) and it should now evaluate speedwalks without needing any special speedwalk prefix.

This alias does not use scripting so it will work with any (or no) scripting language.

The only potential problem I can see is that if something you type "looks like" a speedwalk but isn't.

For example, if you got asked a question: "Do you want to be a mage?" and you answered "n" then "n" might look like a speedwalk (and the correct answer to "Do you want to be a mage?" is not "north"!).

For this reason, it only activates if it gets at least 2 speedwalk characters.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (23,017 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Mon 10 Mar 2008 04:44 AM (UTC)
Message
I just noticed that the word "new" looks like a speedwalk (north / east / west) so you would not want this alias active if you were creating a new character (and had to type "new" to do that).

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Shaun Biggs   USA  (644 posts)  [Biography] bio
Date Reply #2 on Mon 10 Mar 2008 11:52 PM (UTC)
Message
Same with a lot of other words, some frequently used ones are "send" and "end." This seems like a dangerous plugin if you are writing out a note or message to someone else. If I were to use this plugin, I would make sure to attatch an accelerator function in to turn this on and off quickly and easily.

It is much easier to fight for one's ideals than to live up to them.
[Go to top] top

Posted by Nick Gammon   Australia  (23,017 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Tue 11 Mar 2008 12:13 AM (UTC)
Message
Yes, agreed. Conceivably you could detect things like starting to write a note with a trigger, and disable the alias, and re-enable it when you are done.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] 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.


21,841 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]