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


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Alias questions

Alias questions

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


Posted by Woodspiral   (11 posts)  [Biography] 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.
[Go to top] top

Posted by Nick Gammon   Australia  (23,003 posts)  [Biography] 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
[Go to top] top

Posted by Woodspiral   (11 posts)  [Biography] 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
[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.


8,336 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]