Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to generate a random number or letter?
#1
I was wondering how I could generate a random number between 0 to 9999 and also how to generate a random letter from a to z, thank you in advance.
#2
Try this:
Macro Macro14
Code:
Copy      Help
out
;Generate 20 random numbers from 1-9999
rep 20
,out RandomInt(1 9999)
out "----"
;Generate 20 random characters from a-z
rep 20
,out _s.RandomString(1 1 "a-z")
#3
It worked except it only appears in the macro program itself, I would like to use it to create accounts, things like that. In this case, what the script would look like after clicking on a form to fill or notepad,etc in order to make it work? Thank you in advance.
#4
This will populate notepad with random numbers and characters.
Macro Random for Notepad
Code:
Copy      Help
run "notepad.exe"
wait 0 WA win("Notepad" "Notepad")
;Generate random number from 1-9999
rep 10
,outp RandomInt(1 9999)
,'Y
outp "----[]"
;Generate random character from a-z
rep 10
,outp _s.RandomString(1 1 "a-z")
,'Y
for form you could search on this site for some examples like this one:
Example: parse text file (table) and populate web form
Could this be done with a macro, or require programming?
#5
Thanks a lot Smile it worked


Forum Jump:


Users browsing this thread: 1 Guest(s)