Autoclicker loop broken?
Posted: 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