Dateikopieren

  • mh noch eine Frage kann man ein Array in ein listbox schicken also, die kompletten werte aus der .ini file [NoMove] and ein listelement?

    hier nochmal die letzte version mit der nomovelistgui

    Spoiler anzeigen
    [autoit]


    #include <GUIConstants.au3>
    #include<file.au3>
    ;#NoTrayIcon
    ;Variablen werden gelesen:
    $firstrun = IniRead(@ScriptDir & "\modmove.ini", "Programminfo", "firstrun", "no")
    $counterback = IniRead(@ScriptDir & "\modmove.ini", "Programminfo", "countermoveback", "0")
    $counter = IniRead(@ScriptDir & "\modmove.ini", "Programminfo", "counter", "0")
    $counterextra = IniRead(@ScriptDir & "\modmove.ini", "Programminfo", "counterextra", "0")
    $counterclear = IniRead(@ScriptDir & "\modmove.ini", "Programminfo", "counterclear", "0")
    $devmapsaveposmod = IniRead(@ScriptDir & "\modmove.ini", "Extra", "devmapsavemod", "no")
    $filepath = IniRead(@ScriptDir & "\modmove.ini", "Folder", "filepath", "notset")
    $languagefilename = "english"
    $language = IniRead(@ScriptDir & "\modmove.ini", "Programminfo", "language", "eng")
    _language()
    Dim $INIPfad = @ScriptDir & "\modmove.ini"
    Dim $QuellPfad = $filepath
    Dim $ZielPfad = $filepath & "modmove\"

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

    ;first run Anfang
    If $firstrun = "no" Then
    SplashTextOn("First Run of moDMove 4s", "Be sure that u have read moDMove.txt and change all values under options", 200, 60)
    Sleep(4000)
    SplashOff()
    IniWrite(@ScriptDir & "\modmove.ini", "Programminfo", "firstrun", "yes")
    EndIf
    ;first run Ende

    ; Gui wird erzeugt
    FileInstall("F:\Call of Duty 2\main\modmove.jpg", @TempDir & "\modmove.jpg", 1)
    FileInstall("F:\Call of Duty 2\main\modmove.ico", @TempDir & "\modmove.ico", 1)
    $gui_main = GUICreate("moDMove 3.0 by lev", 269, 200)
    GUISetState(@SW_SHOW)
    GUISetIcon(@TempDir & "\modmove.ico")
    $logo = GUICtrlCreatePic("F:\Call of Duty 2\main\modmove.jpg", 0, 0, 269, 64, -1, -1)
    $menu_options = GUICtrlCreateMenu("Options", -1, 0)
    $menu_help = GUICtrlCreateMenu("Help", -1, 0)
    $help_about = GUICtrlCreateMenuitem("About", $menu_help, 10)
    $help_stats = GUICtrlCreateMenuitem("Stats", $menu_help, 00)
    $moveembutton = GUICtrlCreateButton("Move 'Em", 5, 75, 100, 20, -1, -1)
    $moveembackbutton = GUICtrlCreateButton("Move 'Em back", 5, 110, 100, 20, -1, -1)
    $clearmainbutton = GUICtrlCreateButton("Clear mainfolder", 140, 75, 100, 20, -1, -1)
    $nomovelistbutton = GUICtrlCreateButton("NoMove-List", 140, 110, 100, 20, -1, -1)
    $nomoveshowlabel = GUICtrlCreateLabel("NoMove:", 5, 166, 62, 14, -1, -1)
    $madebylabel = GUICtrlCreateLabel("made by Leviathan", 141, 166, 113, 12, -1, -1)
    $nomovegroupcounting = GUICtrlCreateGroup("", -6, 159, 285, 31, -1, -1)
    $warnungslabel = GUICtrlCreateLabel("Be sure that u did config under options", 22, 144, 228, 14, -1, -1)
    ;gui stats:
    $gui_stats = GUICreate("Stats", 184, 177)
    GUISetState(@SW_HIDE, $gui_stats)
    GUISetIcon(@TempDir & "\modmove.ico")
    $imoveemstats = GUICtrlCreateLabel("Move 'Em:", 5, 30, 85, 14, -1, -1)
    $statsheader = GUICtrlCreateLabel("Stats:", 6, 6, 67, 14, -1, -1)
    $moveemback = GUICtrlCreateLabel("Move 'Em back:", 5, 50, 85, 14, -1, -1)
    $clearstatslabel = GUICtrlCreateLabel("Clear mainfolder:", 5, 70, 85, 14, -1, -1)
    $moveemwithjumper = GUICtrlCreateLabel("Move 'Em with jumperoption on:", 5, 90, 85, 32, -1, -1)
    $movemamountlabel = GUICtrlCreateLabel($counter, 100, 30, 40, 14, -1, -1)
    $moveembackamountlabel = GUICtrlCreateLabel($counterback, 100, 50, 40, 14, -1, -1)
    $clearmainfolderamountlabel = GUICtrlCreateLabel($counterclear, 100, 70, 40, 14, -1, -1)
    $moveemwithjoamountlabel = GUICtrlCreateLabel($counterextra, 100, 105, 40, 14, -1, -1)
    $statsinfolabel = GUICtrlCreateLabel("Gives you the amount of each operation ;-)", 16, 141, 144, 25, -1, -1)
    $statsgroup = GUICtrlCreateGroup("", 3, 22, 163, 103, -1, -1)
    ;gui stats ende
    ;gui about anfang
    $gui_about = GUICreate("About moDMove3.0", 246, 170)
    GUISetState(@SW_HIDE)
    GUISetIcon(@TempDir & "\modmove.ico")
    $aboutext1 = GUICtrlCreateLabel("moDMove 3.0 made by Leviathan NOTE: I'm not responsible for any damage caused by this programme", 8, 5, 230, 54, -1, -1)
    $abouttext2 = GUICtrlCreateLabel("Thanks to:", 8, 64, 55, 14, -1, -1)
    $aboutthanks = GUICtrlCreateLabel("bugfix; autoit.de and codjumper.com", 69, 81, 169, 29, -1, -1)
    $levwww = GUICtrlCreateLabel("www.leviathan-design.de", 20, 116, 130, 14, -1, -1)
    $autoitwww = GUICtrlCreateLabel("www.autoit.de", 20, 130, 101, 14, -1, -1)
    $cjwww = GUICtrlCreateLabel("www.codjumper.com", 20, 144, 108, 14, -1, -1)
    $grpthanks = GUICtrlCreateGroup("", 62, 68, 122, 44, -1, -1)
    $grpnote = GUICtrlCreateGroup("READ", 6, 18, 204, 46, -1, -1)
    $muhbutton = GUICtrlCreateButton("muh", 173, 141, 59, 19, -1, -1)
    ;gui about ende
    ;gui nomovelist anfang
    $gui_nomovelist = GUICreate("NoMoveList",299,263)
    GUISetState(@sw_hide)
    $add_nomovelist=GUICtrlCreateButton("Add",12,199,80,20,-1,-1)
    $remove_nomovelist=GUICtrlCreateButton("Remove",111,200,80,20,-1,-1)
    $input_nomovelist=GUICtrlCreateInput("",10,237,282,18,-1,-1)
    $list_nomovelist=GUICtrlCreateCombo("",6,6,282,191,-1,-1)
    ;gui nomovelist ende
    While 1
    $msg = GUIGetMsg(1)
    If $msg[0] = $GUI_EVENT_CLOSE And $msg[1] = $gui_main Then ExitLoop ;main gui off EXIT
    If $msg[0] = $moveembackbutton And $msg[1] = $gui_main Then _movemodsback()
    If $msg[0] = $moveembutton And $msg[1] = $gui_main Then _movemods()

    If $msg[0] = $GUI_EVENT_CLOSE And $msg[1] = $gui_stats Then GUISetState(@SW_HIDE, $gui_stats) ;stats off
    If $msg[0] = $help_stats And $msg[1] = $gui_main Then _stats() ;stats on

    If $msg[0] = $nomovelistbutton AND $msg[1] = $gui_main Then GUISetState(@SW_Show, $gui_nomovelist) ;nomovelist on
    If $msg[0] = $GUI_EVENT_CLOSE AND $msg[1] = $gui_nomovelist Then GUISetState(@SW_hide, $gui_nomovelist) ;nomovelist off

    If $msg[0] = $muhbutton And $msg[1] = $gui_about Then MsgBox(0, "", "report any bugs to [email='geil.sandra@web.de'][/email]")
    If $msg[0] = $help_about And $msg[1] = $gui_main Then GUISetState(@SW_Show, $gui_about) ;about on
    If $msg[0] = $GUI_EVENT_CLOSE And $msg[1] = $gui_about Then GUISetState(@SW_HIDE, $gui_about) ;about off
    WEnd

    ; Funktionen (eigene) ====================================================================================================================================

    ;Sprache Anfang
    Func _language()
    If $language = "eng" Then
    $languagefilename = "english"
    _cod2fileslanguageset()
    Else
    If $language = "ger" Then
    $languagefilename = "german"
    _cod2fileslanguageset()
    Else
    Exit
    EndIf
    EndIf
    EndFunc ;==>_language
    Func _cod2fileslanguageset()
    IniWrite(@ScriptDir & "\modmove.ini", "NoMove", "wert1", "localized_" & $languagefilename & "_iw00.iwd")
    IniWrite(@ScriptDir & "\modmove.ini", "NoMove", "wert2", "localized_" & $languagefilename & "_iw01.iwd")
    IniWrite(@ScriptDir & "\modmove.ini", "NoMove", "wert3", "localized_" & $languagefilename & "_iw02.iwd")
    IniWrite(@ScriptDir & "\modmove.ini", "NoMove", "wert4", "localized_" & $languagefilename & "_iw03.iwd")
    IniWrite(@ScriptDir & "\modmove.ini", "NoMove", "wert5", "localized_" & $languagefilename & "_iw04.iwd")
    IniWrite(@ScriptDir & "\modmove.ini", "NoMove", "wert6", "localized_" & $languagefilename & "_iw05.iwd")
    IniWrite(@ScriptDir & "\modmove.ini", "NoMove", "wert7", "localized_" & $languagefilename & "_iw06.iwd")
    IniWrite(@ScriptDir & "\modmove.ini", "NoMove", "wert8", "localized_" & $languagefilename & "_iw07.iwd")
    IniWrite(@ScriptDir & "\modmove.ini", "NoMove", "wert9", "localized_" & $languagefilename & "_iw08.iwd")
    IniWrite(@ScriptDir & "\modmove.ini", "NoMove", "wert10", "localized_" & $languagefilename & "_iw09.iwd")
    IniWrite(@ScriptDir & "\modmove.ini", "NoMove", "wert11", "localized_" & $languagefilename & "_iw10.iwd")
    IniWrite(@ScriptDir & "\modmove.ini", "NoMove", "wert12", "localized_" & $languagefilename & "_iw11.iwd")
    EndFunc ;==>_cod2fileslanguageset
    ; Sprache Ende
    ; Moveback Anfang
    Func _movemodsback()
    FileMove($ZielPfad & "*.iwd", $QuellPfad, 1)
    $icounterback = $counterback + 1
    IniWrite(@ScriptDir & "\modmove.ini", "Programminfo", "countermoveback", $icounterback)
    EndFunc ;==>_movemodsback
    ; Moveback Ende
    ; Move Anfang
    Func _movemods()
    $arNoMove = IniReadSection($INIPfad, "NoMove")
    $AllModFiles = _FileListToArray($QuellPfad, "*.iwd")
    For $i = 1 To $AllModFiles[0]
    For $k = 1 To $arNoMove[0][0]
    ; Dateien markieren, die nicht verschoben werden sollen
    If $AllModFiles[$i] = $arNoMove[$k][1] Then $AllModFiles[$i] &= "|"
    Next
    Next
    For $i = 1 To $AllModFiles[0]
    ; nicht markierte Dateien verschieben
    If StringRight($AllModFiles[$i], 1) <> "|" Then FileMove($QuellPfad & $AllModFiles[$i], $ZielPfad)
    Next
    ;counter
    Select
    Case $devmapsaveposmod = "yes"
    FileMove($filepath & "modmove\zzz_Save_position_mod_V1.0.iwd", $filepath)
    FileMove($filepath & "modmove\zzz_999_nades.iwd", $filepath)
    $iextra = $counterextra + 1
    IniWrite(@ScriptDir & "\modmove.ini", "Programminfo", "counterextra", $iextra)
    Case Else
    ;counting the amount of movements
    $icounter = $counter + 1
    IniWrite(@ScriptDir & "\modmove.ini", "Programminfo", "counter", $icounter)
    EndSelect
    EndFunc ;==>_movemods
    ;Move Ende

    ;Clear Anfang
    Func _clear()
    $arNoMove = IniReadSection($INIPfad, "NoMove")
    $AllModFiles = _FileListToArray($QuellPfad, "*.iwd")
    For $i = 1 To $AllModFiles[0]
    For $k = 1 To $arNoMove[0][0]
    ; Dateien markieren, die nicht verschoben werden sollen
    If $AllModFiles[$i] = $arNoMove[$k][1] Then $AllModFiles[$i] &= "|"
    Next
    Next
    For $i = 1 To $AllModFiles[0]
    ; nicht markierte Dateien verschieben
    If StringRight($AllModFiles[$i], 1) <> "|" Then FileDelete($QuellPfad & $AllModFiles[$i])
    Next
    $counterclear = IniRead(@ScriptDir & "\modmove.ini", "Programminfo", "counterclear", "0")
    $i = $counterclear + 1
    IniWrite(@ScriptDir & "\modmove.ini", "Programminfo", "counterclear", $i)
    EndFunc
    ;Clear Ende

    ; Stats Anfang
    Func _stats()
    ;Hier werden die jeweilige Anzahl aus der ini-file geladen:
    $counterback = IniRead(@ScriptDir & "\modmove.ini", "Programminfo", "countermoveback", "0")
    $counter = IniRead(@ScriptDir & "\modmove.ini", "Programminfo", "counter", "0")
    $counterextra = IniRead(@ScriptDir & "\modmove.ini", "Programminfo", "counterextra", "0")
    $counterclear = IniRead(@ScriptDir & "\modmove.ini", "Programminfo", "counterclear", "0")
    GUISetState(@SW_SHOW, $gui_stats)
    EndFunc ;==>_stats
    ; Stats Ende

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

    ; nomovelist Anfag
    Func _nomovelist()
    $werteanzahl = IniReadSection($INIPfad, "NoMove")
    $lastwertnumber = $werteanzahl[0][0]
    MsgBox(64,"Anzahl", $lastwertnumber)
    EndFunc
    ;nomovelist Ende

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

    Einmal editiert, zuletzt von leviathan (7. Januar 2007 um 21:12)

  • hab noch ein Problem und zwar wollt ich für die eigene einstellbaren mods (iwds) eine eigene Sektion in der ini machen und die auch so auslesen wie bugfix das gemacht hat und mi | markieren damit es nicht verschoben wird nur bekomm ich andauernt einen fehler mit variable und subscript 8|

    die NoMoveCustom und AllCustomModfiles icustom und kcustom sind neue vars

    [autoit]


    $arNoMoveCustom = IniReadSection(@Scriptdir & "\modmove.ini", "NoMoveCustom")
    $AllCustomModFiles = _FileListToArray($QuellPfad, "*.iwd")
    $arNoMove = IniReadSection($INIPfad, "NoMove")
    $AllModFiles = _FileListToArray($QuellPfad, "*.iwd")
    For $icustom = 1 To $AllCustomModFiles[0]
    For $kcustom = 1 To $arNoMoveCustom[0][0]
    ;Custom Dateien markieren, die nicht verschoben werden sollen
    If $AllCustomModFiles[$icustom] = $arNoMoveCustom[$kcustom][1] Then $AllCustomModFiles[$icustom] &= "|"
    Next
    Next
    For $i = 1 To $AllModFiles[0]
    For $k = 1 To $arNoMove[0][0]
    ; Dateien markieren, die nicht verschoben werden sollen
    If $AllModFiles[$i] = $arNoMove[$k][1] Then $AllModFiles[$i] &= "|"
    Next
    Next
    For $i = 1 To $AllModFiles[0]
    ; nicht markierte Dateien verschieben
    If StringRight($AllModFiles[$i], 1) <> "|" OR StringRight($AllCustomModFiles[$icustom], 1) <> "|" Then FileMove($QuellPfad & $AllModFiles[$i], $ZielPfad) AND FileMove($QuellPfad & $AllCustomModFiles[$icustom], $ZielPfad)
    Next
    ;counter
    Select
    Case $devmapsaveposmod = "yes"
    FileMove($filepath & "modmove\zzz_Save_position_mod_V1.0.iwd", $filepath)
    FileMove($filepath & "modmove\zzz_999_nades.iwd", $filepath)
    $iextra = $counterextra + 1
    IniWrite(@ScriptDir & "\modmove.ini", "Programminfo", "counterextra", $iextra)
    Case Else
    ;counting the amount of movements
    $icounter = $counter + 1
    IniWrite(@ScriptDir & "\modmove.ini", "Programminfo", "counter", $icounter)
    EndSelect

    [/autoit]

    also irgendwas passt da nicht ich bekomm immer den fehler dann Array Variable has incorrect number of subscripts or subscript dimension range exceeded

    auch hier:

    [autoit]


    Func _nomovelist()
    $werteanzahl = IniReadSection($INIPfad, "NoMoveCustom")
    $lastwertnumber = $werteanzahl[0][0]
    ;MsgBox(64,"Anzahl", $lastwertnumber)
    $arNoMoveCustom = IniReadSection(@Scriptdir & "\modmove.ini", "NoMoveCustom")
    For $i = 1 To $werteanzahl[0][0]
    _ArraySort($arNoMoveCustom)
    Next
    EndFunc ;==>_nomovelist

    [/autoit]

    Einmal editiert, zuletzt von leviathan (8. Januar 2007 um 20:33)

    • Offizieller Beitrag
    [autoit]

    $AllCustomModFiles = _FileListToArray($QuellPfad, "*.iwd")
    ; identisch mit:
    $AllModFiles = _FileListToArray($QuellPfad, "*.iwd")

    [/autoit]


    Ist das Absicht?

    [autoit]

    For $icustom = 1 To $AllCustomModFiles[0]
    For $kcustom = 1 To $arNoMoveCustom[0][0]

    [/autoit]


    Macht den Code etwas unübersichtlich, verwende lieber $i , $k usw. für einfache Zählvariablen.

    EDIT:
    nochwas entdeckt:

    [autoit]

    For $i = 1 To $AllModFiles[0]
    ; nicht markierte Dateien verschieben
    If StringRight($AllModFiles[$i], 1) <> "|" OR StringRight($AllCustomModFiles[$icustom], 1) <> "|" Then FileMove($QuellPfad & $AllModFiles[$i], $ZielPfad) AND FileMove($QuellPfad & $AllCustomModFiles[$icustom], $ZielPfad)
    Next

    [/autoit]

    geht nicht

    ich denke, du meinst sowas:

    [autoit]

    For $i = 1 To $AllModFiles[0]
    ; nicht markierte Dateien verschieben
    If StringRight($AllModFiles[$i], 1) <> "|" Then
    FileMove($QuellPfad & $AllModFiles[$i], $ZielPfad)
    ElseIf StringRight($AllCustomModFiles[$icustom], 1) <> "|" Then
    FileMove($QuellPfad & $AllCustomModFiles[$icustom], $ZielPfad)
    EndIf
    Next

    [/autoit]
  • nein wie oben beschrieben wollte ich die selbe methode anwenden und die festen gamefiles die nicht verschoben werden sollen in die NoMove Sektion der ini und wo man selber eigene Eintragen kann in NoMoveCustom aber ich weiß nicht wie ich das zusammenfügen kann und bei sortarray stand dort für 1-2 dim felder

    mit dem sortarray wollt ich eigentlich, dass er wenn neue eigene dateinamen eingetragen wurden oder gelöscht werden wieder mit wert1-wertn geordnet werden und halt in dieser listbox wie oben gefragt ausgegeben werden sollen

    Einmal editiert, zuletzt von leviathan (8. Januar 2007 um 21:57)

    • Offizieller Beitrag

    Ja, stimmt,. Mit _ArraySort( ) war ich auf dem falschen Dampfer - sorry. Werde wohl doch langsam senil :rofl:

    Das andere schau ich mir nochmal an. Für schnelle Zwischenfragen, wärs nicht schlecht, falls du per Messsenger erreichbar wärst. Falls ja kannst du mich ja anklingeln. Steht alles in meinem Profil

    • Offizieller Beitrag
    [autoit]

    $arNoMoveCustom = IniReadSection(@Scriptdir & "\modmove.ini", "NoMoveCustom")
    $arNoMove = IniReadSection($INIPfad, "NoMove")

    [/autoit]

    Wenn ich das richtig verstehe, beziehst du dich auf dieselbe INI. Dann verwende besser auch gleichen Code:

    [autoit]

    $arNoMoveCustom = IniReadSection($INIPfad, "NoMoveCustom")
    $arNoMove = IniReadSection($INIPfad, "NoMove")

    [/autoit]


    Und wenn

    [autoit]

    $AllCustomModFiles = _FileListToArray($QuellPfad, "*.iwd")
    ; ==
    $AllModFiles = _FileListToArray($QuellPfad, "*.iwd")

    [/autoit]


    dann verwende besser nur "$AllModFiles", das ist eindeutig und erspart dir eine Variable.


    EDIT:
    So, habs mal geändert und vereinfacht:

    Spoiler anzeigen
    [autoit]


    $arNoMoveCustom = IniReadSection(@Scriptdir & "\modmove.ini", "NoMoveCustom")
    ;~ $arNoMoveCustom = IniReadSection($INIPfad, "NoMoveCustom") falls dieselbe INI, dieses hier
    $arNoMove = IniReadSection($INIPfad, "NoMove")
    ;~ $AllCustomModFiles = _FileListToArray($QuellPfad, "*.iwd") weglassen, spart 'ne Menge Code
    $AllModFiles = _FileListToArray($QuellPfad, "*.iwd")
    For $i = 1 To $AllModFiles[0]
    For $k = 1 To $arNoMoveCustom[0][0]
    ;Custom Dateien markieren, die nicht verschoben werden sollen
    If $AllModFiles[$i] = $arNoMoveCustom[$k][1] Then $AllModFiles[$i] &= "|"
    Next
    For $k = 1 To $arNoMove[0][0]
    ; Dateien markieren, die nicht verschoben werden sollen
    If $AllModFiles[$i] = $arNoMove[$k][1] Then $AllModFiles[$i] &= "|"
    Next
    Next
    For $i = 1 To $AllModFiles[0]
    ; nicht markierte Dateien verschieben
    If StringRight($AllModFiles[$i], 1) <> "|" Then FileMove($QuellPfad & $AllModFiles[$i], $ZielPfad)
    Next
    ;counter
    Select
    Case $devmapsaveposmod = "yes"
    FileMove($filepath & "modmove\zzz_Save_position_mod_V1.0.iwd", $filepath)
    FileMove($filepath & "modmove\zzz_999_nades.iwd", $filepath)
    $iextra = $counterextra + 1
    IniWrite(@ScriptDir & "\modmove.ini", "Programminfo", "counterextra", $iextra)
    Case Else
    ;counting the amount of movements
    $icounter = $counter + 1
    IniWrite(@ScriptDir & "\modmove.ini", "Programminfo", "counter", $icounter)
    EndSelect

    [/autoit]


    Nun noch zu deiner "Func _nomovelist()".
    Ist

    [autoit]

    $werteanzahl = IniReadSection($INIPfad, "NoMoveCustom")

    [/autoit]

    nicht dieselbe Sektion derselben INI, wie hier:

    [autoit]

    $arNoMoveCustom = IniReadSection(@Scriptdir & "\modmove.ini", "NoMoveCustom")

    [/autoit]

    ?
    Und das Sortieren brauchst du nur einmal ausführen, nicht in einer Schleife. Somit wird die ganze Funktion hinfällig. Du solltest aber angeben, welche Dimension du sortieren möchtest.

    So, ich denke das wars erst mal.