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

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Tips and tricks
. . -> [Subject]  How to automatically evaluate speedwalks - without needing a special prefix
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

How to automatically evaluate speedwalks - without needing a special prefix

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Posted by Nick Gammon   Australia  (15,380 posts)  [Biography] bio
Date Thu 28 Feb 2008 08:26 PM (UTC)  quote  ]

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  (15,380 posts)  [Biography] bio
Date Mon 10 Mar 2008 04:44 AM (UTC)  quote  ]
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 Mon 10 Mar 2008 11:52 PM (UTC)  quote  ]
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  (15,380 posts)  [Biography] bio
Date Tue 11 Mar 2008 12:13 AM (UTC)  quote  ]
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.


2,552 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

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

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]