Originally Posted by SlowCoder
I've written a RollDice() function that animates the rolling of dice. The function uses setTimeout to call itself a number of times. A variable DiceRolling is true when the routine is running, and once complete, DiceRolling is set false.
I have other automated routines that need to run after the routine is completed.
What is the best way to "pause" my script until the RollDice routine has completed?
Split it into two scripts at the point where you want it to pause. Call the second script when the pause period is over.