gring0 Posted April 2, 2006 Share Posted April 2, 2006 (edited) well, i'm new here and i'm brazilian, so i dont speak english as well but ok, i made a simple program that create passwords, but the script is too big and i wanna know how can i make it smaller. here is the code: Global $array[12] $array[11] = "l" $array[10] = "k" $array[9] = "j" $array[8] = "i" $array[7] = "h" $array[6] = "g" $array[5] = "f" $array[4] = "e" $array[3] = "d" $array[2] = "c" $array[1] = "b" $array[0] = "a" $b = Random(0, 11, 1) $c = Random(0, 11, 1) $d = Random(0, 11, 1) $e = Random(0, 11, 1) $f = Random(0, 11, 1) $g = Random(0, 11, 1) $h = Random(0, 11, 1) $i = Random(0, 11, 1) $j = Random(0, 11, 1) $k = Random(0, 11, 1) $l = Random(0, 11, 1) $m = Random(0, 11, 1) MsgBox(0, "Gerated Password", $array[$b] & $array[$c] & $array[$d] & $array[$e] & $array[$f] _ & $array[$g] & $array[$h] & $array[$i] & $array[$j] & $array[$k] & $array[$l] & $array[$m]) you all can see that its a big file, and i'm only using 12 letters thanks for the help Edited April 2, 2006 by gring0 Never judge my awesome brazilian-english language :D:D<-- lol ;P Link to comment Share on other sites More sharing options...
greenmachine Posted April 2, 2006 Share Posted April 2, 2006 $Password = "" For $i = 1 To 12 $Password &= Chr (Random (97, 108, 1)) Next MsgBox (0, "pass", $Password) &= uses beta, so get it if you don't have it, or use $Password = $Password & Chr (Random (97, 108, 1)) instead. Link to comment Share on other sites More sharing options...
Developers Jos Posted April 2, 2006 Developers Share Posted April 2, 2006 This is a routne that will return a password of the requested length and uses randomly A-Z, a-z 0-9 MsgBox(0, "password", GenPassWord(5)) ; Generate New Password Func GenPassWord($length) Local $psw = "" For $x = 1 To $length $r = Random(1, 3, 1) Select Case $r = 1 $psw = $psw & Chr(48 + Random(0, 9, 1)) Case $r = 2 $psw = $psw & Chr(65 + Random(0, 25, 1)) Case $r = 3 $psw = $psw & Chr(97 + Random(0, 25, 1)) EndSelect Next Return $psw EndFunc ;==>GenPassWord SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now