Setting a sleep command to a random integer

Posted by Greytopryu on Sat 28 Jun 2008 08:19 PM — 2 posts, 16,599 views.

#0
Good afternoon all,

This is most likely a stupid basic question so please forgive me but I've been running into a dilemma.
My code:
set WSHShell = CreateObject("WScript.Shell")


dim max,min
max=10000
min=500

Dim RNDM
Randomize
RNDM=((max)*Rnd+min)


Do While 1=1
WSHShell.SendKeys "{F5}"
WScript.Sleep (RNDM)
loop

Should be returning a random sleep time in between each F5. Instead, it waits the same amount of time in between. This code was previously working to generate a random number, now that i put it infront of a sleep command its not working correctly. Any ideas?
Australia Forum Administrator #1
See http://mushclient.com/faq point 25.