Xtra wrote: ↑29 Nov 2021, 02:08
Read:
CoordMode
You probably want it set to screen. (put at top of script)
CoordMode, Mouse, Screen
Coordmode is also bad, sometimes not clicking. I have this:
Code: Select all
Numpad1::
Send E
For each, coord in [[240, 660], [237, 735], [986, 330], [390, 734], [1105, 330], [300, 735], [1030, 330]] {
move(coord.1, coord.2), DllCall("mouse_event", "UInt", LBDN := 2)
Sleep, 70 ; Milliseconds after button down
DllCall("mouse_event", "UInt", LBUP := 4)
Sleep, 70 ; Milliseconds after button up
}
move(683, 380)
Return
move(x, y) { ; Coordinates relative to the active window
Static SysX := 65535 / A_ScreenWidth, SysY := 65535 / A_ScreenHeight
WinGetPos, winX, winY,,, A
DllCall("mouse_event", "UInt", ABSMOVE := 32769, "UInt", (x + winX) * SysX, "UInt", (y + winY) * SysY)
}
[Mod edit: [code][/code] tags added.]