Jump to content

help on gettingrandom values


Scy
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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 by dbzfanatic
Link to comment
Share on other sites

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)
Link to comment
Share on other sites

Func _RandomArray()
Local $alpha[26]
$alpha[0] = "a"
$alpha[1] = "b"
; etc.
Return $alpha[Random(26)]
EndFunc

Something like that?

AlmarM

Edited 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.

Link to comment
Share on other sites

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. :P

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...