538CQ-7W0W6-63022-476BW-24VS1
They had to be completely random and still be totally unique, I have the random part nailed down but having trouble making them totally unique. If only used for a few codes it works fine but with millions of codes being generated there could be a few that turn up to be identical. If anyone knows a better way to do this script please post your suggestions. I would also like to randomize the generation of lowercase and higher case letters if possible.
Code: Select all
Let>INPUT_PASSWORD=0
Let>INPUT_BROWSE=0
Input>NUMBERINSET,How Many Characters Per Set Need To Be Generated?,
Input>NUMBEROFNUMBERSETS,How Many Characters Sets Need To Be Generated?,
Input>NUMBEROFCODES,How Many Codes Need To Be Generated?,
RunProgram>C:\Windows\System32\notepad.exe
WaitWindowOpen>Untitled - Notepad
SetFocus>Untitled - Notepad
Let>NUMBEROFCODESGENERATED=0
Label>RINCEANDREPEATRESET
Let>BLOCK=0
Label>RINCEANDREPEAT
Let>BLOCK=BLOCK+1
Let>KEYCODES=0
Let>CURRENTGEN=0
SetFocus>Untitled - Notepad
Repeat>KEYCODES
Let>KEYCODES=KEYCODES+1
Let>SETONELETTER=0
//Choose Letter Or Number
Random>2,SKIPONE
If>SKIPONE=1
GoTo>NUMBERONE
Else>SKIPONE<>1
GoTo>LETTERONE
Endif
Label>LETTERONE
//Chooses Letter
Repeat>SETONELETTER
Let>SETONELETTER=SETONELETTER+1
Random>26,RANDOMGEN
If>RANDOMGEN=1
Let>RANDOMGEN=Z
GoTo>SENDTORANDOMGEN001
Endif
If>RANDOMGEN=2
Let>RANDOMGEN=A
GoTo>SENDTORANDOMGEN001
Endif
If>RANDOMGEN=3
Let>RANDOMGEN=B
GoTo>SENDTORANDOMGEN001
Endif
If>RANDOMGEN=4
Let>RANDOMGEN=C
GoTo>SENDTORANDOMGEN001
Endif
If>RANDOMGEN=5
Let>RANDOMGEN=D
GoTo>SENDTORANDOMGEN001
Endif
If>RANDOMGEN=6
Let>RANDOMGEN=E
GoTo>SENDTORANDOMGEN001
Endif
If>RANDOMGEN=7
Let>RANDOMGEN=F
GoTo>SENDTORANDOMGEN001
Endif
If>RANDOMGEN=8
Let>RANDOMGEN=G
GoTo>SENDTORANDOMGEN001
Endif
If>RANDOMGEN=9
Let>RANDOMGEN=H
GoTo>SENDTORANDOMGEN001
Endif
If>RANDOMGEN=10
Let>RANDOMGEN=I
GoTo>SENDTORANDOMGEN001
Endif
If>RANDOMGEN=11
Let>RANDOMGEN=J
GoTo>SENDTORANDOMGEN001
Endif
If>RANDOMGEN=12
Let>RANDOMGEN=K
GoTo>SENDTORANDOMGEN001
Endif
If>RANDOMGEN=13
Let>RANDOMGEN=L
GoTo>SENDTORANDOMGEN001
Endif
If>RANDOMGEN=14
Let>RANDOMGEN=M
GoTo>SENDTORANDOMGEN001
Endif
If>RANDOMGEN=15
Let>RANDOMGEN=N
GoTo>SENDTORANDOMGEN001
Endif
If>RANDOMGEN=16
Let>RANDOMGEN=O
GoTo>SENDTORANDOMGEN001
Endif
If>RANDOMGEN=17
Let>RANDOMGEN=P
GoTo>SENDTORANDOMGEN001
Endif
If>RANDOMGEN=18
Let>RANDOMGEN=Q
GoTo>SENDTORANDOMGEN001
Endif
If>RANDOMGEN=19
Let>RANDOMGEN=R
GoTo>SENDTORANDOMGEN001
Endif
If>RANDOMGEN=20
Let>RANDOMGEN=S
GoTo>SENDTORANDOMGEN001
Endif
If>RANDOMGEN=21
Let>RANDOMGEN=T
GoTo>SENDTORANDOMGEN001
Endif
If>RANDOMGEN=22
Let>RANDOMGEN=U
GoTo>SENDTORANDOMGEN001
Endif
If>RANDOMGEN=23
Let>RANDOMGEN=V
GoTo>SENDTORANDOMGEN001
Endif
If>RANDOMGEN=24
Let>RANDOMGEN=W
GoTo>SENDTORANDOMGEN001
Endif
If>RANDOMGEN=25
Let>RANDOMGEN=X
GoTo>SENDTORANDOMGEN001
Endif
If>RANDOMGEN=26
Let>RANDOMGEN=Y
GoTo>SENDTORANDOMGEN001
Endif
If>RANDOMGEN=0
Let>RANDOMGEN=Y
GoTo>SENDTORANDOMGEN001
Endif
Label>SENDTORANDOMGEN001
Send>%RANDOMGEN%
Until>SETONELETTER>0
GoTo>SKIPNUMBERONE
Label>NUMBERONE
//Chooses Number
Let>SETONENUMBER=0
Repeat>SETONENUMBER
Let>SETONENUMBER=SETONENUMBER+1
Random>9,RANDOMGEN
Send>%RANDOMGEN%
Let>CURRENTGEN=%RANDOMGEN%
Until>SETONENUMBER>0
Label>SKIPNUMBERONE
Until>KEYCODES=%NUMBERINSET%
If>BLOCK=%NUMBEROFNUMBERSETS%
SetFocus>Untitled - Notepad
Press Enter
GoTo>ENDSTRING
Endif
If>BLOCK<%NUMBEROFNUMBERSETS%
SetFocus>Untitled - Notepad
Send>-
GoTo>RINCEANDREPEAT
Endif
Label>ENDSTRING
Let>NUMBEROFCODESGENERATED=NUMBEROFCODESGENERATED+1
If>NUMBEROFCODESGENERATED=%NUMBEROFCODES%
GoTo>ENDSCRIPT
Endif
GoTo>RINCEANDREPEATRESET
Label>ENDSCRIPT