Changes between Version 4 and Version 5 of Ticket #3977, comment 1


Ignore:
Timestamp:
10/20/23 08:42:13 (13 months ago)
Author:
Jpm
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #3977, comment 1

    v4 v5  
    55{{{
    66#include <MsgBoxConstants.au3>
    7 AutoItSetOption ( "PixelCoordMode" ,1)
    8 AutoItSetOption ( "MouseCoordMode" ,1)
     7AutoItSetOption("PixelCoordMode", 1)
     8AutoItSetOption("MouseCoordMode", 1)
    99
    1010; Find a pure red pixel in the range 0,0, 1450,770
    1111Local $aCoord = PixelSearch(0, 0, 1450, 770, 0xFF0000)
    1212If Not @error Then
    13         $color = PixelGetColor($aCoord[0],$aCoord[1],1)
    14         ConsoleWrite("> X and Y are: " & $aCoord[0] & "," & $aCoord[1] & "  color:" & Hex($color,6) & @CRLF)
    15         MouseMove($aCoord[0],$aCoord[1])
     13        Local $color = PixelGetColor($aCoord[0], $aCoord[1], 1)
     14        ConsoleWrite("> X and Y are: " & $aCoord[0] & "," & $aCoord[1] & "  color:" & Hex($color, 6) & @CRLF)
     15        MouseMove($aCoord[0], $aCoord[1])
    1616EndIf
    1717Sleep(1000)
     
    1919;Check result with mouse pos
    2020Local $aCoordm = MouseGetPos()
    21 $colorm = PixelGetColor($aCoordm[0],$aCoordm[1])
    22 ConsoleWrite(">Mouse X and Y are: " & $aCoordm[0] & "," & $aCoordm[1] & "  color:" & Hex($colorm,6) & @CRLF)
     21Local $colorm = PixelGetColor($aCoordm[0], $aCoordm[1])
     22ConsoleWrite(">Mouse X and Y are: " & $aCoordm[0] & "," & $aCoordm[1] & "  color:" & Hex($colorm, 6) & @CRLF)
    2323
    24 $colorm = PixelGetColor($aCoordm[0]-1,$aCoordm[1]-1,1)
    25 ConsoleWrite(">Mouse correction X and Y are: " & $aCoordm[0]-1 & "," & $aCoordm[1]-1 & "  color:" & Hex($colorm,6) & @CRLF)
     24Opt("PixelCoordMode", 0)
     25$colorm = PixelGetColor($aCoordm[0] - 1, $aCoordm[1] - 1)
     26ConsoleWrite(">Mouse correction X and Y are: " & $aCoordm[0] - 1 & "," & $aCoordm[1] - 1 & "  color:" & Hex($colorm, 6) & @CRLF)
    2627
    2728}}}