How might I pause and then resume a speedwalk?

Posted by Weston on Sun 03 Oct 2004 07:02 PM — 5 posts, 20,016 views.

#0
You may have heard this before, but this time I would like some specifics, please!


I was thinking of using two aliases.
One named 'pause' to temporary stop, and at the same time store the speedwalk queue.

Then I would do my stuff; attack something for example.

Then I would use that second alias, named 'resume'. It would get the saved speedwalk queue and execute it as a speedwalk.


The best that I've been able to do is:

dim speedwalkQueue
dim iCount

speedwalkQueue = World.GetQueue

If Not IsEmpty (speedwalkQueue) Then
for iCount = lbound (speedwalkQueue) to ubound (speedwalkQueue)
world.addalias "", "resume", speedwalkQueue (iCount), eEnabled or eAliasSpeedWalk, ""
world.discardqueue
next
End If


The problem with this solution is that I end up with ten different aliases each with one direction.
USA #1

<aliases>
  <alias
   name="SpeedwalkResume"
   match="^resume$"
   enabled="y"
   echo_alias="y"
   regexp="y"
   ignore_case="y"
   send_to="12"
   sequence="100"
  >
  <send>queue getvariable(&quot;TempQueue&quot;), false
enablealias &quot;speedwalkresume&quot;, 0
getvariable&quot;TempQueue&quot;, &quot;&quot;
</send>
  </alias>
  <alias
   match="^pause$"
   enabled="y"
   echo_alias="y"
   regexp="y"
   ignore_case="y"
   send_to="12"
   sequence="100"
  >
  <send>dim speedwalkQueue
dim iCount
dim NewQueue

newQueue = &quot;&quot;
speedwalkQueue = World.GetQueue
world.discardqueue
If Not IsEmpty (speedwalkQueue) Then
for iCount = lbound (speedwalkQueue) to ubound (speedwalkQueue)
newQueue = newQueue &amp; speedwalkQueue(iCount) &amp; VBCrLf
setvariable &quot;QueueTemp&quot;, newQueue
next
End If
enablealias &quot;speedwalkresume&quot;, 1</send>
  </alias>
</aliases>

Amended on Sun 03 Oct 2004 08:00 PM by Flannel
#2
Thank you very much for helping, Flannel!

When I tried your aliases I got this error message:
Quote:
Execution of line 3 column 1

Wrong number of arguments or invalid property assignment: 'getvariable'
Line in error:


So then I changed the aliases to:


Quote:
<alias
match="^pause$"
enabled="y"
echo_alias="y"
regexp="y"
send_to="12"
ignore_case="y"
sequence="100"
>
<send>dim speedwalkQueue
dim iCount
dim NewQueue

newQueue = &quot;&quot;
speedwalkQueue = World.GetQueue
If Not IsEmpty (speedwalkQueue) Then
for iCount = lbound (speedwalkQueue) to ubound (speedwalkQueue)
newQueue = newQueue &amp; speedwalkQueue(iCount) &amp; VBCrLf
world.DeleteVariable &quot;QueueTemp&quot;
setvariable &quot;QueueTemp&quot;, newQueue
world.discardqueue
next
End If
enablealias &quot;speedwalkresume&quot;, 1</send>
</alias>
<alias
name="SpeedwalkResume"
match="^resume$"
enabled="y"
echo_alias="y"
regexp="y"
send_to="12"
ignore_case="y"
sequence="100"
>
<send>dim speedwalkQueue2

speedwalkQueue2 = world.GetVariable (&quot;QueueTemp&quot;)
world.addalias &quot;SpeedwalkResume2&quot;, &quot;resume2&quot;, speedwalkQueue2, 5121, &quot;&quot;
world.Execute &quot;resume2&quot; '</send>
</alias>



My 'resume' alias might not be pretty, but it actually seems to work.
USA #3
My error was because it was QueueTemp and in my alias I had TempQueue.
If you change it, it should work.

And that way you wont have to worry about adding aliases, or anything.
Amended on Mon 04 Oct 2004 07:56 PM by Flannel
#4
That did it. It works now!
Thanks again, Flannel.