Find ich zwar nicht so Toll den es könnte dich verwirren da es noch nicht ganz ausgereift ist also sind noch mehr Fehler drin.:D aber kannst sie mir gerne alle aufzeigen.:rolleyes:
Code:
#RequireAdmin
#NoTrayIcon
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Farben By Vierus", 200, 240)
$Label1 = GUICtrlCreateLabel("MausPosition", 60, 0, 65, 20)
$Label2 = GUICtrlCreateLabel("X", 10, 22, 15, 20)
$Label3 = GUICtrlCreateLabel("Y", 100, 22, 15, 20)
$Input1 = GUICtrlCreateInput("", 25, 20, 30, 20); X achse
GUICtrlSetState(-1, $GUI_DISABLE)
$Input2 = GUICtrlCreateInput("", 115, 20, 30, 20); Y Achse
GUICtrlSetState(-1, $GUI_DISABLE)
$Checkbox = GUICtrlCreateCheckbox("Setze Farbe und Position", 10, 45, 140, 20)
GUICtrlSetState(-1, $GUI_CHECKED)
$Input3 = GUICtrlCreateInput("", 10, 65, 60, 20); Farbe
GUICtrlSetState(-1, $GUI_DISABLE)
$Graphic1 = GUICtrlCreateGraphic(115, 65, 40, 20)
GUICtrlSetColor(-1, 0xA0FFA0)
$Input4 = GUICtrlCreateInput("0", 80, 65, 25, 20); Toleranz
;~ GUICtrlSetState(-1, $GUI_DISABLE)
$Button1 = GUICtrlCreateButton("Klick und Farbe Prüfen", 20, 100, 160, 25, $WS_GROUP)
GUICtrlSetState(-1, $GUI_DISABLE)
$Button2 = GUICtrlCreateButton("Maus/Position Suchen", 20, 135, 160, 25, $WS_GROUP)
;~ $Button2 = GUICtrlCreateButton("Bereich der Suche Festlegen", 20, 135, 160, 25, $WS_GROUP)
$Button3 = GUICtrlCreateButton("Pixel/Farbe Suchen", 20, 170, 160, 25, $WS_GROUP)
;~ $Button2 = GUICtrlCreateButton("Bild Suchen", 20, 135, 160, 25, $WS_GROUP)
$Button4 = GUICtrlCreateButton("Ende", 20, 205, 160, 25, $WS_GROUP)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")
HotKeySet("{F5}", "Speichern")
Global $Paused, $Speichern, $Color
$x2 = @DesktopWidth
$y2 = @DesktopHeight
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Checkbox
If $nMsg == $Checkbox Then
$Read = GUICtrlRead($Checkbox)
If BitAND($Read, $GUI_CHECKED) Then
GUICtrlSetState($Input1, $GUI_DISABLE)
GUICtrlSetState($Input2, $GUI_DISABLE)
GUICtrlSetState($Input3, $GUI_DISABLE)
GUICtrlSetState($Button1, $GUI_DISABLE)
;~ MsgBox(0, "", "CHECKED")
ElseIf BitAND($Read, $GUI_UNCHECKED) Then
GUICtrlSetData($Input1,"")
GUICtrlSetState($Input1, $GUI_ENABLE)
;~ GUICtrlSetState($Input2, $GUI_ENABLE)
;~ GUICtrlSetState($Input3, $GUI_ENABLE)
;~ GUICtrlSetState($Button1, $GUI_ENABLE)
;~ MsgBox(0, "", "UNCHECKED")
EndIf
EndIf
_Checkbox()
Case $Input3
Do
$Read3 = GUICtrlRead($Input3)
$Read3 = StringFormat("%d\t", $Read3)
$Change = GUICtrlSetBkColor($Graphic1, $Read3)
Until $Change = 1
Case $Input4
If $nMsg == $Input4 Then
ToolTip("Farbtoleranz 0-255")
Sleep(5*1000)
EndIf
Case $Button1
_Pruefen()
Case $Button2
_PositionSuchen()
Case $Button3
_PixelSuchen()
Case $Button4
$MSG = MsgBox(1, "Ende", "Willst du wirklich Beenden")
If $MSG = 2 Then
Call($nMsg)
Else
ExitLoop
EndIf
EndSwitch
WEnd
Func _Checkbox()
Do
Sleep(5)
$Read = GUICtrlRead($Checkbox)
$Read1 = GUICtrlRead($Input1,1)
$Read2 = GUICtrlRead($Input2,1)
$Read3 = GUICtrlRead($Input3,1)
If BitAND($Read1, Random(0, 9999)) Then
GUICtrlSetState($Input2, $GUI_ENABLE)
ElseIf BitAND($Read2, Random(0, 9999)) Then
GUICtrlSetState($Input3, $GUI_ENABLE)
GUICtrlSetState($Button1, $GUI_ENABLE)
ElseIf BitAND($Read, $GUI_CHECKED) Then
GUICtrlSetState($Input1, $GUI_DISABLE)
GUICtrlSetState($Input2, $GUI_DISABLE)
GUICtrlSetState($Input3, $GUI_DISABLE)
GUICtrlSetState($Button1, $GUI_DISABLE)
ExitLoop
EndIf
Until BitAND($Read3, StringFormat("%#06x\t", $Read3))
EndFunc ;==>_Checkbox
Func _PositionSuchen()
While 1
$pos = MouseGetPos()
;~ MsgBox(0, "Maus x,y:", $pos[0] & "," & $pos[1])
GUICtrlSetData($Input1, $pos[0])
GUICtrlSetData($Input2, $pos[1])
If $Speichern = 1 Then
GUICtrlSetState($Button1, $GUI_ENABLE)
ExitLoop
EndIf
WEnd
EndFunc ;==>_Farben
Func _PixelSuchen()
While 1
$pos = MouseGetPos()
$Color = PixelGetColor($pos[0], $pos[1])
;~ $sMsgText = StringFormat("Der dezimale Wert der Farbe ist: %d\t", $Color)
;~ MsgBox(0, "PixelGetColor", $sMsgText)
;~ MsgBox(0, "PixelGetColor", $Color)
$sMsgText = StringFormat("%#06x\t", $Color)
GUICtrlSetData($Input3, $sMsgText)
GUICtrlSetBkColor($Graphic1, $Color)
If $Speichern = 1 Then
GUICtrlSetState($Button1, $GUI_ENABLE)
ExitLoop
EndIf
WEnd
EndFunc
Func _Pruefen()
$Read1 = GUICtrlRead($Input1,1)
$Read2 = GUICtrlRead($Input2,1)
$Read3 = GUICtrlRead($Input3,1)
;~ $Farbe = StringFormat("%d\t", $Read3)
$Read4 = GUICtrlRead($Input4,1)
;~ MsgBox(0,"Farbe",$Farbe)
;~ MsgBox(0,"Farbe",$Read3)
If BitAND($Read2, Random(0, 9999)) Then
MouseMove($Read1, $Read2)
If Not @error Then
$MSG2 = MsgBox(4, "Speichern", "Wilst du die MausPosition Speichern?")
If $MSG2 = 7 Then
GUICtrlSetData($Input1, "")
GUICtrlSetData($Input2, "")
GUIGetMsg()
EndIf
EndIf
EndIf
If StringFormat("%d\t", $Read3) = True Then
$coord = PixelSearch($Read1, $Read2, $x2, $y2, $Color, $Read4)
If Not @error Then
MouseClick("right", $coord[0], $coord[1])
Sleep(2 * 1000)
$MSG1 = MsgBox(4, "Speichern", "Wilst du die Pixel/Farb Position Speichern?")
If $MSG1 = 7 Then
GUICtrlSetData($Input3, "")
GUIGetMsg()
EndIf
EndIf
EndIf
EndFunc ;==>_Pruefen
Func Speichern()
If $Speichern = 0 Then
$Speichern += 1
Else
$Speichern -=1
EndIf
EndFunc ;==>Speichern
Func TogglePause()
$Paused = Not $Paused
While $Paused
Sleep(100)
ToolTip('Script ist pausiert', 0, 0)
WEnd
ToolTip("")
EndFunc ;==>TogglePause
Func Terminate()
Exit 0
EndFunc ;==>Terminate
habe ich mal $Color reingemacht damit geht es über den Pixelsuchen Button aber wenn man es eingeben will (Checkbox Hacken) geht das ja nicht also müsste $Read3 dahin wie oben da er das aber nicht macht hatte ich wie oben es mit der dierekten Variablen Deklaration also mit $Farbe aber es haut nicht hin der Klickt mir ins nichts bei der eingabe eines Farbwertes.