Adding a random delay

Help section from before the user variable changes that broke all macros

Moderator: MacroQuest Developers

anon02
decaying skeleton
decaying skeleton
Posts: 8
Joined: Fri Oct 11, 2002 9:28 am

Adding a random delay

Post by anon02 » Wed Oct 23, 2002 12:24 pm

Is there a way to create a random number between 2 numbers? i.e. between 10 and 15 or is it better to /delay 10, then have another /delay between 0 and 5?

I want to create a (somewhat) random wait time in between events, but I'm not quite sure how to do that.

Would something like this work:
/delay 10
/delay $rand(10)

Which would give you a 1 second delay, then up to another second of delay?

Thanks for the help :)

DaRoot
orc pawn
orc pawn
Posts: 15
Joined: Sat Oct 05, 2002 10:39 pm

Post by DaRoot » Wed Oct 23, 2002 1:06 pm

maybe try...

/delay $rand(1,10)

or

/delay $rand 1 to 10

I dont thing specifying the delay to 10 first would work because the script is going to process your /delay 10 and pause for 10 sec before moving on to your /delay $rand part.

dont know if any of the above two will work, but its worth a try

Azrath
decaying skeleton
decaying skeleton
Posts: 2
Joined: Mon Sep 30, 2002 11:23 pm

Post by Azrath » Fri Oct 25, 2002 12:08 pm

I might be wrong (still learning the in's and out's of MQ), but if the above suggestions don't work, you might want to try doing a random 1 - 10 and setting it as a var, then using that var for the delay.

Btw, please let me know if that works, still trying to get a feel for the MQ scripting language.