Hallo,
Ich wollte eine UDF für TimBlo machen, die es ermöglicht das PixelSearch von Rechts nach Links sucht.
Nur es klappt einfach nicht, es kommt kein Rückgabewert, einfach nichts.
Guckt euch einfach mal die UDF an:
[autoit]Func _PixelSearchRightToLeft($iLeft, $iTop, $iRight, $iBottom, $hColour, $iShadeVariation = 0, $iStep = 1)
Local $p_Search
Local $i_Left = $iLeft, $i_Right = $iRight, $i_Bottom = $iBottom - 1
Local $bTrue = False
If Not IsInt($iLeft) Or Not IsInt($iTop) Or Not IsInt($iRight) Or Not IsInt($iBottom) Or Not StringLen($hColour) = 8 Then
Return 0
EndIf
Do
If $bTrue = False Then
$p_Search = PixelSearch($i_Right, $iTop, $i_Right - 1, $i_Bottom - $iTop, $hColour, $iShadeVariation, $iStep)
ElseIf $bTrue = True Then
If $i_Right = $iLeft Then
$i_Right = $iRight
$p_Search = PixelSearch($i_Right, $iTop, $i_Right, $i_Bottom - $iTop, $hColour, $iShadeVariation, $iStep)
EndIf
EndIf
If $i_Right = $iLeft Then
$i_Bottom -= 1
EndIf
$i_Left += 1
$i_Right += 1
$i_Bottom -= 1
$bTrue = True
Until IsArray($p_Search)
Return $p_Search
EndFunc
Hier ist die Demo:
[autoit]HotKeySet("!e", "_Exit")
[/autoit][autoit][/autoit][autoit]While 1
$Search = _PixelSearchRightToLeft(0, 0, @DesktopWidth, @DesktopHeight, 0xFFFFFF)
If $Search = 0 Then
MsgBox(0, "Fail", "Fail")
ElseIf IsArray($Search) Then
MouseMove($Search[0], $Search[1], 0)
EndIf
WEnd
Func _Exit()
Exit
EndFunc
Würde mich freuen wenn ihr mir helfen könntet