Jump to content

Recommended Posts

Posted

Where am I going wrong please?

WinActivate("Myactive window")

AutoItSetOption ( "MouseCoordMode" , 2 )

AutoItSetOption ( "PixelCoordMode" , 2 )

MouseClickDrag("left",677, 685, 500, 300)

;Find a pure white pixel or a white pixel within 10 shades variations of white

$coord = PixelSearch( 676, 684, 678, 686, 0xC6D2DE, 10 )

If Not @error Then

(0, "X and Y are:", $coord[0] & "," & $coord[1])

EndIf

If IsArray($coord) = 1 Then

MouseMove(677,685)

MouseClick("left")

EndIf

I used the v3 too, to get the hex color. it runs without errors just logic seems incorrect. Is the pixel detection I am doing in the same window I have focus on?

the pixel stored at 677,685 is that shade of white, so this should work. But the check fails, like the color is wrong. What am I missing please?

Thank you

Posted

Shade of white??? ... No!!

;WinActivate("Myactive window")
Opt("MouseCoordMode", 0)
Opt("PixelCoordMode", 0)


GUICreate("My GUI", @DesktopWidth, @DesktopHeight)
GUISetBkColor(0xC6D2DE)
GUISetState()

MouseClickDrag("left", 677, 685, 500, 300)

;Find a pure white pixel or a white pixel within 10 shades variations of white
$coord = PixelSearch(676, 684, 678, 686, 0xC6D2DE, 10)
If Not @error Then
    MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1])
EndIf

If IsArray($coord) Then
    MouseMove(677, 685)
    MouseClick("left")
EndIf

8)

NEWHeader1.png

Posted

how can I do this with an active window, and not my desktop?

what I am trying to do is if that white pixel changes I want the left button to click, so I am just setting it right off to make it work but it doesn't.

So I am guessing my logic is correct? or you would have said something about it?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...