| 3 | This script helps you to debug, where you will see that the mouse pos is 1 pixel next to the found pixel |
| 4 | |
| 5 | {{{ |
| 6 | #include <MsgBoxConstants.au3> |
| 7 | AutoItSetOption ( "PixelCoordMode" ,1) |
| 8 | AutoItSetOption ( "MouseCoordMode" ,1) |
| 9 | |
| 10 | ; Find a pure red pixel in the range 0,0, 1450,770 |
| 11 | Local $aCoord = PixelSearch(0, 0, 1450, 770, 0xFF0000) |
| 12 | If Not @error Then |
| 13 | |
| 14 | $color = PixelGetColor($aCoord[0],$aCoord[1],1) |
| 15 | ConsoleWrite("> X and Y are: " & $aCoord[0] & "," & $aCoord[1] & " color:" & Hex($color,6) & @CRLF) |
| 16 | MouseMove($aCoord[0],$aCoord[1]) |
| 17 | Sleep(500) |
| 18 | EndIf |
| 19 | Sleep(1000) |
| 20 | |
| 21 | ;Check result with mouse pos |
| 22 | Local $aCoordm = MouseGetPos() |
| 23 | $colorm = PixelGetColor($aCoordm[0],$aCoordm[1]) |
| 24 | ConsoleWrite("> X and Y are: " & $aCoordm[0] & "," & $aCoordm[1] & " color:" & Hex($colorm,6) & @CRLF) |
| 25 | |
| 26 | $colorm = PixelGetColor($aCoordm[0]-1,$aCoordm[1]-1,1) |
| 27 | ConsoleWrite("> X and Y are: " & $aCoordm[0]-1 & "," & $aCoordm[1]-1 & " color:" & Hex($colorm,6) & @CRLF) |
| 28 | |
| 29 | }}} |