Page 1 of 1

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

Posted: 01 Feb 2023, 08:10
by dImposteur
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

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

Posted: 01 Feb 2023, 08:29
by boiler
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.

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

Posted: 01 Feb 2023, 09:39
by dImposteur
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

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

Posted: 01 Feb 2023, 13:38
by boiler
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.