LordKaos Posted February 14, 2011 Posted February 14, 2011 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.
hannes08 Posted February 14, 2011 Posted February 14, 2011 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]
LordKaos Posted February 15, 2011 Author Posted February 15, 2011 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
Moderators SmOke_N Posted February 15, 2011 Moderators Posted February 15, 2011 (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 February 15, 2011 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.
LordKaos Posted February 16, 2011 Author Posted February 16, 2011 (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 February 16, 2011 by LordKaos
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