Autoclicker to Press a certain button within a randomized area

Ask gaming related questions (AHK v1.1 and older)
Ryaber
Posts: 3
Joined: 21 Apr 2016, 09:17

Autoclicker to Press a certain button within a randomized area

Post by Ryaber » 22 Jan 2023, 11:07

Code: Select all


^m::SetTimer, ^n, Off
^n::
Click
Random, rnd, 33421, 68754
SetTimer, ^n, %rnd%
Return

Hey, I have this autoclicker that clicks within a random amount of time but I'm wanting to add to it so that it'll first press the key "H" and then click within a randomized approximately 2x2 millimeter square area of pixels - so if you could adjust this current ahk script just so it incorporates that as well (and keeping the randomized timeframe in between doing so), so it'll still be able to be toggled on with Ctrl N and off with the Ctrl M toggle would be super helpful! I remember making a script for clicking in a randomized area of pixels before but not sure how it should go with the pressing a key and autoclicking incorporated with it, so I appreciate the help!

Ryaber
Posts: 3
Joined: 21 Apr 2016, 09:17

Re: Autoclicker to Press a certain button within a randomized area

Post by Ryaber » 22 Jan 2023, 11:35

I maybe should've mentioned to help clarify, that the area in which it clicks should be the same exact location but just randomized within that "square" area of pixels

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

Re: Autoclicker to Press a certain button within a randomized area

Post by Rohwedder » 24 Jan 2023, 10:34

Hallo,
try:

Code: Select all

^m::SetTimer, ^n, Off
^n::
Random, x, -10, 10
Random, y, -10, 10
MouseMove, x, y, 0, R
Click
MouseMove, -x, -y, 0, R
Random, rnd, 33421, 68754
SetTimer, ^n, %rnd%
Return

Fun54321
Posts: 4
Joined: 23 Jun 2022, 04:21

Re: Autoclicker to Press a certain button within a randomized area

Post by Fun54321 » 25 Jan 2023, 12:06

Rohwedder wrote:
24 Jan 2023, 10:34
Hallo,
try:

Code: Select all

^m::SetTimer, ^n, Off
^n::
Random, x, -10, 10
Random, y, -10, 10
MouseMove, x, y, 0, R
Click
MouseMove, -x, -y, 0, R
Random, rnd, 33421, 68754
SetTimer, ^n, %rnd%
Return
Thank you for this, I looked over the script but where does it incorporate pressing the "H" key before it clicks as well? So in the game it would need to press the hotkey "H" and then click with the mouse in that randomized area and then repeat the action again, press "H" then click in area, again and again. Thank you for trying to help me out though!

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

Re: Autoclicker to Press a certain button within a randomized area

Post by Rohwedder » 26 Jan 2023, 10:36

I overlooked the part about pressing the "H" key. However, it should not be difficult to add this.

Fun54321
Posts: 4
Joined: 23 Jun 2022, 04:21

Re: Autoclicker to Press a certain button within a randomized area

Post by Fun54321 » 28 Jan 2023, 03:59

Fun54321 wrote:
25 Jan 2023, 12:06
Rohwedder wrote:
24 Jan 2023, 10:34
Hallo,
try:

Code: Select all

^m::SetTimer, ^n, Off
^n::
Random, x, -10, 10
Random, y, -10, 10
MouseMove, x, y, 0, R
Click
MouseMove, -x, -y, 0, R
Random, rnd, 33421, 68754
SetTimer, ^n, %rnd%
Return
Thank you for this, I looked over the script but where does it incorporate pressing the "H" key before it clicks as well? So in the game it would need to press the hotkey "H" and then click with the mouse in that randomized area and then repeat the action again, press "H" then click in area, again and again. Thank you for trying to help me out though!
Do you know what it would be with pressing that key as well?

User avatar
DuckingQuack
Posts: 219
Joined: 20 Jan 2023, 18:20

Re: Autoclicker to Press a certain button within a randomized area

Post by DuckingQuack » 28 Jan 2023, 22:10

@Fun54321
This page will be very helpful for your endeavors. Just insert it after the line with ^n:: and you're all set.
hotkeyhttps://www.autohotkey.com/docs/v1/lib/Send.htm
Best of Luck,
The Duck

Post Reply

Return to “Gaming Help (v1)”