Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to "verify" your details, 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
➜ General
➜ Alias questions
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Woodspiral
(11 posts) Bio
|
Date
| Mon 05 Jul 2021 09:00 AM (UTC) |
Message
| Hi,
I'm very new to MUSH so please be gentle if I've overlooked something in the documentation. I'm coming from MUDlet where things are similar but very different :-)
First question - how to use an alias inside another one? For example suppose I have an alias pg * which expands to 'open pocket; get %1 from pocket; close pocket'. I now want to define another alias mlg which expands to 'pg mirror; enter mirror'. (This is from CthulhuMUD where I'm entering the Mirror of Leng - believe me it is possible :-)
Second question - how to introduce a small delay in an alias. The FAQ says "3. For aliases, you can check "queue command" which will make the alias output be sent at the speedwalk delay." Where is that checkbox? I don't see it in the alias GUI panel.
Cheers,
Woodspiral. | Top |
|
Posted by
| Nick Gammon
Australia (23,070 posts) Bio
Forum Administrator |
Date
| Reply #1 on Mon 05 Jul 2021 11:08 AM (UTC) Amended on Mon 05 Jul 2021 11:15 AM (UTC) by Nick Gammon
|
Message
| Hello and welcome!
Quote:
how to use an alias inside another one?
In the alias dialog set "send to" to "Execute" and then the output of the alias is sent back to the command processor. In other words, an alias can call another alias.
Quote:
how to introduce a small delay in an alias.
That sounds like a documentation error. There is an option to send to "World (speedwalk delay)" in the Send box. That could introduce a delay.
Alternatively you could send to "script" and use a script like DoAfter.
For example:
Send ("quaff potion") -- do this now
DoAfter (2, "bandage self") -- do this after 2 seconds
There are more sophisticated ways of adding delays, see http://www.gammon.com.au/forum/?id=4956
A simple example, using "send to script" could be:
require "wait"
wait.make (function () --- coroutine below here
Send ("quaff potion") -- do this now
wait.time (2) -- wait 2 seconds
Send ("bandage self") -- do this after 2 seconds
wait.time (1) -- wait another second
Send ("slap self") -- now send this
end) -- end of coroutine
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Woodspiral
(11 posts) Bio
|
Date
| Reply #2 on Mon 05 Jul 2021 12:54 PM (UTC) |
Message
| Most excellent, thank you. I opted for send to script and DoAfter.
Cheers,
Woody | 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.
9,136 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top