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.
Entire forum
➜ MUSHclient
➜ Tips and tricks
➜ 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 page
Posted by
| Nick Gammon
Australia (23,120 posts) 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 | Top |
|
Posted by
| Nick Gammon
Australia (23,120 posts) 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 | Top |
|
Posted by
| Shaun Biggs
USA (644 posts) 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. | Top |
|
Posted by
| Nick Gammon
Australia (23,120 posts) 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 | 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.
22,728 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top