Hi, ich hab ein Programm erstellt, was mir minecraft Up- und Downgraded... das Problem dabei liegt bei einem _FTP_ProgressDownload und ich weiss nich was da falsch ist =(. Hab die Stelle markiert
Spoiler anzeigen
#RequireAdmin
[/autoit] [autoit][/autoit] [autoit]#include <GUIConstants.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include <FTPEx.au3>
#include <File.au3>
#include <Array.au3>
#include <ArrayMore.au3>
Global $Percent, $Combo, $CheckboxRepair, $Open, $Connect, $Versions, $Version, $State, $FileSize, $FileList, $FileCounter
$Percent = 0
MsgBox(0, "Minecraft Downgrader by xXKingLoLXx", "WICHTIG!" &@CRLF &"Minecraft muss geschlossen sein, bevor Sie ein Up- und Downgrade ausführen!")
[/autoit] [autoit][/autoit] [autoit]#Region ### START Koda GUI section ### Form=C:\Users\Louis\Desktop\Eigene Programme\Minecraft-Downgrader.kxf
$Main = GUICreate("Minecraft Downgrader by xXKingLoLXx", 498, 377, 292, 138)
$Screenshot = GUICtrlCreatePic("", 8, 8, 480, 255, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$Progress = GUICtrlCreateProgress(8, 272, 481, 25)
$Homepage = GUICtrlCreateLabel("http://www.island-minecraft.de.tl/", 8, 356, 163, 17)
GUICtrlSetColor(-1, 0x0000FF)
$Copyright = GUICtrlCreateLabel("Copyright (c) by Island-Minecraft", 336, 356, 155, 17)
$State = GUICtrlCreateLabel("Verbinde mit Download-Server...", 8, 308, 400)
$Combo = GUICtrlCreateCombo("Version wählen...", 8, 328, 105, 25)
$Start = GUICtrlCreateButton("Start", 384, 328, 105, 25, 0)
$CheckboxRepair = GUICtrlCreateCheckbox("Minecraft Reparieren", 120, 328, 121, 21)
GUICtrlSetState($Start, $GUI_DISABLE)
GUICtrlSetState($Combo, $GUI_DISABLE)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$Open = _FTP_Open("Island-Minecraft")
$Connect = _FTP_Connect($Open, "*******", "*******", "*******")
GUICtrlSetData($State, "0% - Downloade Top-Screenshot...")
_FTP_ProgressDownload($Connect, @TempDir &"\Screenshot.bmp", "Screenshot.bmp", "_Screenshot")
GUICtrlSetImage($Screenshot, @TempDir &"\Screenshot.bmp")
_FTP_DirSetCurrent($Connect,"/minecraft/")
GUICtrlSetData($State, "Prüfe verfügbare Versionen...")
$Versions = _Ftp_ListToArray($Connect, 2)
$ComboList = _ArrayToString($Versions, "|", 1)
$ComboList = StringReplace($ComboList, "minecraft-", "")
$ComboList = StringReplace($ComboList, ".jar", "")
GUICtrlSetData($Combo, $ComboList)
GUICtrlSetData($State, "Fertig...")
GUICtrlSetState($Start, $GUI_ENABLE)
GUICtrlSetState($Combo, $GUI_ENABLE)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Homepage
ShellExecute("http://www.island-minecraft.de.tl/")
Case $Start
GUICtrlSetState($Start, $GUI_DISABLE)
GUICtrlSetState($Combo, $GUI_DISABLE)
$Version = GUICtrlRead($Combo)
If $Version <> "Version wählen..." Then
If GUICtrlRead($CheckboxRepair) = $GUI_CHECKED Then
GUICtrlSetData($State, "Erstelle Filelist...")
_FTP_DirSetCurrent($Connect,"/bin/")
$FileList = _Ftp_ListToArray($Connect, 2)
$FileSize = 0
For $i = 1 to $FileList[0]
$FileSize = $FileSize + _FTP_FileGetSize($Connect, "/bin/" &$FileList[$i])
$FileList[$i] = "bin/" &$FileList[$i]
Next
_FTP_DirSetCurrent($Connect, "/bin/natives/")
$FileListRec = _Ftp_ListToArray($Connect, 2)
For $i = 1 to $FileListRec[0]
$FileSize = $FileSize + _FTP_FileGetSize($Connect, "/bin/natives/" &$FileListRec[$i])
$FileListRec[$i] = "bin/natives/" &$FileListRec[$i]
Next
_ArrayConcatenate($FileList, $FileListRec, 1)
$FileList[0] = $FileList[0] + $FileListRec[0]
_FTP_DirSetCurrent($Connect, "/")
GUICtrlSetData($State, "0% - Downloade Datei 1 von " &$FileList[0])
For $i = 1 To $FileList[0]
$FileCounter = $i
_FTP_ProgressDownload($Connect, @AppDataDir &"\.minecraft" &$FileList[$i], $FileList[$i], "_MinecraftRepair") ;Hier muss der Fehler sein!
Next
GUICtrlSetData($State, "0% - Downloade Minecraft Version " &$Version)
_FTP_ProgressDownload($Connect, @AppDataDir &"\.minecraft\bin\minecraft.jar", "minecraft-" &$Version &".jar", "_MinecraftVersion")
GUICtrlSetData($State, "Fertig...")
MsgBox(0, "Minecraft Downgrader by xXKingLoLXx", "Minecraft wurde repariert und die gewünschte Version wurde erfolgreich installiert.")
Else
GUICtrlSetData($State, "0% - Downloade Minecraft Version " &$Version)
_FTP_ProgressDownload($Connect, @AppDataDir &"\.minecraft\bin\minecraft.jar", "minecraft-" &$Version &".jar", "_MinecraftVersion")
GUICtrlSetData($State, "Fertig...")
MsgBox(0, "Minecraft Downgrader by xXKingLoLXx", "Ihre gewünschte Minecraft Version wurde erfolgreich installiert.")
EndIf
Else
MsgBox(0, "Minecraft Downgrader by xXKingLoLXx", "Bitte wählen Sie eine Minecraft Version.")
EndIf
GUICtrlSetState($Start, $GUI_ENABLE)
GUICtrlSetState($Combo, $GUI_ENABLE)
EndSwitch
WEnd
Func _Screenshot($Percent)
GUICtrlSetData($State, $Percent &"% - Downloade Top-Screenshot...")
GUICtrlSetData($Progress, $Percent)
Return 1
EndFunc
Func _MinecraftVersion($Percent)
GUICtrlSetData($State, $Percent &"% - Downloade Minecraft Version " &$Version)
GUICtrlSetData($Progress, $Percent)
Return 1
EndFunc
Func _MinecraftRepair($Percent)
$CurrencSize = ($Percent / 100) * _FTP_FileGetSize($Connect, $FileList[$FileCounter])
$Percent = $CurrencSize / ($FileSize / 100)
GUICtrlSetData($Progress, $Percent)
GUICtrlSetData($State, $Percent &"% - Downloade Datei " &$FileCounter " von " &$FileList[0])
Return 1
EndFunc
EDIT: Bei mir kommt keine Fehlermeldung oder ein Error! Direkt nach ausführen des markierten downloads schließt sich das Programm "normal", also ohne error code und @error konnte ich deshalb ja auch nich rausfinden...