Autoclicker loop broken?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
HKUK01
Posts: 7
Joined: 18 Jun 2018, 12:48

Autoclicker loop broken?

19 Jun 2018, 06:27

With the help of the community I managed to make this autoclicker with the code below which clicks on a random location and sleeps for a random amount of time within a specific range. However, with every other loop the code executes, it seems to miss out 'click 2,' e.g. everything will work perfect on loops 1,3,5,7 etc but will hit every click except 'click 2' on loops 2,4,6,8 etc. Is there something wrong with the code? Any help will be greatly appreciated.

Code: Select all

F1::
	Loop, 46
	{
		randClick(865, 533, 1094, 662) ;click1
		Sleep rand(2313, 3604)	
		randClick(1004, 736, 1005, 737) ;click2
		Sleep rand(1890, 2945)
		randClick(565, 96, 742 , 177) ;click3
		Sleep rand(2104, 2502)
		randClick(950, 696, 1238, 711) ;click4
	}
Return

rand(min, max) {
	Random, rand, min, max
	return rand
}

randClick(x1, y1, x2, y2) {
	x := rand(x1, x2)
	y := rand(y1, y2)
	Click %x%, %y%
}

Esc::ExitApp
Last edited by HKUK01 on 20 Jun 2018, 08:35, edited 1 time in total.
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Autoclicker loop broken?

19 Jun 2018, 13:53

its probably clicking, but likely somewhere you arent expecting it to. Select an appropriate CoordMode and test again
HKUK01
Posts: 7
Joined: 18 Jun 2018, 12:48

Re: Autoclicker loop broken?

19 Jun 2018, 14:14

swagfag wrote:its probably clicking, but likely somewhere you arent expecting it to. Select an appropriate CoordMode and test again
I tried adding a double click and changing the co-ordinates slightly but doesn't seem to help. The cursor just ignores only click 2 on loops 2,4,6 etc. but hits every other click on all loops inc. 2,4,6 etc.
HKUK01
Posts: 7
Joined: 18 Jun 2018, 12:48

Re: Autoclicker loop broken?

20 Jun 2018, 08:23

anyone have any ideas?
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Autoclicker loop broken?

20 Jun 2018, 15:52

is this for a game? are you clicking on windows? did u try a different coordmode yet? idk what to tell you, the functions obviously fire unobstructed so it aint a problem with the script per se. If u arent getting the clicks youre expecting, it might be smth to do with the thing thats supposed to receive them(whether that be a game or an app, some require additional delay to register), it might be that the coordinates are wrong. Besides that, short of posting a video of whats wrong with it, i dont think i can help u any further

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Anput, Marium0505, Nerafius and 188 guests