Abdullah Posted January 11, 2011 Posted January 11, 2011 Hi. I am new and basically. I needed some help in writing a script. I want to make three clicks at certian places of the screen. (10, 10). (50, 50). & (100, 100) but the time has to be randomized.. can anybody tell me how to do that? Thanks.
pedmacedo Posted January 11, 2011 Posted January 11, 2011 (edited) You mean the time between the clicks?Just do this:$random_time = Random(1,10,1); This will generate a random integer number between 1 and 10MouseClick("left",10,10)Sleep($random_time)... Edited January 11, 2011 by pedmacedo
Abdullah Posted January 11, 2011 Author Posted January 11, 2011 You mean the time between the clicks?Just do this:What about more than one clicks?
Abdullah Posted January 11, 2011 Author Posted January 11, 2011 What about more than one clicks?Between two clicks it: i wrote it like this: Exaple.$random_time = Random(1,10,1); This will generate a random integer number between 1 and 10MouseClick("left",10,10)MouseClick("left",20,10)MouseClick("left",30,10)MouseClick("left",40,10)MouseClick("left",50,10)Sleep($random_time)And it is just keep clicking one after another no wait ;(
pedmacedo Posted January 11, 2011 Posted January 11, 2011 What about more than one clicks?Just use the Random function again.$random_time = Random(1,10,1);MouseClick("left",10,10)Sleep($random_time)$random_time = Random(1,10,1);MouseClick("left",50,50)Sleep($random_time)MouseClick("left",100,100)$random_time = Random(1,10,1);Sleep($random_time)
Abdullah Posted January 11, 2011 Author Posted January 11, 2011 Just use the Random function again. Thxs.. a lot.. but is there any way? I can set the random seconds too?Seconds for 10sec - 2mins.?
somdcomputerguy Posted January 11, 2011 Posted January 11, 2011 (edited) Sleep() takes milliseconds as a parameter. So Sleep(1000) 'sleeps' for 1 second. Edited January 11, 2011 by somdcomputerguy - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
Varian Posted January 11, 2011 Posted January 11, 2011 Hope this helps:HotKeySet('{ESC}', '_Exit') Local $Coordinates[3][2] = [[10, 10],[50, 50],[100, 100]] ;Array for coordinates 10,10 50,50 100,100 While 1 For $i = 0 To UBound($Coordinates) - 1 Local $Random_Time = Random(1, 10, 1); This will generate a random integer number between and 10 MouseClick("left", $Coordinates[$i][0], $Coordinates[$i][1]) Sleep($Random_Time * 1000) ;From 1 Second to 10 Seconds Next WEnd Func _Exit() Exit EndFunc
kylomas Posted January 11, 2011 Posted January 11, 2011 Doing my DAMNDEST to think of a legit need for this ?!?!?!? Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill
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