Speedwalk Queue

Posted by Christof on Fri 14 Mar 2003 03:02 AM — 5 posts, 18,811 views.

#0
Hello.

I have what I think is a uniqe problem that I can't seem to find a work around for. In the mud I play, when using large speedwalks, I tend to run out of stamina (a.k.a. movement points). What I'm looking to do is to temporarily suspend the speedwalk queue, cast a spell to renew my stamina, and then continue. The best I've gotten mushclient to do so far it to discard the queue with the DiscardQueue() function. I can't seem to figure out a way to 'pause' it, cast, and then resume it. That, and my VB scripting knowhow is limited. I'd appreciate any help on this matter.

Thanks :)
Australia Forum Administrator #1
What you could do when you detect your movement points are getting low is save the current queue (world.GetQueue). This would involve putting it somewhere, like a VB array, or bang the queued items together with a special character between them (like "*") and put into a variable. Then call world.DiscardQueue to get rid of it.

Then when the movement points are up again, use world.Queue to re-queue the outstanding commands (eg. use the Split command in VB to recreate an array of items from your variable).
#2
Alright. I think I've made progress...

The status bar that my mud uses is similar to:

<1903hp 959sp 2004st>


I have a trigger like the one you specified in the example script...

<*hp *sp *st>*


That trigger refrences to a subroutine:


Sub Stats (strTriggerName, trig_line, arrWildCards)

dim iHP
dim iSP
dim iST

iHP = arrWildCards (1)
iSP = arrWildCards (2)
iST = arrWildCards (3)

If iST < 1500 then
SpeedWalkQueue = World.GetQueue 'gets the queue
World.DiscardQueue 'discards it
World.Send "c 'refresh'" 'sends the text to refresh stamina
World.EnableTrigger "StatusBar", FALSE  ' disables the trigger so it doesn't spam the spell

End If


Once that spell fires off, and is completed, I have a trigger that refrences this code...

Sub Refresh (strTriggerName, trig_line, arrWildCards)

If strTriggerName = "cRefresh" Then
World.EnableTrigger "StatusBar", TRUE 'enables trigger
World.Queue SpeedWalkQueue
End If

End Sub


The variable SpeedWalkQueue is declared below the option explicit statement in the script file.

The problems I'm getting are that it stops motion, casts the spell, waits for the sucess trigger, then sends the next command in the queue. It only seems to see one command when it sets the World.GetQueue to SpeedWalkQueue. Am I missing something here?

:)
#3
Alright. I've gotten MushClient to stop the speedwalk, store it into a variable... but now, how do I take a string of movement commands such as:

w w w w n n w n n nw n n nw


and turn that back into a speedwalk that MushClient recognizes?

--Christof
Australia Forum Administrator #4
Your variable SpeedWalkQueue is an array, so you need to "walk" the array to pull out each item. Something like this:



If Not IsEmpty (SpeedWalkQueue) then

  For Each s In SpeedWalkQueue 
    world.Queue s, vbFalse
  Next

End If