Sending commands after DoAfter

Posted by Stoned00d on Sun 05 May 2002 10:10 PM — 6 posts, 21,769 views.

#0
Hypothetically, if I did the following (in VB):

world.doafter 10, AAA
world.send BBB

would command AAA or BBB be executed first? If AAA gets executed first, is there anyway to send a command between the doafter and not leave myself hanging?
Australia Forum Administrator #1
Send is done immediately, DoAfter makes a timer. Thus, BBB would be done first.

What do you mean "is there anyway to send a command between the doafter"? Do you mean "after" the DoAfter?

Here are a couple of ways ...


world.doafter 10, "AAA"
world.doafter 11, "BBB"


That sends AAA after 10 seconds, and "BBB" a second later.

But, if you want to do AAA and BBB one after the other, do this ...


world.doafter 10, "AAA" & vbCrLf & "BBB"


The "vbCrLf" is a Carriage-return/Line Feed, in other words, a new line.

If you want to do a lot of things, just lay out your code like this ...


world.doafter 10, _
  "AAA" & vbCrLf _
  "BBB" & vbCrLf _
  "CCC" & vbCrLf _
  "DDD" & vbCrLf _
  "EEE" & vbCrLf
#2
nono, you explaination was great. What I was wondering was whether using DoAfter would incapacitate my ability to input additional commands after the DoAfter was entered but not yet executed.
Australia Forum Administrator #3
No it will not. Unlike the speedwalk queue, where new commands are entered at the end of the queue, DoAfter works differently. It is simply a shorthand way of creating a once-off timer. Until the timer fires you can do anything you want.

So, for example, in a fight you might do this:

/doafter 15, "cast heal self"

... and then keep fighting, knowing that after 15 seconds you will be healed. In the meantime (during those 15 seconds) you can enter as many commands as you want.
#4
I upgraded to 3.20 yesterday, and I'm having some problems with doafter

After typing in
/world.doafter 2, "cast heal"
and waited to be healed. However, after 2 seconds nothing happened? Did I do somethign wrogn?
Australia Forum Administrator #5
What you typed was OK, but there might be one of two problems ...

  1. This is a script function so make sure scripting is enabled in world configuration.
  2. It uses timers, so make sure timers are enabled.