Funktioniert beides nicht, Ich habe extra schon die Arrays 0 gesetzt und sie nicht direkt mit NearestPixel iniziert. funktioniert auch nicht weil eh im zweifel False gesetzt wird. Am "And if" statt "and" liegts nicht.
Kann es sein das mit "False" nicht gerechnet werden kann, da ein String? Obwohl das eine andere Fehlermeldung verursachen müsste oder?
@ alpines
Den Trick hab ich mir schon vom letztem Thread mit dir mitgenommen :)
Schön wirds später, für den Anfang und beim Coden ist es für mich verständlicher. Mit der Zeit schaffe ich das bestimmt auch direkt. :D
"scriptpfad" : ==> Subscript used on non-accessible variable.:
If $p1[0] = $p2[0]+10 Then
If $p1^ ERROR
Code:
; Methode 1
If $p1[0] = $p2[0]+10 Then
If $p1[1] = $p2[1]-8 Then
If $p2[0] = $p3[0]-16 Then
If $p2[1] = $p3[1]+5 Then
If $p3[0] = $p1[0]+6 Then
If $p3[1] = $p1[1]+3 Then
MsgBox (0,"","")
EndIf
EndIf
EndIf
EndIf
EndIf
EndIf
"Scriptpfad" : ==> Subscript used on non-accessible variable.:
If ($p1[0] = $p2[0]+10 And $p1[1] = $p2[1]-8 And $p2[0] = $p3[0]-16) & ($p2[1] = $p3[1]+5 And $p3[0] = $p1[0]+6 And $p3[1] = $p1[1]+3) Then
If ($p1^ ERROR
Code:
; Methode 2
If ($p1[0] = $p2[0]+10 And $p1[1] = $p2[1]-8 And $p2[0] = $p3[0]-16) & _
($p2[1] = $p3[1]+5 And $p3[0] = $p1[0]+6 And $p3[1] = $p1[1]+3) Then
MsgBox (0,"","")
EndIf
für erweiterte Analyse mal den gesamten Code:
Code:
#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>
#include <WinAPI.au3>
#include <FastFind.au3>
;Getwndow get PID
;2. get window every xy by pid
Func _GetHwndFromPID($PID)
$hWnd = 0
$stPID = DllStructCreate("int")
Do
$winlist2 = WinList()
For $i = 1 To $winlist2[0][0]
If $winlist2[$i][0] <> "" Then
DllCall("user32.dll", "int", "GetWindowThreadProcessId", "hwnd", $winlist2[$i][1], "ptr", DllStructGetPtr($stPID))
If DllStructGetData($stPID, 1) = $PID Then
$hWnd = $winlist2[$i][1]
ExitLoop
EndIf
EndIf
Next
Sleep(100)
Until $hWnd <> 0
Return $hWnd
EndFunc ;==>_GetHwndFromPID
;Get PID/Handle/ID
if WinExists ("Mein Fenster") Then ;Get prozess from window
; WinActivate ("Mein Fenster")
Global $prozess = WinGetProcess ("Mein Fenster") ;PID
Global $Chromehandle = _GetHwndFromPID($prozess) ;get hwnd/handle from PID
Global $handle = _WinAPI_GetWindow ( $Chromehandle, $GW_CHILD )
Global $controlid = _WinAPI_GetDlgCtrlID ( $handle )
; MsgBox (0,"ok3",$handle)
; MsgBox (0,"ok3",$controlid)
EndIf
AutoItSetOption ("pixelcoordmode", 2)
InitFFDll()
FFSetWnd($handle, True)
global $p1[2] =[0,0]
global $p2[2] =[0,0]
global $p3[2] =[0,0]
While 1
$p1 = FFNearestPixel(1,1,500, 500, 0x2A94DE)
$p2 = FFNearestPixel(500, 500, 0xCD5250)
$p3 = FFNearestPixel(500, 500, 0x891A1E)
MsgBox (0,"",$p1&$p2&$p3)
If $p1[0] =$p2[0]+10 and $p1[1]=$p2[1]-8 and $p2[0]=$p3[0]-16 and $p2[1]=$p3[1]+5 and $p3[0]=$p1[0]+6 and $p3[1]=$p1[1]+3 Then
MsgBox (0,"","")
EndIf
WEnd