Autoclick with middle mouse button when cursor is in the one of the triangular areas of the screen

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
dImposteur
Posts: 2
Joined: 01 Feb 2023, 07:58

Autoclick with middle mouse button when cursor is in the one of the triangular areas of the screen

Post by dImposteur » 01 Feb 2023, 08:10

So the title. I need to create that script but I am total newbie in a programming and in ahk, so can't really comprehend how to do it. It must be something like this as in the picture. The 1, 2, 3, 4 are zones where an autoclick triggers as soon as mouse cursor enters them
Attachments
square.png
square.png (26.88 KiB) Viewed 254 times

User avatar
boiler
Posts: 16927
Joined: 21 Dec 2014, 02:44

Re: Autoclick with middle mouse button when cursor is in the one of the triangular areas of the screen

Post by boiler » 01 Feb 2023, 08:29

Why are you distinguishing between the four zones when the same thing is to happen in each? Aren’t you saying you want to auto-click when that entire rectangle is entered? That’s a much easier solution.

dImposteur
Posts: 2
Joined: 01 Feb 2023, 07:58

Re: Autoclick with middle mouse button when cursor is in the one of the triangular areas of the screen

Post by dImposteur » 01 Feb 2023, 09:39

boiler wrote:
01 Feb 2023, 08:29
Why are you distinguishing between the four zones when the same thing is to happen in each? Aren’t you saying you want to auto-click when that entire rectangle is entered? That’s a much easier solution.
I need this to be triggered EACH time when cursor enters one of the zones. You can imagine this if the center of the screen were the crossing between these lines

User avatar
boiler
Posts: 16927
Joined: 21 Dec 2014, 02:44

Re: Autoclick with middle mouse button when cursor is in the one of the triangular areas of the screen

Post by boiler » 01 Feb 2023, 13:38

Basically, you would have a variable that tracks the last zone entered, then you would need to continuously monitor the mouse coordinates using a loop and MouseGetPos and calculate what zone it’s in, which isn’t trivial but not overly complicated either. Then if the zone it determines it is in is different than what was stored, then update that variable and then gosub to the appropriate subroutine that is to be triggered.

Post Reply

Return to “Ask for Help (v1)”