Maybe you can help me with this script:
Code:
SpotHere()
{
MouseGetPos, , ypos
offsetY := 30
; TODO: Figure out coord system, coordinate system migrates
;if(ypos > 382)
;{
; offsetY := offsetY - ypos + 382
;}
sleep 20
MouseClick, Right, , , , , D
sleep 40
MouseClick, Right, , , , , U
DllCall("mouse_event", uint,1, int,20, int,offsetY, uint,0, int,0 )
; SayToTeam("ypos ". ypos . " offsetY " . offsetY)
sleep 40
MouseClick, Left, , , , , D
sleep 40
MouseClick, Left, , , , , U
DllCall("mouse_event", uint,1, int,-20, int,-offsetY, uint,0, int,0 )
Sleep 200
}
;
; Spot in 20x20 square area in Commander screen
;
$^LButton::
DllCall("mouse_event", uint, 1, int, -10, int, -10, uint,0, int,0 )
SpotHere()
DllCall("mouse_event", uint, 1, int, 20, int, 0, uint,0, int,0 )
SpotHere()
DllCall("mouse_event", uint, 1, int, 0, int, 20, uint,0, int,0 )
SpotHere()
DllCall("mouse_event", uint, 1, int, -20, int, 0, uint,0, int,0 )
SpotHere()
return
I use this script while in commander view. It will Right+click spot in a 20x20 square area just by clicking CTRL+LBUTTON.
The problem with the script is when you get near the bottom of the screen, the popup menu is no longer to the bottom right of the cursor's current position...but rather can be above the cursor.
On a 1024x768 screen the popup window is 382 pixels from the bottom. If you click below this line then the popup window is doesn't move down with the mouse. I had tried this:
Code:
MouseGetPos, , ypos
offsetY := 30
if(ypos > 382)
{
offsetY := offsetY - ypos + 382
}
But it doesn't work since the coordinates MouseGetPos returns migrates and drifts. I read in another thread it was due to acceleration of the mouse.
Any help would be appreciated.
This is the only thread that I found that could make a possible work around:
http://www.autohotkey.com/forum/viewtopic.php?t=5605