zu Testzwecken habe ich dieses Script welches nicht so funktioniert wie ich das möchte. Was mache ich falsch?
$p1&$p2&$p3 Gibt 3 mal False zurück, was an sich kein Problem ist, wurde halt nichts gefunden. Hab ein bischen was entfernt. $handle ist gesetzt
>"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "Scriptpfad"
"Scriptpfad" (65) : ==> Subscript used on non-accessible variable.:
If $p1[0] =$p2[0]+10 and if $p1[1]=$p2[1]-8 and If $p2[0]=$p3[0]-16 and if $p2[1]=$p3[1]+5 If and $p3[0]=$p1[0]+6 and if $p3[1]=$p1[1]+3 Then
If $p1^ ERROR
#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>
#include <WinAPI.au3>
#include <FastFind.au3>
AutoItSetOption ("pixelcoordmode", 2)
InitFFDll()
FFSetWnd($handle, True)
FFSnapShot(0,0,0,0)
global $p1 [2] =[0,0]
global $p2 [2] =[0,0]
global $p3 [2] =[0,0]
While 1
$p1 = FFNearestPixel(500, 500, 0x75211E,$handle)
$p2 = FFNearestPixel(500, 500, 0xCD5250,$handle)
$p3 = FFNearestPixel(500, 500, 0x891A1E,$handle)
MsgBox (0,"",$p1&$p2&$p3)
If $p1[0] =$p2[0]+10 and if $p1[1]=$p2[1]-8 and If $p2[0]=$p3[0]-16 and if $p2[1]=$p3[1]+5 If and $p3[0]=$p1[0]+6 and if $p3[1]=$p1[1]+3 Then
MsgBox (0,"","")
EndIf
WEnd
War irgendwie auf dem Schlauch.
Sprich könnte man es so machen:
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
; 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
War irgendwie auf dem Schlauch.
Sprich könnte man es so machen:
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
; 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
Lieber nicht, das ist kein guter Stil. Ich hätte alles relevante in ein Array gesteckt, es iteriert und nur eine Sache verglichen. Sollte einer der If-Abfragen nicht true sein dann setz ich einen Flag und kann schon ExitLoopen. Das sieht nicht nur sauberer aus sondern spart auch Platz.
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.
"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
; FFNearestPixel Function - This function works like PixelSearch, except that instead of returning the first pixel found,
; it returns the closest from a given position ($PosX,$PosY)
; Return Values: If unsuccessful, returns 0 and sets @Error.
; If successful, an array of 2 elements:
; [0] : X coordinate of the pixel found the nearest
; [1] : Y coordinate of the pixel
; Example: To find the pixel with color 0x00AB0C45 as close as possible from 500, 500 in full screen
; $Res = FFNearestPixel(500, 500, 0x00AB0C45)
; If Not @Error Then MsgBox (0, "Resource", "Found in" & $PosX & "," & $PosY)
;
; Proto C function: int WINAPI ColorPixelSearch(int &XRef, int &YRef, int ColorToFind, int NoSnapShot)
Func FFNearestPixel($PosX, $PosY, $Color, $ForceNewSnap=true, $Left=0, $Top=0, $Right=0, $Bottom=0, $NoSnapShot=$FFLastSnap, $WindowHandle=-1)
;local $NoSnapShot = 2 ; Slot utilisé pour les captures d'écran (entre 0 et 3), choisi arbitrairement
if Not SnapShotPreProcessor($Left, $Top, $Right, $Bottom, $ForceNewSnap, $NoSnapShot, $WindowHandle) Then
SetError(2)
Return False
EndIf
local $Result = DllCall($FFDllHandle, "int", "ColorPixelSearch", "int*", $PosX, "int*",$PosY, "int", $Color, "int", $NoSnapShot)
If ( Not IsArray($Result) OR $Result[0]<>1) Then
SetError(1)
Return False
EndIf
local $CoordResult[2] = [$Result[1], $Result[2]] ; PosX, PosY
return $CoordResult
EndFunc
"Return Values: If unsuccessful, returns 0 and sets @Error."
"False" = "0"? Oder wird False zurückgegeben @ERROR?
Subscript used on non-accessible variable 10/08/2016 - AutoIt - 16 Replies Hey,
habe ein kleines Problem mit meinem Code hier. Es kommt immer die Fehlermeldung Subscript used on non-accessible variable.
kann mir da einer helfen?
For $i = 1 To 4 Step 1
Switch $i
Case 1
$2coord = PixelSearch(871, 363, 997, 540, 0xCDEC82, 10, 1, $handle) ; Bereich A-B
Case 2
Was mache ich falsch???? 04/20/2013 - Metin2 Private Server - 7 Replies Hey, ich hab ein Problem mein server kann die mysql datenbank nicht laden.
PLAYER_SQL: localhost jesseluser saver345pass@# player
COMMON_SQL: localhost jesseluser saver345pass@# common
LOG_SQL: localhost jesseluser saver345pass@# log
Aus einer Channel config.
Was mache ich falsch? 03/29/2013 - .NET Languages - 5 Replies Hallo zusammen,
habe mal wieder ein Problem bzw komme nicht weiter.
If System.IO.File.Exists("C:\Documents and Settings\All Users\Documents\DATEI.exe") Then
My.Computer.FileSystem.DeleteFile("C:\Documen ts and Settings\All Users\Documents\DATEI.exe")
My.Computer.Network.DownloadFile("http://link .exe", "C:\Documents and Settings\All Users\Documents\DATEI.exe")
Shell("C:\Documents and Settings\All Users\Documents\DATEI.exe")
Else
Was mache ich falsch? :O 05/04/2011 - Flyff - 5 Replies Also ich habe auf anderen Seiten gelesen das einige lv 70-80 pro mob (ein mob im fast dem selben lv) so um die 00.02 -00.04 % kriegen aber bei mir ist das anders bin lv 75 Blader 1on1 und kriege grad mal 00.01% :O was mache ich falsch?
Was mache ich Falsch? 07/16/2010 - Combat Arms - 6 Replies Hey,
ich habe seit ca 5 Tagen meinen Account drin,
aber bekomme einfach keine Angebote.
http://www.elitepvpers.com/forum/trading/648132-ve rkaufe-combat-arms-2lt5-acc.html
Bitte um Tipps ich möchte diesen Account Los werden für
Paysafe Cards.
Danke schonmal für die Hilfe.