Sign in to follow this  
Followers 0
LordKaos

A few things

5 posts in this topic

MouseClick("left", 511, 153, 1, 5)

How would I randomize this so instead of clicking in that exact spot it click between lets say 500 - 550 and 100 - 160?

And is there a way to randomize sleep times as well?

After my script is completely finished is there a way I can set a spot for it to repeat but lets say I have steps

1 - 10 and only want it to repeat steps 3 - 10.

Thanks.

Share this post


Link to post
Share on other sites



Hi LordKaos,

Use the Random() function.

Look it up in the helpfile.

For the repetition you could use a Loop.

Again, see the helpfile.

Regards,

Hannes

:)


Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]

Share this post


Link to post
Share on other sites

So I would write it as:

MouseClick("left", Random(500, 550, 1), Random(100, 160, 1) 1, 5) - Meaning x 500-550, y 100-160

Sleep(Random(5000, 10000, 1,)) - Meaning 5 to 10 seconds

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

MouseClick doesn't have a "sleep" time.

The last parameter ( where you have "5", is how fast the mouse moves to click the location you've chosen for parameter x and y ).

If you wanted to incorporate something with a delay, you would do something like.

Sleep(Random(5000, 10000, 1))
MouseClick("primary", Random(500, 550, 1), Random(100, 160, 1))
Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Yup Yup, I know that, the Sleep is a seperate line and simply a delay.

MouseClick("left", Random(500, 550, 1), Random(100, 160, 1), 1, 5)

Is How I ment to write it... Left click, x through x, y though y, 1 click, movement speed 5... I was just asking if I had wrote it right before trying to incorporate it into my script

Sleep(Random(5000, 10000, 1,))

Equals a random program sleep time between 5 - 10 seconds right? the reason I ask on that is if it changes it out of milliseconds?

But sense you posted it pretty much the same, I know that's how it works and thank you.

Edited by LordKaos

Share this post


Link to post
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
Sign in to follow this  
Followers 0