This is an issue with Autohotkey but after some persistence (of choosing a plethora of different coordinate modes and other settings) it seems it's related to different resolution settings.
The workaround is to change the screen resolution to a lower setting and change it back again once completed. This aligns the image coordinates to the mousemove coordinates in Autohotkey.
#z::ChangeResolution(1024,768)settitlematchmode 2Sleep, 2000Run https://somesite.comSleep, 4000CoordMode Pixel, RelativeImageSearch, FoundX, FoundY, 0, 0, 1000, 1000, *50 C:\Users\uid\Documents\testfiles\c.bmpif ErrorLevel = 2MsgBox Could not conduct the search.else if ErrorLevel = 1MsgBox Icon could not be found on the screen.elseMouseMove, %FoundX%, %FoundY%ClickMsgBox %FoundX%, %FoundY%ChangeResolution(2160,1440)ReturnChangeResolution(w,h) {VarSetCapacity(dM,156,0)NumPut(156,dM,36)NumPut(0x5c0000,dM,40)NumPut(w,dM,108)NumPut(h,dM,112)DllCall( "ChangeDisplaySettingsA", UInt,&dM, UInt,0 )}
No comments:
Post a Comment