1. Dashboard
  2. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  3. Forenregeln
  4. Forum
    1. Unerledigte Themen
  • Anmelden
  • Registrieren
  • Suche
Alles
  • Alles
  • Artikel
  • Seiten
  • Forum
  • Erweiterte Suche
  1. AutoIt.de - Das deutschsprachige Forum.
  2. Mitglieder
  3. Nakroma

Beiträge von Nakroma

  • Bewegung

    • Nakroma
    • 25. Mai 2011 um 13:44

    Hallo, Ich habe das Problem das ich wenn ich gleichzeitig meine beiden Chars bewegen will, das einer blockiert. Wie kann ich das umgehen?

    Spoiler anzeigen
    [autoit]

    ;===============================================Includes
    #include <GuiConstants.au3>
    ;===============================================Includes
    ;===============================================Variables
    $p1x = 10
    $p1y = 80
    $p1direction = "right"
    $p2x = 470
    $p2y = 80
    $p2direction = "left"
    ;===============================================Variables
    ;===============================================HotKeys
    HotKeySet("w", "p1forward")
    HotKeySet("s", "p1backward")
    HotKeySet("d", "p1rightward")
    HotKeySet("a", "p1leftward")
    HotKeySet("{up}", "p2forward")
    HotKeySet("{down}", "p2backward")
    HotKeySet("{right}", "p2rightward")
    HotKeySet("{left}", "p2leftward")
    ;===============================================HotKeys
    ;===============================================GUIs
    $gui1 = GUICreate("League of Ethik", 500, 200)
    $vox = GUICtrlCreatePic("./img/vox.bmp", $p1x, $p1y, 20, 20)
    $cripton = GUICtrlCreatePic("./img/cripton.bmp", $p2x, $p2y, 20, 20)
    GUISetState(@SW_SHOW)
    ;===============================================GUIs
    ;===============================================Whiles
    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    EndSwitch
    WEnd
    ;===============================================Whiles
    ;===============================================Funcs
    Func p1forward()
    $p1y = $p1y - 5
    $p1direction = "up"
    If $p1y < 0 Then
    $p1y = 0
    Else
    GUICtrlDelete($vox)
    $vox = GUICtrlCreatePic("./img/vox.bmp", $p1x, $p1y, 20, 20)
    EndIf
    EndFunc
    Func p1backward()
    $p1y = $p1y + 5
    $p1direction = "down"
    If $p1y > 180 Then
    $p1y = 180
    Else
    GUICtrlDelete($vox)
    $vox = GUICtrlCreatePic("./img/vox.bmp", $p1x, $p1y, 20, 20)
    EndIf
    EndFunc
    Func p1rightward()
    $p1x = $p1x + 5
    $p1direction = "right"
    If $p1x > 480 Then
    $p1x = 480
    Else
    GUICtrlDelete($vox)
    $vox = GUICtrlCreatePic("./img/vox.bmp", $p1x, $p1y, 20, 20)
    EndIf
    EndFunc
    Func p1leftward()
    $p1direction = "left"
    $p1x = $p1x - 5
    If $p1x < 0 Then
    $p1x = 0
    Else
    GUICtrlDelete($vox)
    $vox = GUICtrlCreatePic("./img/vox.bmp", $p1x, $p1y, 20, 20)
    EndIf
    EndFunc
    ;p2
    Func p2forward()
    $p2y = $p2y - 5
    $p2direction = "up"
    If $p2y < 0 Then
    $p2y = 0
    Else
    GUICtrlDelete($cripton)
    $cripton = GUICtrlCreatePic("./img/cripton.bmp", $p2x, $p2y, 20, 20)
    EndIf
    EndFunc
    Func p2backward()
    $p2y = $p2y + 5
    $p2direction = "down"
    If $p2y > 180 Then
    $p2y = 180
    Else
    GUICtrlDelete($cripton)
    $cripton = GUICtrlCreatePic("./img/cripton.bmp", $p2x, $p2y, 20, 20)
    EndIf
    EndFunc
    Func p2rightward()
    $p2x = $p2x + 5
    $p2direction = "right"
    If $p2x > 480 Then
    $p2x = 480
    Else
    GUICtrlDelete($cripton)
    $cripton = GUICtrlCreatePic("./img/cripton.bmp", $p2x, $p2y, 20, 20)
    EndIf
    EndFunc
    Func p2leftward()
    $p2x = $p2x - 5
    $p2direction = "left"
    If $p2x < 0 Then
    $p2x = 0
    Else
    GUICtrlDelete($cripton)
    $cripton = GUICtrlCreatePic("./img/cripton.bmp", $p2x, $p2y, 20, 20)
    EndIf
    EndFunc
    ;===============================================Funcs

    [/autoit]
  • FTP-Speicher nach einer Datei durchsuchen

    • Nakroma
    • 13. April 2011 um 13:21

    Also eine While True einbinden?

  • FTP-Speicher nach einer Datei durchsuchen

    • Nakroma
    • 12. April 2011 um 20:16

    Es kommt immer, FTP Verbindung fehlgeschlagen...
    Hab mich sogar nochmal eingeloggt, also iwas muss da falsch sein...
    €:

    [autoit]

    $hConnect = _FTP_Connect($lSession, $sServerName, $sUserName, $sPassword,1,7878)

    [/autoit]


    hab die letzten beiden zahlen weggemacht, es geht danke dir :D

    €€: Ich hab 500 Durchläufe gemacht, weil es ja alle User durchsuchen soll.

  • FTP-Speicher nach einer Datei durchsuchen

    • Nakroma
    • 11. April 2011 um 21:09
    [autoit]


    $sServerName = "ftp.schmierdeinbrot.de"
    $sUserName = "***********"
    $sPassword =" *********"
    $lFileName = "/files/pvponfire/users/nakroma.ini"
    $sPath = "/files/pvponfire/users"
    ;==============================================================================================
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("PvPoF Launcher", 484, 304, 246, 312)
    $Input1 = GUICtrlCreateInput("", 185, 72, 121, 21)
    $Label1 = GUICtrlCreateLabel("Benutzer-ID", 215, 48, 60, 17)
    $Input2 = GUICtrlCreateInput("", 185, 122, 121, 21)
    $Label2 = GUICtrlCreateLabel("Passwort", 222, 104, 47, 17)
    $Button1 = GUICtrlCreateButton("Anmelden", 208, 152, 75, 25, 0)
    $Button2 = GUICtrlCreateButton("Registrieren", 208, 184, 75, 25, 0)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    [/autoit][autoit][/autoit][autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    $lSession = _FTP_Open($sAgent)
    $hConnect = _FTP_Connect($lSession, $sServerName, $sUserName, $sPassword)
    if $hConnect <> 0 Then ; nur wenn der connect funktioniert hat...
    Local $hHandle
    $aFile = _FTP_FindFileFirst($hConnect, $sPath, $hHandle)
    if IsArray($aFile) Then ; wenn die Variable ein Array ist dann...
    If GUICtrlRead($Input1) & ".ini" = $aFile[10] Then
    MsgBox(0, "", "Benutzer gefunden")
    Else
    For $i = 0 To 500 ; warum auch immer du hier 500 Durchläufe machst...
    $aFile2 = _FTP_FindFileNext($hHandle)
    If IsArray($aFile2) Then ; Wenn es noch eine nächste Datei gibt...
    If GUICtrlRead($Input1) & ".ini" = $aFile2[10] Then
    MsgBox(0, "", "Benutzer gefunden")
    ExitLoop
    EndIf
    Else
    MsgBox(0, "Fehler", "Benutzer konnte nicht gefunden werden.")
    ExitLoop
    EndIf
    Next
    EndIf
    Else
    MsgBox(0,"Fehler","Verzeichnis wurde nicht gefunden oder es befinden sich keine Dateien im Verzeichnis.")
    EndIf
    Else
    MsgBox(0,"Fehler","FTP Verbindung konnte nicht hergestellt werden.")
    EndIf
    EndSwitch
    WEnd

    [/autoit]
  • FTP-Speicher nach einer Datei durchsuchen

    • Nakroma
    • 10. April 2011 um 08:57

    Funktioniert ganz gut, blos das wenn man einen falschen namen eingibt dieser error kommt:

    [autoit]


    If GUICtrlRead($Input1) & ".ini" = $aFile2[10] Then
    If GUICtrlRead($Input1) & ".ini" = ^ ERROR

    [/autoit]

    Ist ja das gleiche wie vorhin
    Bzw. steh ich iwie aufm Schlauch

  • FTP-Speicher nach einer Datei durchsuchen

    • Nakroma
    • 9. April 2011 um 18:09
    [autoit]


    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    $lSession = _FTP_Open($sAgent)
    $hConnect = _FTP_Connect($lSession, $sServerName, $sUserName, $sPassword)
    Local $hHandle
    $aFile = _FTP_FindFileFirst($hConnect, $sPath, $hHandle)
    If GUICtrlRead($Input1) & ".ini" = $aFile[10] Then
    MsgBox(0, "", "Benutzer gefunden")
    Else
    For $i = 0 To 500
    $aFile2 = _FTP_FindFileNext($hHandle)
    If IsArray($aFile[10]) Then
    If GUICtrlRead($Input1) & ".ini" = $aFile2[10] Then
    MsgBox(0, "", "Benutzer gefunden")
    ExitLoop
    EndIf
    Else
    MsgBox(0, "ERROR", "")
    ExitLoop
    EndIf
    Next
    EndIf
    EndSwitch
    WEnd

    [/autoit]

    So hab ichs jetzt, blos wenn ich einen Benutzer angebe der im FTP-Speicher nicht an erster oder zweiter Stelle steht, kommt eben ERROR.

  • FTP-Speicher nach einer Datei durchsuchen

    • Nakroma
    • 9. April 2011 um 16:17

    Wie prüft man des? Bzw. Da es ja nicht funktioniert, wie korrigiert mans?

  • FTP-Speicher nach einer Datei durchsuchen

    • Nakroma
    • 9. April 2011 um 14:46

    Ahh, jetzt gehts, danke sehr :)
    €:
    Das Klappt schonmal:

    [autoit]


    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    $lSession = _FTP_Open($sAgent)
    $hConnect = _FTP_Connect($lSession, $sServerName, $sUserName, $sPassword)
    Local $hHandle
    $aFile = _FTP_FindFileFirst($hConnect, $sPath, $hHandle)
    If GUICtrlRead($Input1) & ".ini" = $aFile[10] Then
    MsgBox(0, "", "Benutzer gefunden")
    Else
    For $i = 0 To 500
    $aFile2 = _FTP_FindFileNext($hHandle)
    If GUICtrlRead($Input1) & ".ini" = $aFile2[10] Then
    MsgBox(0, "", "Benutzer gefunden")
    ExitLoop
    EndIf
    Next
    EndIf
    EndSwitch
    WEnd

    [/autoit]

    Allerdings, wenn man etwas falsches eingibt dann kommt:

    [autoit]


    If GUICtrlRead($Input1) & ".ini" = $aFile2[10] Then
    If GUICtrlRead($Input1) & ".ini" = ^ ERROR

    [/autoit]

    Wie kann ich das korrigieren?

  • FTP-Speicher nach einer Datei durchsuchen

    • Nakroma
    • 9. April 2011 um 13:15

    Hier die While:

    [autoit]


    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    $lSession = _FTP_Open($sAgent)
    $hConnect = _FTP_Connect($lSession, $sServerName, $sUserName, $sPassword)
    Local $h_Handle
    $aFile = _FTP_FindFileFirst($hConnect, "/pub/software/programming/pcre/", $h_Handle)
    ConsoleWrite('$Filename = ' & $aFile[10] & ' Attribute = ' & $aFile[1] & ' -> Fehlercode: ' & @error & @crlf)
    EndSwitch
    WEnd

    [/autoit]


    Hier der Fehlercode:

    [autoit]

    C:\Users\Tarek\Desktop\Zeugs\Autoit\PvPonFire\start.au3 (36) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.:
    ConsoleWrite('$Filename = ' & $aFile[10] & ' Attribute = ' & $aFile[1] & ' -> Fehlercode: ' & @error & @crlf)
    ConsoleWrite('$Filename = ' & ^ ERROR

    [/autoit]
  • FTP-Speicher nach einer Datei durchsuchen

    • Nakroma
    • 9. April 2011 um 11:42
    Zitat von AspirinJunkie

    Folgendes Beispiel gibt dir alle Ordner und Dateien in allen Ebenen als Array zurück.
    Leicht abgewandelt kannst du es auch zum reinen Suchen verwenden:

    Spoiler anzeigen
    [autoit]

    #include
    #include

    [/autoit] [autoit][/autoit] [autoit]

    $server = 'ftp.csx.cam.ac.uk'
    $username = ''
    $pass = ''

    [/autoit] [autoit][/autoit] [autoit]

    $hFTP = _FTP_Open('FTP_open')
    $hFTPCon = _FTP_Connect($hFTP, $server, $username, $pass)

    [/autoit] [autoit][/autoit] [autoit]

    $aFileList = _FTP_FileList($hFTPCon, "pub/software/antivirus/")
    _ArrayDisplay($aFileList)

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    ; #FUNCTION# ======================================================================================
    ; Name ..........: _FTP_FileList()
    ; Description ...: Listet alle Dateien und Ordner in allen Ebenen eines FTP-Pfades
    ; Syntax ........: _FTP_FileList(Const $hConn[, $sPath = ""])
    ; Parameters ....: Const $hConn - Handle zu einer offenen FTP-Verbindung. (z.B. mit FTP_Open)
    ; $sPath - [optional] Ordnerpfad auf dem Server welcher durchsucht werden soll (default:"")
    ; Return values .: Success: Array mit Datei/Ordnernamen
    ; Failure: Setzt @error = 1 und Array[0] = -1
    ; Author ........: Andy
    ; Related .......: #include
    ; =================================================================================================
    Func _FTP_FileList(Const $hConn, $sPath = "")
    ;by AspirinJunkie
    Local $cSQueue = ObjCreate("System.Collections.Queue")
    Local $oRetDict = ObjCreate("Scripting.Dictionary")
    Local $hFFFF, $aNext, $sCurrentPath

    [/autoit] [autoit][/autoit] [autoit]

    If StringRight($sPath, 1) = "/" Then $sPath = StringTrimRight($sPath, 1)
    $cSQueue.Enqueue($sPath)

    [/autoit] [autoit][/autoit] [autoit]

    While $cSQueue.Count > 0
    $sCurrentPath = $cSQueue.Dequeue

    [/autoit] [autoit][/autoit] [autoit]

    $aNext = _FTP_FindFileFirst($hConn, $sCurrentPath, $hFFFF)
    If @error Then
    If $oRetDict.Count > 0 Then ContinueLoop
    Local $Ret[1] = [-1]
    Return SetError(1, 0, $Ret)
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    ConsoleWrite($aNext & @CRLF)

    [/autoit] [autoit][/autoit] [autoit]

    If BitAND($aNext[1], 16) Then $cSQueue.Enqueue($sCurrentPath & '/' & $aNext[10])
    $oRetDict.Add($sCurrentPath & '/' & $aNext[10], 0)

    [/autoit] [autoit][/autoit] [autoit]

    Do
    $aNext = _FTP_FindFileNext($hFFFF)
    If @error Then ExitLoop
    If BitAND($aNext[1], 16) Then $cSQueue.Enqueue($sCurrentPath & '/' & $aNext[10])
    $oRetDict.Add($sCurrentPath & '/' & $aNext[10], 0)
    Until 0
    _FTP_FindFileClose($hFFFF)
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    If $oRetDict.Count > 0 Then
    Return $oRetDict.Keys
    Else
    Local $Ret[1] = [0]
    Return SetError(2, 0, $Ret)
    EndIf
    EndFunc ;==>_FTP_FileListRekursiv

    [/autoit]

    Edit: Wenn es, was zwar dein Titel suggeriert, nicht um das Durchsuchen eines Verzeichnisbaumes auf einem FTP-Server nach einer Datei geht sondern nur darum zu schauen ob eine Datei in dem Verzeichnis überhaupt existiert dann schau dir mal nochmal kurz das Beispiel in der Hilfe zu _FTP_FindFileFirst() nochmal ganz genau an.
    Kleiner Tipp: Die Funktion gibt ein Array zurück.

    Alles anzeigen
    Zitat von AspirinJunkie

    Edit: Wenn es, was zwar dein Titel suggeriert, nicht um das Durchsuchen eines Verzeichnisbaumes auf einem FTP-Server nach einer Datei geht sondern nur darum zu schauen ob eine Datei in dem Verzeichnis überhaupt existiert dann schau dir mal nochmal kurz das Beispiel in der Hilfe zu _FTP_FindFileFirst() nochmal ganz genau an.
    Kleiner Tipp: Die Funktion gibt ein Array zurück.


    Hab sogar genau das kopiert was im Beispiel steht, aber es geht nicht

  • FTP-Speicher nach einer Datei durchsuchen

    • Nakroma
    • 9. April 2011 um 07:36

    Hi,
    mir wurde schon gesagt das man das obengenannte durch _FTP_FindFileFirst und _FTP_FindFileNext machen kann. Aber kapieren tu ich es überhaupt nicht. Im Grunde soll halt die erste Datei(FindFileFirst)gefunden werden, ausgegeben werden, gecheckt werden(ob es auch wirklich den User gibt), und wenn es ihn nicht gibt dann halt mit FindFileNext weitergemacht werden.
    Aber erstmal brauch ich nur Hilfe bei FindFileFirst. :D
    Hier mal mein Script. Was mach ich falsch?

    [autoit]

    #include <GUIConstants.au3>
    #include <FTPEx.au3>
    ;==============================================================================================
    $sAgent = "PvPonFireFTP" ;Fantasie Name
    $sServerName = "ftp.schmierdeinbrot.de"
    $sUserName = "********"
    $sPassword = "********"
    $lFileName = "/files/pvponfire/users/nakroma.ini"
    $sPath = "/files/pvponfire/users/"
    ;==============================================================================================
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("PvPoF Launcher", 484, 304, 246, 312)
    $Input1 = GUICtrlCreateInput("", 185, 72, 121, 21)
    $Label1 = GUICtrlCreateLabel("Benutzer-ID", 215, 48, 60, 17)
    $Input2 = GUICtrlCreateInput("", 185, 122, 121, 21)
    $Label2 = GUICtrlCreateLabel("Passwort", 222, 104, 47, 17)
    $Button1 = GUICtrlCreateButton("Anmelden", 208, 152, 75, 25, 0)
    $Button2 = GUICtrlCreateButton("Registrieren", 208, 184, 75, 25, 0)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    [/autoit][autoit][/autoit][autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    $lSession = _FTP_Open($sAgent)
    $hConnect = _FTP_Connect($lSession, $sServerName, $sUserName, $sPassword)
    Local $hHandle
    $fFileFirst = _FTP_FindFileFirst($hConnect, $sPath, $hHandle)
    MsgBox(0, "", $fFileFirst)
    EndSwitch
    WEnd

    [/autoit]


    Aber in der MsgBox wird nicht die erste Datei ausgegeben.
    Danke für die Hilfe schon mal im Vorraus.
    Mfg

  • Fuchs jagt Hase

    • Nakroma
    • 8. April 2011 um 18:45

    Wann weis man wer wen jagen muss?

  • _FTP_OpenFile Problem

    • Nakroma
    • 7. April 2011 um 13:26

    Aso :D Danke sehr

  • _FTP_OpenFile Problem

    • Nakroma
    • 6. April 2011 um 14:09

    Also,
    das File was ich öffen will, öffnet es nicht.
    Hier das Script:

    [autoit]

    #include <GUIConstants.au3>
    #include <FTPEx.au3>
    ;==============================================================================================
    $sAgent = "PvPonFireFTP" ;Fantasie Name
    $sServerName = "*******"
    $sUserName = "*******"
    $sPassword = "******"
    $lFileName = "/html/news.txt"
    ;==============================================================================================
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("PvPoF Launcher", 484, 304, 246, 312)
    $Input1 = GUICtrlCreateInput("", 185, 72, 121, 21)
    $Label1 = GUICtrlCreateLabel("Benutzer-ID", 215, 48, 60, 17)
    $Input2 = GUICtrlCreateInput("", 185, 122, 121, 21)
    $Label2 = GUICtrlCreateLabel("Passwort", 222, 104, 47, 17)
    $Button1 = GUICtrlCreateButton("Anmelden", 208, 152, 75, 25, 0)
    $Button2 = GUICtrlCreateButton("Registrieren", 208, 184, 75, 25, 0)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    [/autoit][autoit][/autoit][autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    $lSession = _FTP_Open($sAgent)
    $hConnect = _FTP_Connect($lSession, $sServerName, $sUserName, $sPassword)
    _FTP_FileOpen($hConnect, $lFileName)
    EndSwitch
    WEnd

    [/autoit]


    Aber es öffnet es nicht!
    Mfg und Danke

  • Konsole einbinden

    • Nakroma
    • 13. März 2011 um 19:44

    ah jetzt gehts danke

  • Konsole einbinden

    • Nakroma
    • 13. März 2011 um 19:28

    Bei mir kommt nur die GUI und er Button, Konsole wird nicht eingebunden

  • Konsole einbinden

    • Nakroma
    • 13. März 2011 um 19:05

    Da passiert garnix

  • Konsole einbinden

    • Nakroma
    • 13. März 2011 um 18:50

    ERROR: $GUIHandle: undeclared global variable.
    WinGetHandle($GUIHandle)

    [autoit]

    $gui = GUICreate("BSP")
    WinGetHandle($GUIHandle)
    DllCall("user32.dll", "int", "SetParent", "hwnd", WinGetHandle("C:\WINXP\system32\cmd.exe"), "hwnd", $GUIHandle)

    [/autoit]


    Muss ich irgenwas noch includen?

  • Konsole einbinden

    • Nakroma
    • 13. März 2011 um 10:32

    Danke :) Probiers mal aus

  • Konsole einbinden

    • Nakroma
    • 13. März 2011 um 10:26

    Ein CMS Fenster, eine bat

Spenden

Jeder Euro hilft uns, Euch zu helfen.

Download

AutoIt Tutorial
AutoIt Buch
Onlinehilfe
AutoIt Entwickler
  1. Datenschutzerklärung
  2. Impressum
  3. Shoutbox-Archiv
Community-Software: WoltLab Suite™