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. OneNonlyNova

Beiträge von OneNonlyNova

  • Script für IE.au3 umschreiben nach FF.au3

    • OneNonlyNova
    • 29. März 2009 um 21:07

    also hier mal die ausgabe der console:

    Spoiler anzeigen
    [autoit]


    _FFConnect: OS:WIN_XP WIN32_NT 2600 Service Pack 3
    _FFConnect: AutoIt:3.2.10.0
    _FFConnect: FF.au3:0.5.1.0b-0
    _FFConnect: IP:127.0.0.1
    _FFConnect: Port:4242
    _FFConnect: Delay: 2ms
    _FFConnect: Socket: 1688
    _FFConnect: Browser:Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.0.8) Gecko/2009032609 Firefox/3.0.8
    _FFOpenURL: http://www.homepage.info/board/index.php
    __FFSend: try{window.content.frames["top"].document.location.href="http://www.homepage.info/board/index.php";}catch(e){"_FFOpenURL_Error"};
    __FFRecv: http://www.homepage.info/board/index.php
    _FFLoadWait: ... loaded in 1653ms
    _FFOpenURL: http://www.homepage.info/board/newthread.php?boardid=18
    __FFSend: try{window.content.frames["top"].document.location.href="http://www.homepage.info/board/newthread.php?boardid=18";}catch(e){"_FFOpenURL_Error"};
    __FFRecv: http://www.homepage.info/board/newthread.php?boardid=18
    _FFLoadWait: .. loaded in 775ms
    __FFSend: try{window.content.frames["top"].document.evaluate("//form[@name='bbform']//input[@type='radio' and @value='50']",content.document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue.checked=true;}catch(e){'_FFXPath_Error: '+e;};
    __FFRecv: 1
    __FFSend: (content.document.getElementsByName('topic')[0] != null ? content.document.getElementsByName('topic')[0].value='test' : '_FFSetValueByName_Err:');
    __FFRecv: test
    __FFSend: (content.document.getElementsByName('prefix')[0] != null ? content.document.getElementsByName('prefix')[0].value='divX' : '_FFSetValueByName_Err:');
    __FFRecv: divX
    __FFSend: FFau3.SimulateClick(content.frames["top"].document.getElementsByName('attachmentbutton')[0],0,0)
    __FFRecv: 1
    _FFLoadWait: . loaded in 22ms

    [/autoit]

    und der aktuelle code abschnitt:

    Spoiler anzeigen
    [autoit]


    #include <FF.au3>

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

    $boardid = "18"
    $topic = "test"
    $prefix = "divX"
    $iconid = "50"

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

    If _FFStart("http://www.homepage.info/board/index.php", Default, 0, True) Then

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

    _FFOpenURL ("http://www.homepage.info/board/newthread.php?boardid=" & $boardid )

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

    _FFFormRadioButton($iconid,0,"value","bbform","name")
    _FFSetValueByName("topic", $topic)
    _FFSetValueByName("prefix", $prefix)
    _FFClick("attachmentbutton","name")
    _FFLoadWait()

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

    WinWaitActive("USENET-SPACE-COWBOYS | Da")
    WinSetState("USENET-SPACE-COWBOYS | Da","",@SW_SHOW )
    _FFWindowSelect("USENET-SPACE-COWBOYS | Da","title")
    WinActivate("USENET-SPACE-COWBOYS | Da")
    _FFCmd(".getElementsByName('attachment_file')[0].focus()")
    Send("C:/CD4.33.4.jpg")
    _FFClick("submit","name")
    _FFLoadWait()

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

    #cs
    Was genau ließt du hier aus?
    #ce
    EndIf

    [/autoit]

    also bis zum popup geht alles super, und thx für den attach code den werd ich auf jeden fall einbauen ;)

    so aber zurück zum problem, ob das attachment popup nu in nem neuen tab auf geht oder nicht, ist mir im
    prinzip egal, da das ganze später sowieso unsichtbar ablaufen soll, solange die weiteren eingaben an das
    popup gehen ist das vollkommen egal ob neues fenter tab oder sonst was :)

    gruß

    nova

  • Script für IE.au3 umschreiben nach FF.au3

    • OneNonlyNova
    • 29. März 2009 um 03:04

    Hey Stilgar erstmal danke für die schnelle reaktion,

    folgendes problem, also dein code funktioniert schonmal soweit super,
    jedoch öffnet sich das popup nicht, der zu klickende button dafür wird
    im php code generiert und sieht dann hinterher so aus:

    PHP
    <script type="text/javascript">
    document.write('<input type="button" value="Dateianh&auml;nge" name="attachmentbutton" onclick="window.open(\'attachmentedit.php?boardid=18&idhash=3ce9404700c85a14ce9ef0af9b7e1e0f&attachmentids=\'+document.bbform.attachmentids.value+\'\', \'moo\', \'toolbar=no,scrollbars=yes,resizable=yes,width=450,height=400\')" class="input"  />');
    </script>
    <noscript>
    <span class="normalfont"><a href="attachmentedit.php?boardid=18&amp;idhash=3ce9404700c85a14ce9ef0af9b7e1e0f" target="_blank">Dateianh&auml;nge</a></span>

    zu deiner frage was dort ausgelesen wird, mittels

    [autoit]


    Send($attachfile1)
    ;$oQuery = _IEFormElementGetObjByName ($oForm, "submit")
    _FFClick("submit","name")

    [/autoit]

    wird eine datei ins das "Durchsuchen" input dateifeld geschickt und
    abgesendet, nachdem hochladen wird der fürs forum bestimmte "[attach]fileid[/attach]"
    code angezeigt und genau diesen lese ich dort aus :)

    gruß

    nova

  • Script für IE.au3 umschreiben nach FF.au3

    • OneNonlyNova
    • 29. März 2009 um 00:53

    Hey Leute also mein Script läuft prima nur mit dem IE gibts immerwieder probleme auf
    verschidenen systemen und so... deswegen wollt ich jetz alles nach FF umschreiben brauche
    dabei aber hilfe kriegs nicht so ganz hin, hier mein IE script:

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

    $oIE = _FFStart ("http://www.homepage.info/board/index.php", 1, 0, 1)
    _FFLoadWait ($oIE)
    _FFOpenURL ($oIE, "http://www.homepage.info/board/newthread.php?boardid=" & $boardid )
    _FFLoadWait ($oIE)
    $oForm = _IEFormGetObjByName ($oIE, "bbform")
    _IEFormElementRadioSelect ($oForm, $iconid, "iconid", 1, "byValue")

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

    $oQuery = _IEFormElementGetObjByName ($oForm, "topic")
    _IEFormElementSetValue ($oQuery, $topic )

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

    $oQuery = _IEFormElementGetObjByName ($oForm, "prefix")
    _IEFormElementSetValue ($oQuery, $prefix )

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

    Sleep ( 2000 )

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

    $oQuery = _IEFormElementGetObjByName ($oForm, "attachmentbutton")
    _IEAction ($oQuery, "click")

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

    ;; ATTACHMENT POPUP
    WinWaitActive("USENET-SPACE-COWBOYS | Da")
    $oIEpop = _IEAttach ("USENET-SPACE-COWBOYS | Da")
    _IEAction ($oIEpop, "invisible") ;;; VERSTECKE POPUP
    $oForm = _IEFormGetObjByName ($oIEpop, "attachmentupload")
    $oQuery = _IEFormElementGetObjByName ($oForm, "attachment_file")
    WinActivate("USENET-SPACE-COWBOYS | Da")
    _IEAction($oQuery, "focus")
    Send($attachfile1)
    $oQuery = _IEFormElementGetObjByName ($oForm, "submit")
    _IEAction ($oQuery, "click")
    _IELoadWait ($oIEpop)
    Sleep( 2000 )
    $sHTML = _IEDocReadHTML ($oIEpop)
    $result = StringInStr($sHTML, "[attach]" )
    $resutt2 = StringTrimLeft($sHTML, $result -1 )
    $result3 = StringInStr($resutt2, "[/attach]" )
    $result4 = StringLeft($resutt2, $result3 + 8)
    $attach1 = $result4

    [/autoit]


    lese jetz sein über 2 stunden die doku zur ff.au3 und diese vergleistabelle,
    aber bekomms einfach nicht hin wäre super wenn jemand helfen könnte

    vielen dank

    euer nova

  • IE7 Steuerungs Problem

    • OneNonlyNova
    • 26. März 2009 um 23:24

    Hey leute ich habe hier ein ausschnitt aus meinem script:

    [autoit]


    $oIE = _IECreate ("http://www.usenet-space-cowboys.info/board/index.php", 1, 1, 1)
    _IELoadWait ($oIE)
    _IENavigate ($oIE, "http://www.usenet-space-cowboys.info/board/newthread.php?boardid=" & $boardid )
    $oForm = _IEFormGetObjByName ($oIE, "bbform")
    _IEFormElementRadioSelect ($oForm, $iconid, "iconid", 1, "byValue")

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

    $oQuery = _IEFormElementGetObjByName ($oForm, "topic")
    _IEFormElementSetValue ($oQuery, $topic )

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

    $oQuery = _IEFormElementGetObjByName ($oForm, "prefix")
    _IEFormElementSetValue ($oQuery, $prefix )

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

    Sleep ( 2000 )

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

    $oQuery = _IEFormElementGetObjByName ($oForm, "attachmentbutton")
    _IEAction ($oQuery, "click")

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

    ProgressSet( "20", "20%") ;;;;; PROGRESS SET !!!!!!!!!!!!!!

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

    ;; ATTACHMENT POPUP
    WinWaitActive("USENET-SPACE-COWBOYS | Da")
    $oIEpop = _IEAttach ("USENET-SPACE-COWBOYS | Da")
    _IELoadWait ($oIEpop) ;; WARTE BIS POPUP GELADEN WURDE
    ;_IEAction ($oIEpop, "invisible") ;;; VERSTECKE POPUP
    $oForm = _IEFormGetObjByName ($oIEpop, "attachmentupload")
    $oQuery = _IEFormElementGetObjByName ($oForm, "attachment_file")
    WinActivate("USENET-SPACE-COWBOYS | Da")
    _IEAction($oQuery, "focus")
    Send($attachfile1)
    $oQuery = _IEFormElementGetObjByName ($oForm, "submit")
    _IEAction ($oQuery, "click")
    _IELoadWait ($oIEpop)
    Sleep( 2000 )
    $sHTML = _IEDocReadHTML ($oIEpop)
    $result = StringInStr($sHTML, "[attach]" )
    $resutt2 = StringTrimLeft($sHTML, $result -1 )
    $result3 = StringInStr($resutt2, "[/attach]" )
    $result4 = StringLeft($resutt2, $result3 + 8)
    $attach1 = $result4

    [/autoit]

    bei mir selber läuft das total super, aber bei anderen
    bleibt er bei ;; ATTACHMENT POPUP hängen und überspringt
    das popup dann einfach und mach mit dem restlichen code weiter

    hat wer ne ahnung wo da der fehler sein könnte?
    ich verstehs nicht weil wie gesagt bei mir läufts super

    gruß

    nova

  • Forum Attachment per Autoit hochladen

    • OneNonlyNova
    • 25. März 2009 um 18:26

    aha also ich habs jetzt schon so weit geschafft, dass ich das popup von dem attachment öffnet,
    nur wie kann ich in diesem navigieren? ich benutze ja sonst die variable von IECreate,
    wie komm ich an das neue fenster ran?

    gruß nova

  • Forum Attachment per Autoit hochladen

    • OneNonlyNova
    • 25. März 2009 um 16:50

    wie könnte man es dann reinmogeln, wie du so schön meintest? ^^

  • Forum Attachment per Autoit hochladen

    • OneNonlyNova
    • 25. März 2009 um 16:31

    ja das würde theoretisch gehen, ich könnte das attach ja erst in den temp
    ordner auf der festplatte kopieren und diesen pfad dann in das input fenster
    einfügen, würde das so gehen?

    gruß nova

  • Forum Attachment per Autoit hochladen

    • OneNonlyNova
    • 25. März 2009 um 16:23

    also datei uploads sind nicht möglich? in keiner art und weise? weil darauf kommt es an

    gruß nova

  • Forum Attachment per Autoit hochladen

    • OneNonlyNova
    • 25. März 2009 um 16:10

    Hey Jungs, ich muss mal wieder um eure hilfe bitten,

    ich habe folgendes problem und zwar möchte ich wissen,
    ob es mit autoit möglich ist ein php formular auszufüllen,
    in dem auch ein popup mit "Durchsuchen" für ein datei
    upload bei ist.

    es geht im grunde um einen automatisierten forum
    post mit anhang für ein community board von mir


    gruß nova

  • Problem mit FileCopy / DirCopy

    • OneNonlyNova
    • 18. Februar 2009 um 21:35

    hehe jetz wo ich das endlich geschafft habe antwortet ihr ^^ naja werd die tage dann mal das fertig script posten, vllt brauchs ja wer :)

    hier schonmal das bisherige:

    Spoiler anzeigen
    [autoit]


    #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
    #AutoIt3Wrapper_Version=Beta
    #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
    #include <GUIConstants.au3>
    #include <Array.au3>

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

    ;; ############## MULTI DIR COPY ##########

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

    ;===werden benötigt=============================================================
    #include <String.au3>
    #include <Misc.au3>
    Global $strFiles = '', $strSize = 0
    ;===============================================================================

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

    ;===Beispiel 1 (erstellen der Datei "!copydata.mfc" im Quellverzeichnis)========
    ;Global $sSourcePath = 'C:\Programme\AutoIt3\Examples\'

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

    ;Global $aReturn = _MultiFileCopy($sSourcePath)

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

    ;MsgBox(0, 'MFC', '"!copydata.mfc" wurde erstellt!')
    ;===============================================================================

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

    ;===Beispiel 2 (komplettes Verzeichnis kopieren)================================
    ; Alle Dateien und Unterverzeichnisse (rekursiv) werden kopiert
    ; Verzeichnisstruktur der Quelle wird übernommen
    ;Global $sSourcePath = 'C:\Programme\AutoIt3\Examples\'
    ;Global $sDestinationPath = @ScriptDir & '\Tmp1'; Zielpfad (wird ggf. erstellt)

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

    ;Global $aReturn = _MultiFileCopy($sSourcePath, $sDestinationPath, False)
    ;===============================================================================

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

    ;===Beispiel 3 (mehrere Dateien kopieren)=======================================
    ; Alle Dateien aus dem Array werden ins Zielverzeichnis kopiert
    ; Array[0] muss die Anzahl der zu kopierenden Dateien enthalten
    ;Global $aSource[4] = [3, @SystemDir & '\shell32.dll', @SystemDir & '\mspaint.exe', @SystemDir & '\eula.txt']
    ;Global $sDestinationPath = @ScriptDir & '\Tmp2'; Zielpfad (wird ggf. erstellt)

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

    ;Global $aReturn = _MultiFileCopy($aSource, $sDestinationPath, False)
    ;===============================================================================

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

    ;===============================================================================
    ; Function Name: _MultiFileCopy
    ; Description:: Kopiert mehrere Dateien mit Progressbar
    ; Parameter(s): Array mit Dateien zum kopieren oder Quellpfad,
    ; Zielpfad,
    ; überschreiben? [True/False],
    ; Wenn überschreiben = True, dann PreFix zum überschreiben
    ; Return Value(s): Array mit den kopierten Dateien
    ; Requirement(s): Global $strFiles = '', $strSize = 0
    ; #include<String.au3>
    ; #include<Misc.au3>
    ; Author(s): Tom99, progandy, eukalyptus and Oscar (http://www.autoit.de)
    ;===============================================================================
    Func _MultiDirCopy($aSource, $sDestPath = '', $bOverWrite = True, $sPreFix = '!Copy')
    Local $oldGUICloseOnESC = Opt('GUICloseOnESC', 0)
    Local $ret, $sShowSource, $sShowDest, $sSourcePath = '', $sNewFolder = '', $k
    Local $aMFC[12] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, False, DllOpen('user32.dll')]
    If IsArray($aSource) Then
    If Not IsNumber($aSource[0]) Then Return SetError(1, 0, 0)
    For $i = 1 To $aSource[0]
    $aMFC[7] += FileGetSize($aSource[$i])
    Next
    Else
    $sSourcePath = $aSource
    If StringRight($sSourcePath, 1) <> '\' Then $sSourcePath &= '\'
    $strSize = 0
    TrayTip('Lese ein', 'Bitte warten! Verzeichnis wird eingelesen!', 10)
    If FileExists($sSourcePath & '!copydata.mfc') And $sDestPath <> '' Then
    Local $sFile = StringTrimRight(FileRead($sSourcePath & '!copydata.mfc'), 2)
    $strSize = StringLeft($sFile, StringInStr($sFile, @CRLF) - 1)
    $aSource = StringSplit(StringTrimLeft($sFile, StringInStr($sFile, @CRLF) + 1), @CRLF, 1)
    Else
    If FileExists($sSourcePath & '!copydata.mfc') Then FileDelete($sSourcePath & '!copydata.mfc')
    $aSource = _GetFilesFolder_Rekursiv($sSourcePath)
    Local $hFile = FileOpen($sSourcePath & '!copydata.mfc', 2)
    If $hFile <> -1 Then
    FileWriteLine($hFile, $strSize)
    For $i = 1 To $aSource[0]
    FileWriteLine($hFile, $aSource[$i])
    Next
    FileClose($hFile)
    EndIf
    EndIf
    $aMFC[7] = $strSize
    ToolTip('')
    If $sDestPath = '' Then Return SetError(0, 0, 1)
    EndIf

    TrayTip( "Kopiere", $sSourcePath, 10 ) ; ######## GERADE KOPIERENDE DATEI ANSAGEN!

    If StringRight($sDestPath, 1) <> '\' Then $sDestPath &= '\'
    If Not FileExists($sDestPath) Then
    If Not DirCreate($sDestPath) Then Return SetError(2, 0, 0)
    EndIf
    $sShowDest = StringRegExpReplace($sDestPath, '(.{15})(.*)(.{35})', '$1' & '[...]' & '$3')
    Local $aReturn = $aSource
    Local $callback = DllCallbackRegister('__Progress', 'int', 'uint64;uint64;uint64;uint64;dword;dword;ptr;ptr;str')
    Local $ptr = DllCallbackGetPtr($callback)
    Local $DllKernel32 = DllOpen('kernel32.dll')
    __ProgressCreate($aMFC)
    $aMFC[9] = TimerInit()
    For $i = 1 To $aSource[0]
    $sArray = ''
    For $j = 0 To 11
    $sArray &= $aMFC[$j] & ';'
    Next
    $sFile = StringMid($aSource[$i], StringInStr($aSource[$i], '\', 0, -1) + 1)
    If $sSourcePath <> '' Then
    $sNewFolder = StringTrimLeft(StringLeft($aSource[$i], StringInStr($aSource[$i], '\', 0, -1)), StringLen($sSourcePath))
    If Not FileExists($sDestPath & $sNewFolder) Then
    If Not DirCreate($sDestPath & $sNewFolder) Then Return SetError(3, 0, 0)
    EndIf
    EndIf
    If $sFile = '' Then ContinueLoop
    $k = 0
    While $bOverWrite = False And FileExists($sDestPath & $sNewFolder & $sFile)
    $k += 1
    $sFile = $sPreFix & $k & "_" & StringMid($aSource[$i], StringInStr($aSource[$i], '\', 0, -1) + 1)
    WEnd
    $aReturn[$i] = $sDestPath & $sNewFolder & $sFile
    $sShowSource = StringRegExpReplace($aSource[$i], '(.{15})(.*)(.{35})', '$1' & '[...]' & '$3')
    GUICtrlSetData($aMFC[1], 'Kopiere Datei ' & @CRLF & '"' & $sShowSource & '"' & @CRLF & 'nach: "' & $sShowDest & '"')
    $ret = DllCall($DllKernel32, 'int', 'CopyFileExA', 'str', $aSource[$i], 'str', $aReturn[$i], 'ptr', $ptr, 'str', $sArray, 'int', 0, 'int', 0)
    ;~ ConsoleWrite('Return: ' & $ret[0] & @LF)

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

    If $ret[0] = 0 Then $aMFC[10] = True
    $aMFC[8] += FileGetSize($aSource[$i])
    Next
    DllClose($DllKernel32)
    DllCallbackFree($callback)
    GUIDelete($aMFC[0])
    DllClose($aMFC[11])
    Opt('GUICloseOnESC', $oldGUICloseOnESC)
    Return $aReturn
    EndFunc ;==>_MultiFileCopy

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

    ;; ############## MULTI DIR COPY END ######

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

    ;; ############## MULTI FILE COPY ##########

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

    ;===werden benötigt=============================================================
    #include <String.au3>
    #include <Misc.au3>
    Global $strFiles = '', $strSize = 0
    ;===============================================================================

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

    ;===Beispiel 1 (erstellen der Datei "!copydata.mfc" im Quellverzeichnis)========
    ;Global $sSourcePath = 'C:\Programme\AutoIt3\Examples\'

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

    ;Global $aReturn = _MultiFileCopy($sSourcePath)

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

    ;MsgBox(0, 'MFC', '"!copydata.mfc" wurde erstellt!')
    ;===============================================================================

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

    ;===Beispiel 2 (komplettes Verzeichnis kopieren)================================
    ; Alle Dateien und Unterverzeichnisse (rekursiv) werden kopiert
    ; Verzeichnisstruktur der Quelle wird übernommen
    ;Global $sSourcePath = 'C:\Programme\AutoIt3\Examples\'
    ;Global $sDestinationPath = @ScriptDir & '\Tmp1'; Zielpfad (wird ggf. erstellt)

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

    ;Global $aReturn = _MultiFileCopy($sSourcePath, $sDestinationPath, False)
    ;===============================================================================

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

    ;===Beispiel 3 (mehrere Dateien kopieren)=======================================
    ; Alle Dateien aus dem Array werden ins Zielverzeichnis kopiert
    ; Array[0] muss die Anzahl der zu kopierenden Dateien enthalten
    ;Global $aSource[4] = [3, @SystemDir & '\shell32.dll', @SystemDir & '\mspaint.exe', @SystemDir & '\eula.txt']
    ;Global $sDestinationPath = @ScriptDir & '\Tmp2'; Zielpfad (wird ggf. erstellt)

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

    ;Global $aReturn = _MultiFileCopy($aSource, $sDestinationPath, False)
    ;===============================================================================

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

    ;===============================================================================
    ; Function Name: _MultiFileCopy
    ; Description:: Kopiert mehrere Dateien mit Progressbar
    ; Parameter(s): Array mit Dateien zum kopieren oder Quellpfad,
    ; Zielpfad,
    ; überschreiben? [True/False],
    ; Wenn überschreiben = True, dann PreFix zum überschreiben
    ; Return Value(s): Array mit den kopierten Dateien
    ; Requirement(s): Global $strFiles = '', $strSize = 0
    ; #include<String.au3>
    ; #include<Misc.au3>
    ; Author(s): Tom99, progandy, eukalyptus and Oscar (http://www.autoit.de)
    ;===============================================================================
    Func _MultiFileCopy($aSource, $sDestPath = '', $bOverWrite = True, $sPreFix = '!Copy')
    Local $oldGUICloseOnESC = Opt('GUICloseOnESC', 0)
    Local $ret, $sShowSource, $sShowDest, $sSourcePath = '', $sNewFolder = '', $k
    Local $aMFC[12] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, False, DllOpen('user32.dll')]
    If IsArray($aSource) Then
    If Not IsNumber($aSource[0]) Then Return SetError(1, 0, 0)
    For $i = 1 To $aSource[0]
    $aMFC[7] += FileGetSize($aSource[$i])
    Next
    Else
    $sSourcePath = $aSource
    If StringRight($sSourcePath, 1) <> '\' Then $sSourcePath &= '\'
    $strSize = 0
    TrayTip('Lese ein', 'Bitte warten! Verzeichnis wird eingelesen!', 10)
    If FileExists($sSourcePath & '!copydata.mfc') And $sDestPath <> '' Then
    Local $sFile = StringTrimRight(FileRead($sSourcePath & '!copydata.mfc'), 2)
    $strSize = StringLeft($sFile, StringInStr($sFile, @CRLF) - 1)
    $aSource = StringSplit(StringTrimLeft($sFile, StringInStr($sFile, @CRLF) + 1), @CRLF, 1)
    Else
    If FileExists($sSourcePath & '!copydata.mfc') Then FileDelete($sSourcePath & '!copydata.mfc')
    $aSource = _GetFilesFolder_Rekursiv($sSourcePath)
    Local $hFile = FileOpen($sSourcePath & '!copydata.mfc', 2)
    If $hFile <> -1 Then
    FileWriteLine($hFile, $strSize)
    For $i = 1 To $aSource[0]
    FileWriteLine($hFile, $aSource[$i])
    Next
    FileClose($hFile)
    EndIf
    EndIf
    $aMFC[7] = $strSize
    ToolTip('')
    If $sDestPath = '' Then Return SetError(0, 0, 1)
    EndIf
    If StringRight($sDestPath, 1) <> '\' Then $sDestPath &= '\'
    If Not FileExists($sDestPath) Then
    If Not DirCreate($sDestPath) Then Return SetError(2, 0, 0)
    EndIf
    $sShowDest = StringRegExpReplace($sDestPath, '(.{15})(.*)(.{35})', '$1' & '[...]' & '$3')
    Local $aReturn = $aSource
    Local $callback = DllCallbackRegister('__Progress', 'int', 'uint64;uint64;uint64;uint64;dword;dword;ptr;ptr;str')
    Local $ptr = DllCallbackGetPtr($callback)
    Local $DllKernel32 = DllOpen('kernel32.dll')
    __ProgressCreate($aMFC)
    $aMFC[9] = TimerInit()
    For $i = 1 To $aSource[0]
    $sArray = ''
    For $j = 0 To 11
    $sArray &= $aMFC[$j] & ';'
    Next
    $sFile = StringMid($aSource[$i], StringInStr($aSource[$i], '\', 0, -1) + 1)
    If $sSourcePath <> '' Then
    $sNewFolder = StringTrimLeft(StringLeft($aSource[$i], StringInStr($aSource[$i], '\', 0, -1)), StringLen($sSourcePath))
    If Not FileExists($sDestPath & $sNewFolder) Then
    If Not DirCreate($sDestPath & $sNewFolder) Then Return SetError(3, 0, 0)
    EndIf
    EndIf
    If $sFile = '' Then ContinueLoop
    $k = 0
    While $bOverWrite = False And FileExists($sDestPath & $sNewFolder & $sFile)
    $k += 1
    $sFile = $sPreFix & $k & "_" & StringMid($aSource[$i], StringInStr($aSource[$i], '\', 0, -1) + 1)
    WEnd
    $aReturn[$i] = $sDestPath & $sNewFolder & $sFile
    $sShowSource = StringRegExpReplace($aSource[$i], '(.{15})(.*)(.{35})', '$1' & '[...]' & '$3')


    TrayTip( "Kopiere", $aSource[$i], 10 ) ; ######## GERADE KOPIERENDE DATEI ANSAGEN!

    GUICtrlSetData($aMFC[1], 'Kopiere Datei ' & @CRLF & '"' & $sShowSource & '"' & @CRLF & 'nach: "' & $sShowDest & '"')
    $ret = DllCall($DllKernel32, 'int', 'CopyFileExA', 'str', $aSource[$i], 'str', $aReturn[$i], 'ptr', $ptr, 'str', $sArray, 'int', 0, 'int', 0)
    ;~ ConsoleWrite('Return: ' & $ret[0] & @LF)

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

    If $ret[0] = 0 Then $aMFC[10] = True
    $aMFC[8] += FileGetSize($aSource[$i])
    Next
    DllClose($DllKernel32)
    DllCallbackFree($callback)
    GUIDelete($aMFC[0])
    DllClose($aMFC[11])
    Opt('GUICloseOnESC', $oldGUICloseOnESC)
    Return $aReturn
    EndFunc ;==>_MultiFileCopy

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

    Func __Progress($FileSize, $BytesTransferred, $StreamSize, $StreamBytesTransferred, $dwStreamNumber, $dwCallbackReason, $hSourceFile, $hDestinationFile, $lpData)
    Local $aSplit = StringSplit(StringTrimRight($lpData, 1), ";")
    If $aSplit[11] = 'True' Then Return 1
    Local $pos = GUIGetCursorInfo($aSplit[1])
    If _IsPressed('1B', Int($aSplit[12])) Then Return 1
    If _IsPressed('01', Int($aSplit[12])) And ($pos[4] = Int($aSplit[7])) Then Return 1
    Local $sPercent = Round($BytesTransferred / $FileSize * 100, 0), $iTime, $iTotalTime, $iTransferRate
    Local $sPercentAll = Round(($aSplit[9] + $BytesTransferred) / $aSplit[8] * 100, 0)
    $iTime = TimerDiff($aSplit[10])
    $iTotalTime = Ceiling($iTime / 1000 / ($sPercentAll + 0.1) * 100)
    $iTransferRate = _StringAddThousandsSep(Int($aSplit[8] / $iTotalTime / 1000), '.', ',')
    GUICtrlSetData($aSplit[3], $sPercent & ' %')
    GUICtrlSetData($aSplit[5], $sPercent)
    GUICtrlSetData($aSplit[4], $sPercentAll & ' % Zeit: ' & Int($iTime / 1000) & '/' & $iTotalTime & ' s (' & $iTransferRate & ' KB/s)')
    GUICtrlSetData($aSplit[6], $sPercentAll)
    EndFunc ;==>__Progress

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

    Func __ProgressCreate(ByRef $aMFC)
    If Not IsDeclared('WS_POPUPWINDOW') Then Local Const $WS_POPUPWINDOW = 0x80880000
    If Not IsDeclared('WS_EX_TOOLWINDOW') Then Local Const $WS_EX_TOOLWINDOW = 0x00000080
    If Not IsDeclared('WS_EX_COMPOSITED') Then Local Const $WS_EX_COMPOSITED = 0x02000000
    $aMFC[0] = GUICreate('MultiFileCopy', 480, 220, -1, -1, $WS_POPUPWINDOW, BitOR($WS_EX_TOPMOST, $WS_EX_COMPOSITED))
    $aMFC[1] = GUICtrlCreateLabel('', 10, 10, 460, 65)
    GUICtrlSetFont(-1, 10, 400, 0, 'Courier New')
    GUICtrlCreateLabel('Datei:', 10, 83, 60, 16)
    GUICtrlSetFont(-1, 11, 600, 0, 'Courier New')
    $aMFC[2] = GUICtrlCreateLabel('0 %', 80, 83, 390, 16)
    GUICtrlSetFont(-1, 11, 600, 0, 'Courier New')
    $aMFC[4] = GUICtrlCreateProgress(10, 100, 460, 20)
    GUICtrlCreateLabel('Gesamt:', 10, 133, 60, 16)
    GUICtrlSetFont(-1, 11, 600, 0, 'Courier New')
    $aMFC[3] = GUICtrlCreateLabel('0 %', 80, 133, 390, 16)
    GUICtrlSetFont(-1, 11, 600, 0, 'Courier New')
    $aMFC[5] = GUICtrlCreateProgress(10, 150, 460, 20)
    $aMFC[6] = GUICtrlCreateButton('Abbrechen', 200, 185, 75, 25)
    GUICtrlSetFont(-1, 9, 400, 0, 'Arial')
    GUISetState()
    EndFunc ;==>__ProgressCreate

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

    ;==================================================================================================
    ; Function Name: _GetFilesFolder_Rekursiv($sPath [, $sExt='*' [, $iDir=-1 [, $iRetType=0 ,[$sDelim='0']]]])
    ; Description: Rekursive Auflistung von Dateien und/oder Ordnern
    ; Anpassung: Verzeichnisgröße ermitteln für _MultiFileCopy ($strSize)
    ; Parameter(s): $sPath der Basispfad für die Auflistung ('.' -aktueller Pfad, '..' -Parentpfad)
    ; $sExt Erweiterung für Dateiauswahl '*' oder -1 für alle (Standard)
    ; $iDir -1 Dateien+Ordner(Standard), 0 nur Dateien, 1 nur Ordner
    ; optional: $iRetType 0 gibt Array, 1 gibt String zurück
    ; optional: $sDelim legt Trennzeichen für Stringrückgabe fest
    ; 0 -@CRLF (Standard) 1 -@CR 2 -@LF 3 -';' 4 -'|'
    ; Return Value(s): Array (Standard) od. String mit den gefundenen Pfaden der Dateien und/oder Ordner
    ; Array[0] enthält die Anzahl der gefundenen Dateien/Ordner
    ; Author(s): BugFix ([email='bugfix@autoit.de'][/email])
    ;==================================================================================================
    Func _GetFilesFolder_Rekursiv($sPath, $sExt='*', $iDir=-1, $iRetType=0, $sDelim='0')
    Global $oFSO = ObjCreate('Scripting.FileSystemObject')
    Global $strFiles = ''
    Switch $sDelim
    Case '1'
    $sDelim = @CR
    Case '2'
    $sDelim = @LF
    Case '3'
    $sDelim = ';'
    Case '4'
    $sDelim = '|'
    Case Else
    $sDelim = @CRLF
    EndSwitch
    If ($iRetType < 0) Or ($iRetType > 1) Then $iRetType = 0
    If $sExt = -1 Then $sExt = '*'
    If ($iDir < -1) Or ($iDir > 1) Then $iDir = -1
    _ShowSubFolders($oFSO.GetFolder($sPath),$sExt,$iDir,$sDelim)
    If $iRetType = 0 Then
    Local $aOut
    $aOut = StringSplit(StringTrimRight($strFiles, StringLen($sDelim)), $sDelim, 1)
    If $aOut[1] = '' Then
    ReDim $aOut[1]
    $aOut[0] = 0
    EndIf
    Return $aOut
    Else
    Return StringTrimRight($strFiles, StringLen($sDelim))
    EndIf
    EndFunc

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

    Func _ShowSubFolders($Folder, $Ext='*', $Dir=-1, $Delim=@CRLF)
    If Not IsDeclared("strFiles") Then Global $strFiles = ''
    If ($Dir = -1) Or ($Dir = 0) Then
    For $file In $Folder.Files
    If $Ext <> '*' Then
    If StringRight($file.Name, StringLen($Ext)) = $Ext Then
    $strSize += $file.size
    $strFiles &= $file.Path & $Delim
    EndIf
    Else
    $strSize += $file.size
    $strFiles &= $file.Path & $Delim
    EndIf
    Next
    EndIf
    For $Subfolder In $Folder.SubFolders
    If ($Dir = -1) Or ($Dir = 1) Then $strFiles &= $Subfolder.Path & '\' & $Delim
    _ShowSubFolders($Subfolder, $Ext, $Dir, $Delim)
    Next
    EndFunc

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

    ;; ############## MULTI FILE COPY END ######

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

    $inispath = IniRead ( "settings.ini", "Settings", "spath", "Zu durchsuchender Ordner" )
    $inidpath = IniRead ( "settings.ini", "Settings", "dpath", "Zielordner" )

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

    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("LAN Downloader - by Alexander Scherer", 849, 647, 218, 226)
    $Group1 = GUICtrlCreateGroup("LAN Downloader ", 16, 24, 825, 617)
    $spath = GUICtrlCreateInput($inispath, 120, 48, 305, 21)
    $dpath = GUICtrlCreateInput($inidpath, 550, 48, 250, 21)
    $Label2 = GUICtrlCreateLabel("Such Ordner:", 32, 48, 81, 20)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    $dig = GUICtrlCreateButton("DIG IT", 456, 48, 73, 25, 0)
    $Group2 = GUICtrlCreateGroup("Dateien / Ordner ", 24, 88, 809, 505)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $check_all = GUICtrlCreateButton("Check All", 40, 608, 75, 25, 0)
    $dlgoo = GUICtrlCreateButton("DL TIS SHiT", 152, 608, 75, 25, 0)
    $clear = GUICtrlCreateButton("RELOAD", 252, 608, 75, 25, 0)
    $exit = GUICtrlCreateButton("eXiT", 728, 608, 75, 25, 0)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Label1 = GUICtrlCreateLabel("AutoIT LAN Downloader by Alexander Scherer", 560, 8, 266, 17)
    GUICtrlSetFont(-1, 8, 800, 4, "MS Sans Serif")
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    $guichecked = 0

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

    TrayTip( "Willkommen", "viel Spaß mit meinem LAN Downloader", 10)

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

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

    Case $dig

    ; Shows the filenames of all files in the current directory, note that "." and ".." are returned.
    $search = FileFindFirstFile( GUICtrlRead($spath) & "\*.*" )
    Dim $anzahl
    Dim $summe
    $high = 88
    $left = 40


    ; Check if the search was successful
    If $search = -1 Then
    MsgBox(0, "Error", "No files/directories matched the search pattern")
    Exit
    EndIf

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

    While 1
    $file = FileFindNextFile($search)
    If @error Then ExitLoop
    $summe += 1
    WEnd

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

    ; Close the search handle
    FileClose($search)

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

    $search = FileFindFirstFile( GUICtrlRead($spath) & "\*.*" )

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

    If $search = -1 Then
    MsgBox(0, "Error", "No files/directories matched the search pattern")
    Exit
    EndIf

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

    Dim $box[$summe+1]
    Dim $files[$summe+1]
    Dim $ordner[1]
    Dim $k

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

    If $summe <> "" Then
    For $i = 1 to $summe
    GUICtrlDelete ($box[$i])
    Next
    EndIf

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

    For $i = 1 to $summe
    $file = FileFindNextFile($search)
    If @error Then ExitLoop
    ; MsgBox(4096, "File:", $file)
    $anzahl += 1
    if $anzahl > 20 Then
    $left += 232
    $high = 88
    $anzahl = 1
    ElseIf $anzahl > 40 Then
    $left = 496
    $high = 88
    EndIf
    If $anzahl > 60 Then
    MsgBox( 1, "ERROR", "Zu viele Dateien ( 60 Maximum )!")
    Exit
    EndIf


    $check = FileGetAttrib ( GUICtrlRead($spath) & "\" & $file )

    If StringInStr( $check, "D" ) Then
    $high = 88 + $anzahl * 24
    $box[$i] = GUICtrlCreateCheckbox($file, $left, $high, 200, 17)
    $k += 1
    $ordneradd = GUICtrlRead($spath) & "\" & $file & "\"
    _ArrayAdd( $ordner, $ordneradd )
    $ordner[0] = $k
    Else
    $high = 88 + $anzahl * 24
    $box[$i] = GUICtrlCreateCheckbox($file, $left, $high, 200, 17)
    $files[$i] = GUICtrlRead($spath) & "\" & $file
    EndIf
    Next

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

    ; Close the search handle
    FileClose($search)

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


    Case $check_all
    if $guichecked = 0 Then
    For $i = 1 to $summe
    GUICtrlSetState( $box[$i], $GUI_CHECKED )
    $guichecked = 1
    Next
    Else
    For $i = 1 to $summe
    GUICtrlSetState( $box[$i], $GUI_UNCHECKED )
    $guichecked = 0
    Next
    EndIf


    Case $clear

    IniWrite ( "settings.ini", "Settings", "spath", GUICtrlRead($spath) )
    IniWrite ( "settings.ini", "Settings", "dpath", GUICtrlRead($dpath) )

    Run( "LANDL.exe" )
    Exit


    Case $dlgoo

    Dim $aSource[$summe+1]
    Dim $f
    $f = 0

    For $i = 1 to $summe
    If GUICtrlRead ( $box[$i] ) = $GUI_CHECKED Then
    $f += 1
    $aSource[0] = $f
    $aSource[$i] = $files[$i]
    ;MsgBox(0,"",$files[$i])
    EndIf
    Next

    Dim $daten[1]
    $daten[0] = $f

    For $i = 1 to $summe
    If GUICtrlRead ( $box[$i] ) = $GUI_CHECKED Then
    _ArrayAdd($daten, $files[$i])
    EndIf
    Next

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


    ;===Beispiel 3 (mehrere Dateien kopieren)=======================================
    ; Alle Dateien aus dem Array werden ins Zielverzeichnis kopiert
    ; Array[0] muss die Anzahl der zu kopierenden Dateien enthalten
    $sDestinationPath = GUICtrlRead($dpath) & '\'; Zielpfad (wird ggf. erstellt)
    GUISetState(@SW_HIDE, $Form1)

    If $ordner[0] <> "" Then
    ;MsgBox(0,"","dl ordner")
    For $i = 1 to $k
    _MultiDirCopy($ordner[$i], $sDestinationPath, False)
    Next
    EndIf

    _MultiFileCopy($daten, $sDestinationPath, False)

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

    TrayTip( "Erledigt", "Alle Dateien / Ordner kopiert", 10 )

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

    ;; FILE / DIR COPY

    ;~ Dim $isdir
    ;~
    ;~ For $i = 1 to $summe
    ;~ $isdir = 0
    ;~ If $aSource[$i] <> "" Then
    ;~ $attrib = FileGetAttrib($aSource[$i])
    ;~ If @error Then
    ;~ MsgBox(4096,"Error", "Could not obtain file attributes.")
    ;~ Exit
    ;~ EndIf
    ;~
    ;~ If StringInStr($attrib, "D") Then
    ;~ MsgBox(4096,"", "File is a Directory.")
    ;~ $isdir = 1
    ;~ EndIf
    ;~
    ;~ If $isdir = 1 Then
    ;~ DirCopy($aSource[$i],$sDestinationPath)
    ;~ TrayTip ( "Copy Dir", $aSource[$i], 10 )
    ;~ Else
    ;~ FileCopy($aSource[$i],$sDestinationPath)
    ;~ TrayTip ( "Copy File", $aSource[$i], 10 )
    ;~ EndIf
    ;~
    ;~ TrayTip ( "Finished File", $aSource[$i], 10 )
    ;~
    ;~ EndIf
    ;~
    ;~ Next
    ;~
    ;~
    ;~ TrayTip ( "Finished", "all Files / Dirs have been finished", 10 )
    ;~

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

    ;; FILE / DIR COPY END

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

    GUISetState(@SW_SHOW, $Form1)

    ;===============================================================================

    Case $exit

    IniWrite ( "settings.ini", "Settings", "spath", GUICtrlRead($spath) )
    IniWrite ( "settings.ini", "Settings", "dpath", GUICtrlRead($dpath) )

    Exit

    EndSwitch
    WEnd

    [/autoit]
  • Problem mit FileCopy / DirCopy

    • OneNonlyNova
    • 18. Februar 2009 um 19:09

    hab jetz so viel probiert aber weiß nicht mehr weiter hat keiner von euch ne idee? :(

  • Problem mit FileCopy / DirCopy

    • OneNonlyNova
    • 17. Februar 2009 um 21:22

    sry bin n bissle ungeduldig ( wurd letzte woche operiert und sitz jetz nur zu hause hab totale langeweile :D )

    aber hat denn keiner ne idee worans liegen könnte??

    gruß nova

  • Problem mit FileCopy / DirCopy

    • OneNonlyNova
    • 17. Februar 2009 um 15:14

    Hey Jungs also ich bin schon ganz zu frieden mit dem tool,
    wollte jetz das _MultiFileCopy durch normale DirCopy und FileCopy
    ersetzen allerdings funktioniert das nicht so wirklich wie ich das will :(

    [autoit]


    #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
    #AutoIt3Wrapper_Version=Beta
    #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
    #include <GUIConstants.au3>
    #include <MultiFileCopy.au3>
    #include <Array.au3>

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

    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("LAN Downloader - by Alexander Scherer", 849, 647, 218, 226)
    $Group1 = GUICtrlCreateGroup("LAN Downloader ", 16, 24, 825, 617)
    $spath = GUICtrlCreateInput("", 120, 48, 305, 21)
    $dpath = GUICtrlCreateInput("Zielordner", 550, 48, 250, 21)
    $Label2 = GUICtrlCreateLabel("Such Ordner:", 32, 48, 81, 20)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    $dig = GUICtrlCreateButton("DIG IT", 456, 48, 73, 25, 0)
    $Group2 = GUICtrlCreateGroup("Dateien / Ordner ", 24, 88, 809, 505)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $check_all = GUICtrlCreateButton("Check All", 40, 608, 75, 25, 0)
    $dlgoo = GUICtrlCreateButton("DL TIS SHiT", 152, 608, 75, 25, 0)
    $exit = GUICtrlCreateButton("eXiT", 728, 608, 75, 25, 0)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Label1 = GUICtrlCreateLabel("AutoIT LAN Downloader by Alexander Scherer", 560, 8, 266, 17)
    GUICtrlSetFont(-1, 8, 800, 4, "MS Sans Serif")
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    $guichecked = 0

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

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

    Case $dig

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

    ; Shows the filenames of all files in the current directory, note that "." and ".." are returned.
    $search = FileFindFirstFile( GUICtrlRead($spath) & "\*.*" )
    Dim $anzahl
    Dim $summe
    $high = 88
    $left = 40

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

    ; Check if the search was successful
    If $search = -1 Then
    MsgBox(0, "Error", "No files/directories matched the search pattern")
    Exit
    EndIf

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

    While 1
    $file = FileFindNextFile($search)
    If @error Then ExitLoop
    $summe += 1
    WEnd

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

    ; Close the search handle
    FileClose($search)

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

    $search = FileFindFirstFile( GUICtrlRead($spath) & "\*.*" )

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

    If $search = -1 Then
    MsgBox(0, "Error", "No files/directories matched the search pattern")
    Exit
    EndIf

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

    Dim $box[$summe+1]
    Dim $files[$summe+1]

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

    If $summe <> "" Then
    For $i = 1 to $summe
    GUICtrlDelete ($box[$i])
    Next
    EndIf

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

    For $i = 1 to $summe
    $file = FileFindNextFile($search)
    If @error Then ExitLoop
    ;MsgBox(4096, "File:", $file)
    $anzahl += 1
    if $anzahl > 20 Then
    $left += 232
    $high = 88
    $anzahl = 1
    ElseIf $anzahl > 40 Then
    $left = 496
    $high = 88
    EndIf
    If $anzahl > 60 Then
    MsgBox( 1, "ERROR", "Zu viele Dateien ( 60 Maximum )!")
    Exit
    EndIf
    $high = 88 + $anzahl * 24
    $box[$i] = GUICtrlCreateCheckbox($file, $left, $high, 200, 17)
    $files[$i] = GUICtrlRead($spath) & "\" & $file
    Next

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

    ; Close the search handle
    FileClose($search)

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

    Case $check_all
    if $guichecked = 0 Then
    For $i = 1 to $summe
    GUICtrlSetState( $box[$i], $GUI_CHECKED )
    $guichecked = 1
    Next
    Else
    For $i = 1 to $summe
    GUICtrlSetState( $box[$i], $GUI_UNCHECKED )
    $guichecked = 0
    Next
    EndIf

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

    Case $dlgoo

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

    Dim $aSource[$summe+1]
    Dim $f
    $f = 0

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

    For $i = 1 to $summe
    If GUICtrlRead ( $box[$i] ) = $GUI_CHECKED Then
    $f += 1
    $aSource[0] = $f
    $aSource[$i] = $files[$i]
    MsgBox(0,"",$files[$i])
    EndIf
    Next

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

    ;===Beispiel 3 (mehrere Dateien kopieren)=======================================
    ; Alle Dateien aus dem Array werden ins Zielverzeichnis kopiert
    ; Array[0] muss die Anzahl der zu kopierenden Dateien enthalten
    $sDestinationPath = GUICtrlRead($dpath) & '\'; Zielpfad (wird ggf. erstellt)
    GUISetState(@SW_HIDE, $Form1)
    ;_MultiFileCopy($aSource, $sDestinationPath, False)
    _ArrayDisplay($aSource)

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

    ;; FILE / DIR COPY

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

    Dim $isdir

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

    For $i = 1 to $summe
    $isdir = 0
    If $aSource[$i] <> "" Then
    $attrib = FileGetAttrib($aSource[$i])
    If @error Then
    MsgBox(4096,"Error", "Could not obtain file attributes.")
    Exit
    EndIf

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

    If StringInStr($attrib, "D") Then
    MsgBox(4096,"", "File is a Directory.")
    $isdir = 1
    EndIf

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

    If $isdir = 1 Then
    DirCopy($aSource[$i],$sDestinationPath)
    TrayTip ( "Copy Dir", $aSource[$i], 10 )
    Else
    FileCopy($aSource[$i],$sDestinationPath)
    TrayTip ( "Copy File", $aSource[$i], 10 )
    EndIf

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

    TrayTip ( "Finished File", $aSource[$i], 10 )

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

    EndIf

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

    Next

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

    TrayTip ( "Finished", "all Files / Dirs have been finished", 10 )

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

    For $i = 1 to $summe
    GUICtrlDelete ($box[$i])
    Next

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

    ;===============================================================================

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

    Case $exit
    Exit

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

    EndSwitch
    WEnd

    [/autoit]

    PS: ja ich weiß der code ist schlampig aber bin noch nicht so professionell im umgang mit au3 ^^ sry

    das problem müsste irgendwo hier liegen:

    [autoit]


    ;; FILE / DIR COPY

    Dim $isdir

    For $i = 1 to $summe
    $isdir = 0
    If $aSource[$i] <> "" Then
    $attrib = FileGetAttrib($aSource[$i])
    If @error Then
    MsgBox(4096,"Error", "Could not obtain file attributes.")
    Exit
    EndIf

    If StringInStr($attrib, "D") Then
    MsgBox(4096,"", "File is a Directory.")
    $isdir = 1
    EndIf

    If $isdir = 1 Then
    DirCopy($aSource[$i],$sDestinationPath)
    TrayTip ( "Copy Dir", $aSource[$i], 10 )
    Else
    FileCopy($aSource[$i],$sDestinationPath)
    TrayTip ( "Copy File", $aSource[$i], 10 )
    EndIf

    TrayTip ( "Finished File", $aSource[$i], 10 )

    EndIf

    Next


    TrayTip ( "Finished", "all Files / Dirs have been finished", 10 )

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

    gruß nova


    PPS: jetz hab ich ganz vergessen zu sagen was nicht funktioniert, also er sagt mir immer das alle "finished" wäre ^^ aber er tut gar nichts :( ( Copy bezogen, der rest funktioniert supa )

  • Farbige Progressbar mit ActiveX

    • OneNonlyNova
    • 21. Februar 2008 um 13:46

    sry das ich so blöd frage, aber welchen teil genau muss ich denn für die progress bar jetz in mein script einfügen?

    so wie ich das sehe sind das ja mehrere verschidene...

    wäre supa wenn du ne kurze erklärung für die "nicht so erfahrenen" von uns schreiben könntest

    danke mfg nova

  • Mehrdimensionales Array aus Datei und wieder hinein!?

    • OneNonlyNova
    • 15. Februar 2008 um 13:56

    So danke erstmal für den Tipp BugFix :)

    habs jetz so gelöst:

    Spoiler anzeigen


    ; Arrays leeren falls datei nicht vorhanden !


    For $i = 1 To UBound($quelle) - 1
    $groesse = InetGetSize($quelle[$i][0])
    If @error = 1 Then
    MsgBox ( 0, "Fehler", "'" & $name[$i][1] & "' wurde nicht gefunden, wird ausgelassen!")
    _Array2DInsert($quelle, $quelle[$i][0], "0")
    _Array2DInsert($quelle, $quelle[$i][1], "0")
    _Array2DInsert($name, $name[$i][1], "0")
    ElseIf $groesse = 0 Then
    MsgBox ( 0, "Fehler", "'" & $name[$i][1] & "' wurde nicht gefunden, wird ausgelassen!")
    _Array2DInsert($quelle, $quelle[$i][0], "0")
    _Array2DInsert($quelle, $quelle[$i][1], "0")
    _Array2DInsert($name, $name[$i][1], "0")
    Else

    EndIf
    Next

    ; ende vom arrays leeren

    For $i = 1 To UBound($quelle) - 1
    If $quelle[$i][0] = "0" Or $name[$i][1] = "0" Then
    $i = $i + 1
    EndIf
    $gesamt += InetGetSize($quelle[$i][0])
    Next

    For $i = 1 To UBound($quelle) - 1
    If $quelle[$i][0] = "0" Or $name[$i][1] = "0" Then
    $i = $i + 1
    EndIf
    $file_size = InetGetSize($quelle[$i][0])
    InetGet($quelle[$i][0], $quelle[$i][1], 1, 1)
    GUICtrlSetData($Group1,"'" & $name[$i][1] & "'")
    $Leer = GUICtrlCreateLabel("",24, 70, 205, 17)
    GUICtrlSetBkColor($Leer, 0x151843)
    While @InetGetActive
    ...
    ...
    ...

    aber es geht immernoch nicht... also er spuckt jetz schon aus das er 2 dateien nicht findet, aber die namen stimmen nicht... heißt quasi,
    er lässt die beiden fehlenden dateien zwar weg, behält aber die normale reihenfolge der namen bei :(

    PS: ja $name ist jetz 2d array... wobei in der zweiten immer der name steht

  • Mehrdimensionales Array aus Datei und wieder hinein!?

    • OneNonlyNova
    • 15. Februar 2008 um 01:13

    so leute, ich habs geschafft, werde das script bald auch zum download freigeben, jedoch noch ein letztes problem, und zwar hier:

    Spoiler anzeigen


    For $i = 1 To UBound($quelle) - 1
    $groesse = InetGetSize($quelle[$i][0])
    MsgBox (0,"",$groesse)
    If @error = 1 Then
    _ArrayDelete( $quelle, $quelle[$i][0])
    _ArrayDelete( $quelle, $quelle[$i][1])
    MsgBox ( 0, "Fehler:", $name & " wurde nicht gefunden, wird übersprungen!")
    _ArrayDelete( $name, $name[$i][1])
    EndIf
    Next

    er soll an dieser stelle prüfen, ob die dateien überhaupt noch exestieren, da, wenn diese nicht mehr exestieren das script abbricht, deswegen würde ich nicht exestierende files aus dem array gerne löschen, und bescheit geben.

    jedoch übergeht er diese schleife anscheinend einfach :(

  • Mehrdimensionales Array aus Datei und wieder hinein!?

    • OneNonlyNova
    • 14. Februar 2008 um 16:05

    wow danke, das hilft mir schon sehr weiter, aber hat vllt jemand auch ne einfache möglichkeit, vllt die 3 sachen zusammenzufassen? also "bezeichung(name)" + "url" + "dateiname"

    oder irgendwie das dateiname wegzulassen oda so? natürlich müsste es auch wie oben angegeben mit dem downloader zusammen passen.?!


    PS: BugFix danke für den supa tipp :)

  • Mehrdimensionales Array aus Datei und wieder hinein!?

    • OneNonlyNova
    • 14. Februar 2008 um 01:21

    Hey Leute ich habe folgendes Problem, ich möchte mit diesem GUI
    die URL und den Dateinamen in ein 2 dimensionales Array laden und in die Datei "beschreibungen.ini" speichern

    die bezeichnung soll in ein Array gespreichert werden und in die datei "names.ini"

    es soll aber so sein, dass ich beide zusammen aufrufen kann, da sie ja zusammengehören (name -> url -> dateiname)

    Hier mal mein Code, der aber leider nicht wirklich funktioniert :(


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

    #include <Array.au3>
    #include <File.au3>
    #include <GUIConstants.au3>

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

    $download_add = GUICreate("Download hinzufügen", 553, 124, 205, 192)
    $url = GUICtrlCreateInput("url", 64, 8, 425, 21)
    $bezeichnung = GUICtrlCreateInput("bezeichnung", 64, 40, 425, 21)
    $speichern = GUICtrlCreateButton("speichern", 200, 96, 145, 25, 0)
    $dateiname = GUICtrlCreateInput("dateiname", 64, 72, 425, 21)
    GUISetState(@SW_SHOW)

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

    Dim $names

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

    _FileReadToArray("names.ini", $names)

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

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

    Case $speichern

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

    $file55 = "beschreibungen.ini"
    Local $CountLines = _FileCountLines($file55)
    Local $zeile
    $csv = FileOpen($file55, 0)
    For $i = 1 To $CountLines
    $zeile = FileReadLine($csv, $i)
    If @error = -1 Then ExitLoop
    Dim $neues = 0
    $neues = $neues +1
    Next

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

    $file = "beschreibungen.ini"
    Local $CountLines = _FileCountLines($file)
    Local $zeilen1[$CountLines + 1][2]
    Local $zeile
    $zeilen1[0][0] = $CountLines
    $csv = FileOpen($file, 0)
    For $i = 1 To $CountLines
    $zeile = FileReadLine($csv, $i)
    If @error = -1 Then ExitLoop
    $zeilen1[$i][0] = $i
    $zeilen1[$i][1] = StringSplit($zeile, ",")
    MsgBox(64, "Test", "Nr(Zeile): " & $zeilen1[$i][0])
    _ArrayDisplay( $zeilen1[$i][1])
    Next
    FileClose($csv)

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

    _ArrayAdd( $names,$bezeichnung)
    _ArrayAdd( $zeilen1[$neues][0],$url)
    _ArrayAdd( $zeilen1[$neues][1],$dateiname)
    _FileWriteFromArray("beschreibungen.ini", $zeilen1)
    _FileWriteFromArray("names.ini", $names)
    MsgBox(0, "ya", "müsste gehen!")
    Exit
    EndSwitch
    WEnd

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


    brauchen tuhe ich das ganze als erweiterung für das script von trallala: Sophos-Download (Progressbar)

    ich möchte gerne das array in diesem script austauschen, so dass man über mein gui, neue downloads hinzufügen kann die von dem script geladen werden sollen... also das dieses script quasi die *.ini dateien liest und diese dann der reihe nach durchgeht


    Ich hoffe ihr könnt mir helfen

    Mit freundlichen Grüssen,

    Alexander Scherer</GUIConstants.au3></File.au3></Array.au3>

  • Sophos-Download (Progressbar)

    • OneNonlyNova
    • 13. Februar 2008 um 23:16

    hey ho sry das ich sowas altes nochmal rauskrame xD

    aba das wäre doch an sich n cooler downloader für diverse dinge, man könnte
    sowas einfügen, das man dort links einfügen kann + beschreibung, und diese
    dann in eine INI gespeichert werden. und bevor der downloader anfängt würde
    er alle einträge anzeigen und man könnte überall n harken vormachen, welche
    man downloaden will :)

    das wäre übercool...

    würd mich ja selber dransetzen aba der code ist für mich als "semi-pro" xD noch
    etwas zu komplex

  • Sleep-Zeit und Fehler in Schleife

    • OneNonlyNova
    • 7. Oktober 2007 um 02:57

    bastel gerade an sowas ähnlichem, gleiches problem, außdem ist bei mir das problem, das es ein farbbereich ist, wie kann ich das lösen?

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™