Scy Posted October 25, 2008 Posted October 25, 2008 Hi! how can i get a random value? from a-z ex. i have a code like Local $alpha[26] = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"] will random(min,max) work? help pls. Thnx.
dbzfanatic Posted October 25, 2008 Posted October 25, 2008 (edited) I can help (as can most members here) but a quick question first. Why? Edit: Not asking why we should help,just asking what you need it for. Edited October 25, 2008 by dbzfanatic Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote]
Malkey Posted October 25, 2008 Posted October 25, 2008 Hi! how can i get a random value? from a-z ex. i have a code like Local $alpha[26] = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"] will random(min,max) work? help pls. Thnx.Welcome to the forums. Here are two ways. There would be more ways of doing this. First - Randomizes the index of the $alpha array, Second - Displays a random ascii character between 97 = "a" and 122 = "z". Local $alpha[26] = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"] Local $sRes ; One way $sRes = "Random Index = " For $x = 0 To 25 $sRes &= $alpha[Random(0, 25, 1)] Next ; Another way $sRes &= @CRLF & @CRLF & "Chr(random) = " For $x = 0 To 25 $sRes &= Chr(Random(97, 122, 1)) Next MsgBox(0, "", $sRes)
AlmarM Posted October 25, 2008 Posted October 25, 2008 (edited) Func _RandomArray() Local $alpha[26] $alpha[0] = "a" $alpha[1] = "b" ; etc. Return $alpha[Random(26)] EndFunc Something like that? AlmarM Edited October 25, 2008 by AlmarM Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.
Scy Posted October 25, 2008 Author Posted October 25, 2008 THANK YOU SO MUCH for fast replies and help!! I asked for this code bcoz i want to create a program that can create random passwords for me. I am playing online games and i want to secure my account by changing it to random passwords. That's what i want but I have to learn more autoit code to be able to do something like that. I really want to learn autoit. Thanks again.
AlmarM Posted October 25, 2008 Posted October 25, 2008 Haha, you could also use the 'Password Generator' in my sig ;P AlmarM Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.
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