Jump to content

Recommended Posts

Posted

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.

Posted (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 10

MouseClick("left",10,10)

Sleep($random_time)

.

.

.

Edited by pedmacedo
Posted

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 10

MouseClick("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 ;(

Posted

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)

Posted

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

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...