Jump to content

Recommended Posts

Posted

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
Posted (edited)

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

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
×
×
  • Create New...