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
➜ Tips and tricks
➜ Speedwalk Queue
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| Christof
(10 posts) Bio
|
| Date
| Fri 14 Mar 2003 03:02 AM (UTC) |
| Message
| 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 :)
| | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #1 on Fri 14 Mar 2003 04:02 AM (UTC) |
| Message
| 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). |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Christof
(10 posts) Bio
|
| Date
| Reply #2 on Fri 14 Mar 2003 04:43 AM (UTC) |
| Message
| Alright. I think I've made progress...
The status bar that my mud uses is similar to:
I have a trigger like the one you specified in the example script...
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?
:) | | Top |
|
| Posted by
| Christof
(10 posts) Bio
|
| Date
| Reply #3 on Fri 14 Mar 2003 08:50 AM (UTC) |
| Message
| 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 | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #4 on Fri 14 Mar 2003 09:30 PM (UTC) |
| Message
| 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
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
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.
17,915 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top