Guest DrObvious Posted April 22, 2004 Posted April 22, 2004 I'm trying to put random numbers in my script, and I have the random function in there, but each time through my loop I get the same number. Do I need to put in some kind of seed or anything else? Right now, my code looks like: $x = Random(1,$rval) And then it goes on to some if/then statements that depend on $x. Every time I go through the loop, $x always ends up as 8 (which is what I have $rval set as).
CyberSlug Posted April 22, 2004 Posted April 22, 2004 Hmm, random numbers look fine in this test:For $i = 1 to 10 ToolTip( Random(1,8) , 0,0) sleep(500)NextAh, maybe you are expecting an integer value! Try:$x = Int(1+Random(1, $rval))I imagine all the other cases are failing, and it defaults to the Else-case. Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Guest DrObvious Posted April 22, 2004 Posted April 22, 2004 thanks, will try! (though tomorrow cause I gotta go unfortunately :-/)
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