Easy way to insert a pause into a very long alias?

Posted by Tigers12 on Sat 08 May 2010 09:02 PM — 5 posts, 20,093 views.

#0
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.
USA #1
<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
#2
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.
USA #3
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.
#4
Thank you. That will work for sure. I appreciate your help.