Hallo Leute,
einen Nachmittag mit AutoIt verbracht und heraus kam ein Patcher für unsere Minecraft Suchties.
Mit dem Patcher könnt ihr bequem und ohne euch strafbar zu machen Minecraft Down oder Upgraden.
Immoment sind folgende Versionen vorhanden:
Beta 1.2_01
Beta 1.2
Beta 1.1_02
Alpha 1.2.6
Im Anhang ist die .exe + icon
Code:
Code 1.0
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=..\Grafik\Icon.ico
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
; Minecraft Downgrader
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
#include <GUIListView.au3>
#include <Zip.au3>
Global $V = "1.0"
Global $LGUI, $LabelState
#Region ### START Koda GUI section ### Form=
Global $Patcher = GUICreate("Minecraft Patcher", 243, 207, -1, -1)
$Label1 = GUICtrlCreateLabel("Minecraft Patcher 1.0", 16, 8, 200, 28)
GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
$Label2 = GUICtrlCreateLabel("©Mattthias", 184, 184, 56, 17)
$Patch = GUICtrlCreateButton("Patch Minecraft", 72, 176, 91, 25, $WS_GROUP)
$PatchListView = GUICtrlCreateListView("Version|Date", 8, 48, 226, 126)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 110)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 110)
#EndRegion ### END Koda GUI section ###
Global $Update, $Patches, $Dates
_StartUp()
Global $LPatches[UBound($Patches) - 1]
_AddPatches()
GUISetState(@SW_SHOW, $Patcher)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Patch
_DownloadPatch()
EndSwitch
WEnd
Func _StartUp()
$LGUI = GUICreate("Loading Ressources", 250, 50, -1, -1, $WS_CAPTION)
$LabelState = GUICtrlCreateLabel("Checking for Updates", 15, 7, 250, 50)
GUISetState(@SW_SHOW, $LGUI)
GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
$Update = BinaryToString(InetRead("http://elitemattthias.el.funpic.de/Info/Version.txt"))
If $Update <> $V Then
MsgBox(0, "Update", "New Update avaible." & @CRLF & "Please visit us and download.")
EndIf
GUICtrlSetData($LabelState, "Checking for Patches")
$Patches = StringSplit(BinaryToString(InetRead("http://elitemattthias.el.funpic.de/Info/Patches.txt")), "#")
$Dates = StringSplit(BinaryToString(InetRead("http://elitemattthias.el.funpic.de/Info/Dates.txt")), "#")
GUICtrlSetData($LabelState, "Finished")
Sleep(500)
GUICtrlSetData($LabelState, "Finished.")
Sleep(500)
GUICtrlSetData($LabelState, "Finished..")
Sleep(500)
GUICtrlSetData($LabelState, "Finished...")
Sleep(500)
GUISetState(@SW_HIDE, $LGUI)
EndFunc ;==>_StartUp
Func _AddPatches()
For $i = 1 To UBound($Patches) - 1
$LPatches[$i - 1] = GUICtrlCreateListViewItem($Patches[$i] & "|" & $Dates[$i], $PatchListView)
Next
EndFunc ;==>_AddPatches
Func _DownloadPatch()
Local $SelectPatch = _GUICtrlListView_GetSelectedIndices($PatchListView, True)
If $SelectPatch[0] = 0 Then
MsgBox(0, "Error", "No patch selected.")
ElseIf $SelectPatch[0] > 1 Then
MsgBox(0, "Error", "Select only one patch.")
ElseIf $SelectPatch[0] = 1 Then
Local $LPatch = _GUICtrlListView_GetItemText($PatchListView, $SelectPatch[1])
__Download($LPatch)
EndIf
EndFunc ;==>_DownloadPatch
Func __Download($LPatch)
DirCreate(@ScriptDir & "\TMP")
Local $DGUI = GUICreate("Patch", 157, 47, -1, -1)
Local $DLabel = GUICtrlCreateLabel("Downloading", 8, 8, 126, 28)
GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
GUISetState(@SW_HIDE, $Patcher)
GUISetState(@SW_SHOW, $DGUI)
InetGet("http://elitemattthias.el.funpic.de/Patches/" & $LPatch & ".zip", @ScriptDir & "\TMP\TempPatch.zip")
_Zip_UnZipAll(@ScriptDir & "\TMP\TempPatch.zip", @ScriptDir & "\TMP")
DirMove(@ScriptDir & "\TMP\bin", @AppDataDir & "\.minecraft", 1)
DirRemove(@ScriptDir & "\TMP", 1)
GUICtrlSetData($DLabel, "Finish")
Sleep(500)
GUICtrlSetData($DLabel, "Finish.")
Sleep(500)
GUICtrlSetData($DLabel, "Finish..")
Sleep(500)
GUICtrlSetData($DLabel, "Finish...")
Sleep(500)
GUISetState(@SW_HIDE, $DGUI)
GUISetState(@SW_SHOW, $Patcher)
EndFunc ;==>__Download
Code 1.1
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=..\Grafik\Icon.ico
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
; Minecraft Downgrader
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
#include <GUIListView.au3>
#include <Zip.au3>
Global $V = "1.1"
Global $LGUI, $LabelState
#Region ### START Koda GUI section ### Form=
Global $Patcher = GUICreate("Minecraft Patcher", 400, 207, -1, -1)
$Label1 = GUICtrlCreateLabel("Minecraft Patcher 1.1", 85, 8, 200, 28)
GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
$Label2 = GUICtrlCreateLabel("©Mattthias",340, 184, 56, 17)
$Patch = GUICtrlCreateButton("Patch Minecraft", 163, 176, 91, 25, $WS_GROUP)
$PatchListView = GUICtrlCreateListView("Version|Date|Note", 8, 48, 380, 126)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 110)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 110)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 150)
#EndRegion ### END Koda GUI section ###
Global $Update, $Patches, $Dates, $Notes
_StartUp()
Global $LPatches[UBound($Patches) - 1]
_AddPatches()
GUISetState(@SW_SHOW, $Patcher)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Patch
_DownloadPatch()
EndSwitch
WEnd
Func _StartUp()
$LGUI = GUICreate("Loading Ressources", 250, 50, -1, -1, $WS_CAPTION)
$LabelState = GUICtrlCreateLabel("Checking for Updates", 15, 7, 250, 50)
GUISetState(@SW_SHOW, $LGUI)
GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
$Update = BinaryToString(InetRead("http://elitemattthias.el.funpic.de/Info/Version.txt"))
If $Update <> $V Then
MsgBox(0, "Update", "New Update avaible." & @CRLF & "Please visit us and download.")
EndIf
GUICtrlSetData($LabelState, "Checking for Patches")
$Patches = StringSplit(BinaryToString(InetRead("http://elitemattthias.el.funpic.de/Info/Patches.txt")), "#")
$Dates = StringSplit(BinaryToString(InetRead("http://elitemattthias.el.funpic.de/Info/Dates.txt")), "#")
$Notes = StringSplit(BinaryToString(InetRead("http://elitemattthias.el.funpic.de/Info/Notes.txt")), "#")
GUICtrlSetData($LabelState, "Finished")
Sleep(500)
GUICtrlSetData($LabelState, "Finished.")
Sleep(500)
GUICtrlSetData($LabelState, "Finished..")
Sleep(500)
GUICtrlSetData($LabelState, "Finished...")
Sleep(500)
GUISetState(@SW_HIDE, $LGUI)
EndFunc ;==>_StartUp
Func _AddPatches()
If $Patches[0] = 0 Or $Dates[0] = 0 Or $Notes[0] = 0 Then
MsgBox(0, "Error", "Fail to get Data, please restart program.")
Exit
Else
For $i = 1 To UBound($Patches) - 1
$LPatches[$i - 1] = GUICtrlCreateListViewItem($Patches[$i] & "|" & $Dates[$i] & "|" & $Notes[$i], $PatchListView)
Next
EndIf
EndFunc ;==>_AddPatches
Func _DownloadPatch()
Local $SelectPatch = _GUICtrlListView_GetSelectedIndices($PatchListView, True)
If $SelectPatch[0] = 0 Then
MsgBox(0, "Error", "No patch selected.")
ElseIf $SelectPatch[0] > 1 Then
MsgBox(0, "Error", "Select only one patch.")
ElseIf $SelectPatch[0] = 1 Then
Local $LPatch = _GUICtrlListView_GetItemText($PatchListView, $SelectPatch[1])
__Download($LPatch)
EndIf
EndFunc ;==>_DownloadPatch
Func __Download($LPatch)
DirCreate(@ScriptDir & "\TMP")
Local $DGUI = GUICreate("Patch", 157, 47, -1, -1)
Local $DLabel = GUICtrlCreateLabel("Downloading", 8, 8, 126, 28)
GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
GUISetState(@SW_HIDE, $Patcher)
GUISetState(@SW_SHOW, $DGUI)
InetGet("http://elitemattthias.el.funpic.de/Patches/" & $LPatch & ".zip", @ScriptDir & "\TMP\TempPatch.zip")
_Zip_UnZipAll(@ScriptDir & "\TMP\TempPatch.zip", @ScriptDir & "\TMP")
DirMove(@ScriptDir & "\TMP\bin", @AppDataDir & "\.minecraft", 1)
DirRemove(@ScriptDir & "\TMP", 1)
GUICtrlSetData($DLabel, "Finish")
Sleep(500)
GUICtrlSetData($DLabel, "Finish.")
Sleep(500)
GUICtrlSetData($DLabel, "Finish..")
Sleep(500)
GUICtrlSetData($DLabel, "Finish...")
Sleep(500)
GUISetState(@SW_HIDE, $DGUI)
GUISetState(@SW_SHOW, $Patcher)
EndFunc ;==>__Download
Code 1.1_02
#RequireAdmin
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=..\Grafik\Icon.ico
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
; Minecraft Downgrader
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
#include <GUIListView.au3>
#include <Zip.au3>
HttpSetUserAgent("Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6 GTB6 (.NET CLR 2.0.50727)")
Global $V = "1.1_02"
Global $LGUI, $LabelState
#Region ### START Koda GUI section ### Form=
Global $Patcher = GUICreate("Minecraft Patcher", 400, 207, -1, -1)
$Label1 = GUICtrlCreateLabel("Minecraft Patcher 1.1_02", 85, 8, 200, 28)
GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
$Label2 = GUICtrlCreateLabel("©Mattthias",340, 184, 56, 17)
$Patch = GUICtrlCreateButton("Patch Minecraft", 163, 176, 91, 25, $WS_GROUP)
$PatchListView = GUICtrlCreateListView("Version|Date|Note", 8, 48, 380, 126)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 110)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 110)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 150)
#EndRegion ### END Koda GUI section ###
Global $Update, $Patches, $Dates, $Notes
_StartUp()
Global $LPatches[UBound($Patches) - 1]
_AddPatches()
GUISetState(@SW_SHOW, $Patcher)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Patch
_DownloadPatch()
EndSwitch
WEnd
Func _StartUp()
$LGUI = GUICreate("Loading Ressources", 250, 50, -1, -1, $WS_CAPTION)
$LabelState = GUICtrlCreateLabel("Checking for Updates", 15, 7, 250, 50)
GUISetState(@SW_SHOW, $LGUI)
GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
$Update = BinaryToString(InetRead("http://mattthias.bplaced.net/Info/Version.txt"))
If $Update > $V Then
MsgBox(0, "Update", "New Update avaible." & @CRLF & "Please visit us and download.")
EndIf
GUICtrlSetData($LabelState, "Checking for Patches")
$Patches = StringSplit(BinaryToString(InetRead("http://mattthias.bplaced.net/Info/Patches.txt")), "#")
$Dates = StringSplit(BinaryToString(InetRead("http://mattthias.bplaced.net/Info/Dates.txt")), "#")
$Notes = StringSplit(BinaryToString(InetRead("http://mattthias.bplaced.net/Info/Notes.txt")), "#")
GUICtrlSetData($LabelState, "Finished")
Sleep(500)
GUICtrlSetData($LabelState, "Finished.")
Sleep(500)
GUICtrlSetData($LabelState, "Finished..")
Sleep(500)
GUICtrlSetData($LabelState, "Finished...")
Sleep(500)
GUISetState(@SW_HIDE, $LGUI)
EndFunc ;==>_StartUp
Func _AddPatches()
If $Patches[0] = 0 Or $Dates[0] = 0 Or $Notes[0] = 0 Then
MsgBox(0, "Error", "Fail to get Data, please restart program.")
Exit
Else
For $i = 1 To UBound($Patches) - 1
$LPatches[$i - 1] = GUICtrlCreateListViewItem($Patches[$i] & "|" & $Dates[$i] & "|" & $Notes[$i], $PatchListView)
Next
EndIf
EndFunc ;==>_AddPatches
Func _DownloadPatch()
Local $SelectPatch = _GUICtrlListView_GetSelectedIndices($PatchListView, True)
If $SelectPatch[0] = 0 Then
MsgBox(0, "Error", "No patch selected.")
ElseIf $SelectPatch[0] > 1 Then
MsgBox(0, "Error", "Select only one patch.")
ElseIf $SelectPatch[0] = 1 Then
Local $LPatch = _GUICtrlListView_GetItemText($PatchListView, $SelectPatch[1])
__Download($LPatch)
EndIf
EndFunc ;==>_DownloadPatch
Func __Download($LPatch)
DirCreate(@ScriptDir & "\TMP")
Local $DGUI = GUICreate("Patch", 157, 47, -1, -1)
Local $DLabel = GUICtrlCreateLabel("Downloading", 8, 8, 126, 28)
GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
GUISetState(@SW_HIDE, $Patcher)
GUISetState(@SW_SHOW, $DGUI)
InetGet("http://mattthias.bplaced.net/Patches/" & $LPatch & ".zip", @ScriptDir & "\TMP\TempPatch.zip")
_Zip_UnZipAll(@ScriptDir & "\TMP\TempPatch.zip", @ScriptDir & "\TMP")
DirMove(@ScriptDir & "\TMP\bin", @AppDataDir & "\.minecraft", 1)
DirRemove(@ScriptDir & "\TMP", 1)
GUICtrlSetData($DLabel, "Finish")
Sleep(500)
GUICtrlSetData($DLabel, "Finish.")
Sleep(500)
GUICtrlSetData($DLabel, "Finish..")
Sleep(500)
GUICtrlSetData($DLabel, "Finish...")
Sleep(500)
GUISetState(@SW_HIDE, $DGUI)
GUISetState(@SW_SHOW, $Patcher)
EndFunc ;==>__Download
Code 1.2
#RequireAdmin
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=..\Grafik\Icon.ico
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
; Minecraft Downgrader
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
#include <GUIListView.au3>
#include <Zip.au3>
HttpSetUserAgent("Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6 GTB6 (.NET CLR 2.0.50727)")
Global $V = "1.2"
Global $LGUI, $LabelState
#Region ### START Koda GUI section ### Form=
Global $Patcher = GUICreate("Minecraft Patcher", 400, 207, -1, -1)
$Label1 = GUICtrlCreateLabel("Minecraft Patcher 1.2", 85, 8, 200, 28)
GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
$Label2 = GUICtrlCreateLabel("©Mattthias", 340, 184, 56, 17)
$Patch = GUICtrlCreateButton("Patch Minecraft", 163, 176, 91, 25, $WS_GROUP)
$PatchListView = GUICtrlCreateListView("Version|Date|Note", 8, 48, 380, 126)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 110)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 110)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 150)
#EndRegion ### END Koda GUI section ###
Global $Update, $Patches, $Dates, $Notes
_StartUp()
Global $LPatches[UBound($Patches) - 1]
_AddPatches()
GUISetState(@SW_SHOW, $Patcher)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Patch
_DownloadPatch()
EndSwitch
WEnd
Func _StartUp()
$LGUI = GUICreate("Loading Ressources", 250, 50, -1, -1, $WS_CAPTION)
$LabelState = GUICtrlCreateLabel("Checking for Updates", 15, 7, 250, 50)
GUISetState(@SW_SHOW, $LGUI)
GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
$Update = BinaryToString(InetRead("http://mattthias.bplaced.net/Info/Version.txt"))
If $Update > $V Then
MsgBox(0, "Update", "New Update avaible." & @CRLF & "Please visit us and download.")
EndIf
GUICtrlSetData($LabelState, "Checking for Patches")
$Patches = StringSplit(BinaryToString(InetRead("http://mattthias.bplaced.net/Info/Patches.txt")), "#")
$Dates = StringSplit(BinaryToString(InetRead("http://mattthias.bplaced.net/Info/Dates.txt")), "#")
$Notes = StringSplit(BinaryToString(InetRead("http://mattthias.bplaced.net/Info/Notes.txt")), "#")
GUICtrlSetData($LabelState, "Finished")
Sleep(500)
GUICtrlSetData($LabelState, "Finished.")
Sleep(500)
GUICtrlSetData($LabelState, "Finished..")
Sleep(500)
GUICtrlSetData($LabelState, "Finished...")
Sleep(500)
GUISetState(@SW_HIDE, $LGUI)
EndFunc ;==>_StartUp
Func _AddPatches()
If $Patches[0] = 0 Or $Dates[0] = 0 Or $Notes[0] = 0 Then
MsgBox(0, "Error", "Fail to get Data, please restart program.")
Exit
Else
For $i = 1 To UBound($Patches) - 1
$LPatches[$i - 1] = GUICtrlCreateListViewItem($Patches[$i] & "|" & $Dates[$i] & "|" & $Notes[$i], $PatchListView)
Next
EndIf
EndFunc ;==>_AddPatches
Func _DownloadPatch()
Local $SelectPatch = _GUICtrlListView_GetSelectedIndices($PatchListView, True)
If $SelectPatch[0] = 0 Then
MsgBox(0, "Error", "No patch selected.")
ElseIf $SelectPatch[0] > 1 Then
MsgBox(0, "Error", "Select only one patch.")
ElseIf $SelectPatch[0] = 1 Then
Local $LPatch = _GUICtrlListView_GetItemText($PatchListView, $SelectPatch[1])
__Download($LPatch)
EndIf
EndFunc ;==>_DownloadPatch
Func __Download($LPatch)
DirCreate(@ScriptDir & "\TMP")
Local $DGUI = GUICreate("Patch", 326, 75, -1, -1)
Local $DLabel = GUICtrlCreateLabel("Downloading", 8, 24, 310, 28)
GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
GUISetState(@SW_HIDE, $Patcher)
GUISetState(@SW_SHOW, $DGUI)
Local $DSize = (InetGetSize("http://mattthias.bplaced.net/Patches/" & $LPatch & ".zip")) / 1024
Local $Download = InetGet("http://mattthias.bplaced.net/Patches/" & $LPatch & ".zip", @ScriptDir & "\TMP\TempPatch.zip", 3, 1)
Local $Timer = TimerInit()
Do
If TimerDiff($Timer) >= 200 Then
GUICtrlSetData($DLabel, "Downloading: " & Round(InetGetInfo($Download, 0) / 1024) & " KB / " & Round($DSize) & " KB")
$Timer = TimerInit()
EndIf
Until InetGetInfo($Download, 2) = True
GUICtrlSetData($DLabel, "Downloading: " & Round(InetGetInfo($Download, 0) / 1024) & " KB / " & Round($DSize) & " KB")
_Zip_UnZipAll(@ScriptDir & "\TMP\TempPatch.zip", @ScriptDir & "\TMP")
DirMove(@ScriptDir & "\TMP\bin", @AppDataDir & "\.minecraft", 1)
DirRemove(@ScriptDir & "\TMP", 1)
GUICtrlSetData($DLabel, "Finish")
Sleep(500)
GUICtrlSetData($DLabel, "Finish.")
Sleep(500)
GUICtrlSetData($DLabel, "Finish..")
Sleep(500)
GUICtrlSetData($DLabel, "Finish...")
Sleep(500)
GUISetState(@SW_HIDE, $DGUI)
GUISetState(@SW_SHOW, $Patcher)
EndFunc ;==>__Download
Code 1.2_01
#RequireAdmin
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=..\Grafik\Icon.ico
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
#include <GUIListView.au3>
HttpSetUserAgent("Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6 GTB6 (.NET CLR 2.0.50727)")
Global $V = "1.2_01"
Global $LGUI, $LabelState
#Region ### START Koda GUI section ### Form=
Global $Patcher = GUICreate("Minecraft Patcher", 400, 207, -1, -1)
$Label1 = GUICtrlCreateLabel("Minecraft Patcher 1.2_01", 85, 8, 250, 28)
GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
$Label2 = GUICtrlCreateLabel("©Mattthias", 340, 184, 56, 17)
$Patch = GUICtrlCreateButton("Patch Minecraft", 163, 176, 91, 25, $WS_GROUP)
$PatchListView = GUICtrlCreateListView("Version|Date|Note", 8, 48, 380, 126)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 110)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 110)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 150)
#EndRegion ### END Koda GUI section ###
Global $Update, $Patches, $Dates, $Notes
_StartUp()
Global $LPatches[UBound($Patches) - 1]
_AddPatches()
GUISetState(@SW_SHOW, $Patcher)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Patch
_DownloadPatch()
EndSwitch
WEnd
Func _StartUp()
$LGUI = GUICreate("Loading Ressources", 250, 50, -1, -1, $WS_CAPTION)
$LabelState = GUICtrlCreateLabel("Checking for Updates", 15, 7, 250, 50)
GUISetState(@SW_SHOW, $LGUI)
GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
$Update = BinaryToString(InetRead("http://mattthias.bplaced.net/Info/Version.txt"))
If $Update > $V Then
MsgBox(0, "Update", "New Update avaible." & @CRLF & "Please visit us and download version " & $Update & " .")
EndIf
GUICtrlSetData($LabelState, "Checking for Patches")
$Patches = StringSplit(BinaryToString(InetRead("http://mattthias.bplaced.net/Info/Patches.txt")), "#")
$Dates = StringSplit(BinaryToString(InetRead("http://mattthias.bplaced.net/Info/Dates.txt")), "#")
$Notes = StringSplit(BinaryToString(InetRead("http://mattthias.bplaced.net/Info/Notes.txt")), "#")
GUICtrlSetData($LabelState, "Finished")
Sleep(500)
GUICtrlSetData($LabelState, "Finished.")
Sleep(500)
GUICtrlSetData($LabelState, "Finished..")
Sleep(500)
GUICtrlSetData($LabelState, "Finished...")
Sleep(500)
GUISetState(@SW_HIDE, $LGUI)
EndFunc ;==>_StartUp
Func _AddPatches()
If $Patches[0] = 0 Or $Dates[0] = 0 Or $Notes[0] = 0 Then
MsgBox(0, "Error", "Fail to get Data, please restart program.")
Exit
Else
For $i = 1 To UBound($Patches) - 1
$LPatches[$i - 1] = GUICtrlCreateListViewItem($Patches[$i] & "|" & $Dates[$i] & "|" & $Notes[$i], $PatchListView)
Next
EndIf
EndFunc ;==>_AddPatches
Func _DownloadPatch()
Local $SelectPatch = _GUICtrlListView_GetSelectedIndices($PatchListView, True)
If $SelectPatch[0] = 0 Then
MsgBox(0, "Error", "No patch selected.")
ElseIf $SelectPatch[0] > 1 Then
MsgBox(0, "Error", "Select only one patch.")
ElseIf $SelectPatch[0] = 1 Then
Local $LPatch = _GUICtrlListView_GetItemText($PatchListView, $SelectPatch[1])
__Download($LPatch)
EndIf
EndFunc ;==>_DownloadPatch
Func __Download($LPatch)
DirCreate(@ScriptDir & "\TMP")
Local $DGUI = GUICreate("Patch", 326, 75, -1, -1, $WS_CAPTION)
Local $DLabel = GUICtrlCreateLabel("Downloading", 8, 24, 310, 28)
GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
GUISetState(@SW_HIDE, $Patcher)
GUISetState(@SW_SHOW, $DGUI)
Local $DSize = (InetGetSize("http://mattthias.bplaced.net/Patches/" & $LPatch & ".zip")) / 1024
Local $Download = InetGet("http://mattthias.bplaced.net/Patches/" & $LPatch & ".zip", @ScriptDir & "\TMP\TempPatch.zip", 3, 1)
Local $Timer = TimerInit()
Do
If TimerDiff($Timer) >= 200 Then
GUICtrlSetData($DLabel, "Downloading: " & Round(InetGetInfo($Download, 0) / 1024) & " KB / " & Round($DSize) & " KB")
$Timer = TimerInit()
EndIf
Until InetGetInfo($Download, 2) = True
GUICtrlSetData($DLabel, "Installing")
_BuildInZIP(@ScriptDir & "\TMP\TempPatch.zip", @ScriptDir & "\TMP", True)
DirMove(@ScriptDir & "\TMP\bin", @AppDataDir & "\.minecraft", 1)
DirRemove(@ScriptDir & "\TMP", 1)
GUICtrlSetData($DLabel, "Finish")
Sleep(500)
GUICtrlSetData($DLabel, "Finish.")
Sleep(500)
GUICtrlSetData($DLabel, "Finish..")
Sleep(500)
GUICtrlSetData($DLabel, "Finish...")
Sleep(500)
GUISetState(@SW_HIDE, $DGUI)
GUISetState(@SW_SHOW, $Patcher)
EndFunc ;==>__Download
;===============================================================================
; Function Name: _BuildInZIP($sPath, $s_a_ToZip, $fUnZip=True, $iIndexBase=1, $fOverwrite=True)
; Description: Erstellt aus einer Datei od. einem Array von Dateien eine ZIP-Datei
; mit Hilfe der Windows eigenen ZIP-Funktion
; Parameter(s): $sPath Pfad der zu erstellenden ZIP-Datei // Bestehenden ZIP-Datei
; $s_a_ToZip String der Einzeldatei oder Array der zu zippenden Dateien
; // Pfad des Zielordners, in den entpackt werden soll
; $fUnZip=True Entpacken=True, Packen=False (Standard)
; $iIndexBase Index Basis (erstes Element mit Pfad) des übergebenen Arrays (0 od.1)
; $fOverwrite Falls $sPath existiert ==> Überschreiben (Standard=True)
; Return Value(s): Erfolg 1
; Fehler set @error 1 - Überschreiben aus, aber Zieldatei existiert
; 2 - Zieldatei endet nicht auf ".zip"
; 3 - zu komprimierende Datei existiert nicht
; @extended: Anzahl der fehlenden Dateien
; Author(s): BugFix ([email='bugfix@autoit.de'][/email])
;===============================================================================
Func _BuildInZIP($sPath, $s_a_ToZip, $fUnZip = False, $iIndexBase = 1, $fOverwrite = True)
Local $fh, $sNul = '', $sZIPHeader, $objShell = ObjCreate("Shell.Application"), $objZipOrdner, $err = 0
$sPath = FileGetLongName($sPath, 1)
If $fUnZip Then
Local $temp, $objZip
If Not FileExists($s_a_ToZip) Then DirCreate($s_a_ToZip)
$temp = $objShell.Namespace($s_a_ToZip)
$objZip = $objShell.Namespace($sPath)
$temp.CopyHere($objZip.Items)
Return 1
EndIf
If (Not $fOverwrite) And FileExists($sPath) Then Return SetError(1, 0, 0)
If StringRight($sPath, 4) <> '.zip' Then Return SetError(2, 0, 0)
For $i = 1 To 18
$sNul &= Chr(0)
Next
$sZIPHeader = Chr(80) & Chr(75) & Chr(5) & Chr(6) & $sNul
$fh = FileOpen($sPath, 10)
FileWrite($fh, $sZIPHeader)
FileClose($fh)
$objZipOrdner = $objShell.Namespace($sPath)
If Not IsArray($s_a_ToZip) Then
If Not FileExists($s_a_ToZip) Then Return SetError(3, 1, 0)
$objZipOrdner.CopyHere($s_a_ToZip)
Sleep(1000)
Return 1
EndIf
For $i = $iIndexBase To UBound($s_a_ToZip) - 1
If Not FileExists($s_a_ToZip[$i]) Then
$err += 1
ContinueLoop
EndIf
$objZipOrdner.CopyHere($s_a_ToZip[$i])
Sleep(1000)
Next
If $err Then Return SetError(3, $err, 0)
Return 1
EndFunc ;==>_BuildInZIP
Changelog
V 1.0: First Release
V 1.1: Adding Notes
V 1.1_02: Changing FTP
V 1.2: Download"Balken" hinzugefügt
V 1.2_01: Kleines Update zum anzeigen von Versionen
So an alle die den Patcher in ElitePVPers gesehen haben (ich habe ihn dort auch in der Minecraft Section released): Ja ich bin ¿Mattthias? und der Patcher ist meine "Erfindung".
Habt ihr jetzt was ihr wollt, danke.