Jump to content

Random Number Generator?


JStone
 Share

Recommended Posts

Basically, I'm looking to create a random number between two values, such as 5150ms and 6230ms. I would be using it as a sleep between a macro.

Example:

For $count = 1 To 5000
    sleep(5000)
    MouseClick("left")
    sleep(x) ;where 'x' is a random number between 5150-6230
Next
Link to comment
Share on other sites

Yes. Where you generate the number is based on whether you want it to change every loop or just once.

To generate a number between [a,b], you just use this equation:

a + R * (b - a)

where R is U[0,1) (uniformly random between 0 and 1)

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