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.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ General
➜ Easy way to insert a pause into a very long alias?
|
Easy way to insert a pause into a very long alias?
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| Tigers12
(10 posts) Bio
|
| Date
| Sat 08 May 2010 09:02 PM (UTC) |
| Message
| I am sure that I am confused about DoAfter, Wait, speedwalk functions, but perhaps they can achieve what I am looking for.
Optimally I would like a single command that can be inserted into the middle of an alias that will create a short pause before continuing.
The alias is hundreds of commands long and is copied and pasted from a Command Output log.
I am trying to avoid retyping all of the commands, adding "Send" to all commands, and/or breaking the alias into little pieces (to avoid getting disconnected due to overloading the MUD by sending 300 commands at once).
My goal is to type alias, have it do 60-70 commands, pause a couple seconds, do 60-70 more, pause, etc until all the commands are sent. | | Top |
|
| Posted by
| Twisol
USA (2,257 posts) Bio
|
| Date
| Reply #1 on Sat 08 May 2010 09:13 PM (UTC) |
| Message
| <aliases>
<alias
match="test"
enabled="y"
send_to="12"
sequence="100"
>
<send>
require "wait"
wait.make (function ()
Send ("prepare heal")
wait.time (1)
Send ("cast heal")
wait.time (2)
Send ("eat bread")
wait.time (3)
Note ("Done")
end)
</send>
</alias>
</aliases>
See: http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=4956 |
'Soludra' on Achaea
Blog: http://jonathan.com/
GitHub: http://github.com/Twisol | | Top |
|
| Posted by
| Tigers12
(10 posts) Bio
|
| Date
| Reply #2 on Sat 08 May 2010 09:27 PM (UTC) |
| Message
| I had seen that discussion, but am I wrong to conclude that I would have to make a script (versus a simple alias) and would have to add (type) 'Send' hundreds of times in front of my commands?
If so, I will just cut and paste the alias into a dozen shorter aliases.
I will try to mess around some more with 'wait' commands though. | | Top |
|
| Posted by
| Twisol
USA (2,257 posts) Bio
|
| Date
| Reply #3 on Sat 08 May 2010 09:38 PM (UTC) |
| Message
| That's correct, unfortunately. The "Send to World" mode sends the contents of the send box verbatim, so there's no way to drop a script command in. However, you can do this quite easily in a script:
Send([[
look
scratch
eat banana
]])
The [[string]] there is a long-form Lua string, which I'm passing to a single Send() call. So you only have to use one send between every wait:
Send([[
stuff1
]])
wait.time(5)
Send([[
stuff2
]])
wait.time(42)
Send([[
stuff3
]])
Indentation is optional of course. |
'Soludra' on Achaea
Blog: http://jonathan.com/
GitHub: http://github.com/Twisol | | Top |
|
| Posted by
| Tigers12
(10 posts) Bio
|
| Date
| Reply #4 on Sat 08 May 2010 09:45 PM (UTC) |
| Message
| Thank you. That will work for sure. I appreciate your help.
| | 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.
19,480 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top