I've seen the suggestion asking for a wait command to use in triggers and aliases, what I was hoping to ask for is a method added to the World object that basically encapsulates the Sleep() API. In other scripting engines I can utilize the WScript object's Sleep method. Unfortunately I can't instance just the WScript object itself through CreateObject().
I'd hate to dig out my copy of VB just to make a dll with this one function. :)
Have I missed something? :)
Thank you for a great product.
The problem with just adding sleep to the scripting engine is that it probably won't have the effect you want. Basically the sleep API makes the process that calls it stop doing anything for the nominated interval.
However, if you had two worlds open, for instance, then you probably don't want the second one to freeze while the first one sleeps.
Also, you really want to keep processing incoming input from the MUD, even if you are not wanting to send anything for a few seconds.
Thus, rather than sleeping, I recommend using timers instead. You can script a "one-shot" timer (one that does something once), to fire after a nominated time. There are various examples on the forum, and I think someone did a small script function to simplify doing this.
Thus, rather than doing this:
world.send "north"
world.sleep (5) // sleep for 5 seconds (not implemented!)
world.send "east"
You would do instead:
world.send "north"
// add a timer here with world.addtimer
// whent the timer fires it does a world.send "east".