The Un-Official Proxomitron Forum

Full Version: help with rand
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hey im new here and i wanted to know is it possible to do sendkeys with the rand function?and then echo it?
this is what i have

WshShell.SendKeys("benny $num = rand(100,999)")
WshShell.SendKeys("~")
WScript.Echo "username= benny $num;"
Hello!

I'm not familiar with Wsh, but I have some experience with ASP and VBScript, so try this:

Code:
num = rand(100,999)
WshShell.SendKeys("benny $num = " & num)
WshShell.SendKeys("~")
WScript.Echo "username= benny " & num & ";"

The main idea is storing the random number in a variable, then displaying the variable in the subsequent lines.

I'm not sure if the Rand function exists in Wsh; if it doesn't, I know that "Rnd()" exists.
Reference URL's