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
➜ speed walk with a wait in the middle
speed walk with a wait in the middle
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Renquist
(11 posts) Bio
|
Date
| Tue 27 Mar 2007 08:18 PM (UTC) |
Message
| My speed walk is executed by an alias that calls a python function. I want to wait for about 5 seconds in the middle of the walk.
world.queue("w w w n e n n n (open gate) n e e e s w", false)
I'd like to pause after opening the gate before continuing the walk. | Top |
|
Posted by
| Nick Gammon
Australia (23,140 posts) Bio
Forum Administrator |
Date
| Reply #1 on Tue 27 Mar 2007 10:01 PM (UTC) |
Message
| See this post for a start:
http://www.gammon.com.au/forum/bbshowpost.php?id=5975
You could use the "wait" functionality (only available with the Lua script engine), and make an alias like this:
<aliases>
<alias
match="test123"
enabled="y"
send_to="12"
sequence="100"
>
<send>
require "wait"
wait.make (function ()
Send (EvaluateSpeedwalk ("w w w n e n n n"))
Send ("open gate")
wait.time (5) -- wait 5 seconds
Send (EvaluateSpeedwalk ("n e e e s w"))
end)
</send>
</alias>
</aliases>
You need MUSHclient 3.80 onwards for this to work. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Nick Gammon
Australia (23,140 posts) Bio
Forum Administrator |
Date
| Reply #2 on Tue 27 Mar 2007 10:05 PM (UTC) |
Message
| I see you have said you want to use Python. In that case, you could conceivably make a plugin in Lua which handles the "wait" cases.
Alternatively, you may have to use timers in Python to achieve the same result.
See: http://www.gammon.com.au/scripts/doc.php?function=DoAfter
Thus, your script might look like this:
Send (EvaluateSpeedwalk ("w w w n e n n n"))
Send ("open gate")
DoAfterSpeedWalk (5, "n e e e s w")
This sends the first lot of directions immediately, followed by DoAfterSpeedWalk which sends the rest after a 5 seconds pause. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Nick Gammon
Australia (23,140 posts) Bio
Forum Administrator |
Date
| Reply #4 on Tue 27 Mar 2007 11:35 PM (UTC) |
Message
| |
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.
15,841 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top