Here is the RANDOMIZE command from VBS. It sets the KiX Pseudo Random Number Generator seed to a mostly random number: The SECONDS of the current time multiplied by the MILLISECONDS of the current time.This gives us a number from 0 to 8541 (59*99). If this is not good enough for you, this can be further expanded by multiplying that by the current hour, date and month to give 0 to up to 49 975 596 (almost 50 million)
Randomize.k2k
code:
break on
; shuffle the KPRNG
Randomize
; display the first 10 numbers
for $i=1 to 10
rnd() ?
next
; the Randsomize function
Function Randomize
; create a file that contains only a carriage return
dim $ $=redirectoutput("cr", 1) ? $=redirectoutput("")
; get the current system time and dump it to a file
shell "%comspec% /c time <cr >time.txt"
; time.txt contains "The current time is: 4:10:09.28"
$=open(1, "time.txt")
; seed the KPRNG with the milliseconds multiplied by the seconds
srnd(val(substr(readline(1), 31, 2))*val(substr(@time, 7, 2)))
; clean up files
$=close(1)
del "cr" del "time.txt"
EndFunction
cj