Clicking for select period of time

Ask gaming related questions (AHK v1.1 and older)
ader5429
Posts: 1
Joined: 24 Oct 2020, 12:34

Clicking for select period of time

Post by ader5429 » 24 Oct 2020, 12:44

So basically, I'm trying to make a script that only clicks for a certain amount of time (in this case, 1 minute and 15 seconds.) and then waits 15 seconds before starting to click once more. The problem is, I have no clue what I'm doing. Can anyone help me out here?

My code:
(Sorry for not using that thing that indents it or whatever, I'm new to these forums)

Code: Select all

F2::
Loop{
Click
Sleep 10
}

F3::Restart
[Mod edit: [code][/code] tags added. it's easy - have a go!]

Rohwedder
Posts: 7647
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Clicking for select period of time

Post by Rohwedder » 25 Oct 2020, 02:21

hallo,
try:

Code: Select all

F2::
Endtime := A_TickCount + 75000 ;Now + 1 minute and 15 seconds
While, A_TickCount < Endtime
{
	Click
	Sleep, 10
}
Return
F3::Restart

Post Reply

Return to “Gaming Help (v1)”