Sign in to follow this  
Followers 0
BitByteBit

$Posi = MouseGetPos() $CropColour = PixelGetColor($Posi[0], $Posi[1])

1 post in this topic

Not sure where I went wrong here,

Form looks for pixel at current mouse pos (on key press), clicks it, if the user states it was correct it writes to .ini, if not repeat, for some reason it doesn't click on the pixel.

Func Pixel()
    MsgBox(0, "", "Hover over the crop and press F1 ")
    While $Found = False
        If _IsPressed("70", $DLL) Then
            $Posi = MouseGetPos()
            $CropColour = PixelGetColor($Posi[0], $Posi[1])
$CropColour = Hex($CropColour, 6)
MsgBox(0, "", "You chose: " & $CropColour)
            MsgBox(0, "", "Testing your selection")
            $Coord2 = PixelSearch(30, 30, 900, 610, $CropColour)
            If Not @error Then
                MouseClick("Left", $Coord2[0], $Coord2[1], 2, 0)
            EndIf
            Sleep(2000)
            $Question = MsgBox(4, "?", "Was that the right one?")
            If $Question = 6 Then
;               Input2()
                WriteIni()
                $Found = True
                Harvest()
            EndIf
        EndIf
    WEnd

Func WriteIni()

IniWrite("C:\FV.ini", "Fruit","Fruit 1", $CropColour)

EndIf

Any ideas?

Share this post


Link to post
Share on other sites



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
Sign in to follow this  
Followers 0