hi leute, habe mal schnell ein kleines script gemacht.
aber es geht einfach nicht richtig.
das script selber ist io, vermude mal das ist eine schwäche von autoIt.
gibt es eine andere möglichkeit um nach farbpunkte zu suchen (scannen)?
hier habe ich noch dir 3 kleinen bilder dazu.
Spoiler anzeigen
C
opt("MouseCoordMode", 0)
#include <GUIConstants.au3>
$Form1 = GUICreate("Farbfinder GUI-1", 220, 150)
$Pic1 = GUICtrlCreatePic("rot.jpg", 40, 30, 20, 20)
$Pic2 = GUICtrlCreatePic("blau.jpg", 100, 30, 20, 20)
$Pic3 = GUICtrlCreatePic("grün.jpg", 160, 30, 20, 20)
$Button1 = GUICtrlCreateButton("Brau", 30, 100, 40)
$Button2 = GUICtrlCreateButton("Rot", 90, 100, 40)
$Button3 = GUICtrlCreateButton("Grün", 150, 100, 40)
GUICtrlSetColor(-1, 0xEBE9ED)
GUISetState(@SW_SHOW)
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case $msg = $Button1
BlockInput(1)
MouseMove(110, 70, 40)
BlockInput(0)
Case $msg = $Button2
BlockInput(1)
MouseMove(50, 70, 40)
BlockInput(0)
Case $msg = $Button3
BlockInput(1)
MouseMove(170, 70, 40)
BlockInput(0)
EndSelect
WEnd
$coord1 = PixelSearch(5, 35, 220, 100, 0x00FF00, 5);grün
Sleep(50)
$coord2 = PixelSearch(5, 35, 220, 100, 0xFF0000, 5);rot
Sleep(50)
$coord3 = PixelSearch(5, 35, 220, 100, 0x0000FF, 5);blau
Sleep(50)
WinSetTitle($Form1, "", "Farbfinder GUI-2")
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case $msg = $Button1
If UBound($coord3, 0) Then
MouseMove($coord3[0], $coord3[1], 40)
Else
MsgBox(0, "Nichts!", "Farbe nicht gefunden")
EndIf
Case $msg = $Button2
If UBound($coord2, 0) Then
MouseMove($coord2[0], $coord2[1], 40)
Else
MsgBox(0, "Nichts!", "Farbe nicht gefunden")
EndIf
Case $msg = $Button3
If UBound($coord1, 0) Then
MouseMove($coord1[0], $coord1[1], 40)
Else
MsgBox(0, "Nichts!", "Farbe nicht gefunden")
EndIf
EndSelect
WEnd
Exit
Alles anzeigen