Hab eine Funktion geschrieben, welche eine bestimmte Stelle auf dem Bildschirm mit hilfe von PixelSearch sucht und die Maus dann dort hin bewegen soll. Leider kommt eine Fehler meldung mit:
$x = $pos1[0]-pos2[0]
$x = $pos1^ERROR
Error: Subscript used with non-Array variable.
Code
Func GetWp()
$pos1 = PixelSearch(100, 100, 800, 600, 0x & Hex(8947848,6))
$pos2 = PixelSearch(100, 100, 800, 600, 0x & Hex(1268909,6))
$x = $pos1[0]-$pos2[0]
$y = $pos1[1]-$pos2[1]
if (Abs($x)< 10) and (Abs($y)<10) Then
MouseMove ($pos1[0],$pos1[1])
EndIf
EndFunc
Wo liegt denn da der Fehler ?