Wait command/function

Shrike

Member
I am trying to introduce a wait delay when launching drones but am getting the following error when using a simple 'wait' within a method :

'wait' is not available in atoms

Can anyone point me in the direction of how to do this ?

Thanks
 

Amadeus

The Maestro
Staff member
You cannot put a 'wait' in atomic functions -- it's not possible. This is a feature of lavishscript and a design limitation (or feature) of evebot.

The simple answer is to have the atom launch a new script that has the sole purpose of "waiting" and then launching drones (while the calling atom does nothing.) Scripts work like 'threads' in real programming languages, so the concept works. However, I don't think that lavishscript has any sort of blocking variables (ie, "mutex" type variables) to stop the current thread until the new one has finished ..therefore, your original script will continue to go while the new one is "waiting and launching drones", if that makes sense.
 

Plecks

Active Member
Something I did in similar situations for the pulse-based bots of WoW was use timers based on ${LavishScript.RunningTime}. Basically, when you want to start "waiting", you set a variable to something like ${Math.Calc[${LavishScript.RunningTime}+3000]} (now + 3 seconds), then simply keep returning out of the function until ${TimeVar} <= ${LavishScript.RunningTime}, then do whatever it is you wanted to do after 3 seconds.

Whether this is applicable depends on exactly what you're trying to do.
 
Top Bottom