- Several onscreen positions have the same Y coordinate, the X coordinates are separated at 35px intervals, e.g. a row of ten 35px/35px squares.
- Clicking on a relevant XY position will send a sequence of keystrokes.
The hotkey is simply designed to save the current mouse coords, click the relevant screen position and return the mouse to its previous position.
Code: Select all
#Numpad1::
MouseGetPos, MX, MY
Click 700 700 ; the centre of fith square in the row
MouseMove, MX, MY
Return
The issue is, the hot key works, but for some reason the click's X coord is using that of the original mouse position's MX coord, i.e. if the mouse is originally at the coords 655/500, when the hotkey is used, although it appears to click in the correct position, the resulting sequence of keys sent indicates that it actually clicked at 665/700 (the centre of the fourth square) instead of 700/700.
I've tried using MouseMove, 700, 700 with a delay before the click, but no matter what else I try nothing works except to manually click.
Note: I use an algorithm that divides the screen into a grid of 35x35 cells - clicking within the bounds of a cell will return the central coordinates for that cell.