Dieser Pixelsearch soll sich nach der Maus richten (ja sie ist Pink :P)
jedoch funktioniert das ganze nicht wirklich,...wenn jmd ne Lösung hätte...:)
Spoiler anzeigen
#include <GUIConstants.au3>
#include <Misc.au3>
HotKeySet ( "q","start")
[/autoit] [autoit][/autoit] [autoit]HotKeySet ( "{f1}","_exit")
[/autoit] [autoit][/autoit] [autoit]HotKeySet ( "{f2}","stop")
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]While 1 ;Programm schließt sich nicht (warum auch immer)
Sleep(0)
WEnd
Func start()
While 1
[/autoit] [autoit][/autoit] [autoit]
WinActivate ( "" )
$pos=PixelSearch ( 0, 0, 1025, 800, 0xFF00FF, 1) ; Suche Pixel der Farbe "Pink"
IF IsArray( $pos ) = 1 Then ; Wenn gefunden dann
$rechterrand = $pos[0]+50 ; Rechter Rand = Position des Pixels um 50 verschoben (nach rechts)
$untererrand = $pos[1]+50 ; Unterer Rand = Position des Pixels um 50 verschoben (nach unten)
EndIf
WEnd
while True
$pos2 = PixelSearch ($pos[0],$pos[1],$rechterrand,$untererrand, 0x0000FF, 2) ; Suche Pixel der Farbe "Blau"
if IsArray($pos2) = True Then ; Wenn gefunden dann ; Im Rechteck($pos[0],$pos[1],
MouseMove( $pos2[0], $pos2[1], 1) ; Bewege Maus zu x/y ; $rechterrand,$untererrand)
EndIf
WEnd
EndFunc
Func _MouseMovePlus($X, $Y,$absolute = 0)
Local $MOUSEEVENTF_MOVE = 1
Local $MOUSEEVENTF_ABSOLUTE = 32768
DllCall("user32.dll", "none", "mouse_event", _
"long", $MOUSEEVENTF_MOVE + ($absolute*$MOUSEEVENTF_ABSOLUTE), _
"long", $X, _
"long", $Y, _
"long", 0, _
"long", 0)
EndFunc
DllClose($dll)
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
Func stop()
Sleep(100)
EndFunc
Func _exit()
Exit
EndFunc