speed walk with a wait in the middle

Posted by Renquist on Tue 27 Mar 2007 08:18 PM — 5 posts, 20,776 views.

#0
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.
Australia Forum Administrator #1
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.
Australia Forum Administrator #2
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.
#3
Hi thanks for the quick reply and for updating MUSHClient.

I noticed that the download page http://www.gammon.com.au/downloads/dlmushclient.htm lists the current version as 3.78

I got version 3.85 from the file index page http://www.gammon.com.au/files/mushclient/
Australia Forum Administrator #4
Recent releases are announced here:

http://www.gammon.com.au/forum/bbshowpost.php?bbtopic_id=1