Eine Art Patcher

  • das kann irgentwie nocht sein, ich habs getestet funktioniert ohne passworteingabe -.-
    evtl kann es auch sein das es stattdessen connectiont time out gibt, der server ist extrem langsam, leider...
    Edit1:
    wenn ich mich korregieren darf: ich muss dich korregieren (wenn dich darf xD)
    du ahst einen kleinen fehler eingebaut, der "\" bei inetget in den () ist zu viel, des weiteren muss die list.txt natürlich immer gedownloadet werden, ist sonst ja unsinn ^^ danach lässt man sie am besten löschen und außerdem war da noch ein fehler, der patcher soll die datei ja da speicern wo er ist und nicht in den temp dateien^^ so das wars... kannst ja sehen was ich verändert habe!
    hier nochmal das script zum mitlesen und für faule als anhang: :rofl:

    Spoiler anzeigen
    [autoit]

    InetGet("http://mmorpgaming.pytalhost.com/autoit/list.txt", @ScriptDir & ".\list.txt")
    #include <file.au3>
    #include <GUIConstantsEx.au3>
    #include <ProgressConstants.au3>
    Opt('MustDeclareVars', 1)
    Local $label1, $label2, $progressbar1, $progressbar2, $button, $wait, $s, $msg, $m, $afile, $aData
    Local $iSize, $iCount, $iBytesDone, $iFilesDone, $iPercent, $iDown
    GUICreate("Updater", 220, 140)
    $label1 = GUICtrlCreateLabel("Dateien", 10, 8, 200, 16)
    $progressbar1 = GUICtrlCreateProgress(10, 25, 200, 20)
    GUICtrlSetColor(-1, 32250); not working with Windows XP Style
    $label2 = GUICtrlCreateLabel("Bytes", 10, 58, 200, 16)
    $progressbar2 = GUICtrlCreateProgress(10, 75, 200, 20, $PBS_SMOOTH)
    $button = GUICtrlCreateButton("Beenden", 75, 115, 70, 20)
    GUISetState()
    If InetGet("http://mmorpgaming.pytalhost.com/autoit/list.txt", @ScriptDir & "\list.txt", 1) > 0 Then
    If _FileReadToArray(@ScriptDir & ".\" & "list.txt", $afile) Then
    ;Schleife für Gesamtgröße und Anzahl der Files
    For $i = 1 To $afile[0]
    If Not FileExists(@ScriptDir & "\" & $afile[$i]) Then
    $iSize += InetGetSize("http://mmorpgaming.pytalhost.com/autoit/" & $afile[$i], 1)
    $iCount += 1
    EndIf
    Next
    GUICtrlSetData($label1, "0/" & $iCount & " Dateien")
    For $i = 1 To $afile[0]
    If Not FileExists(@ScriptDir & "\" & $afile[$i]) Then
    $iDown = InetGet("http://mmorpgaming.pytalhost.com/autoit/" & $afile[$i], @ScriptDir & ".\" & $afile[$i], 1)
    $iFilesDone += 1
    $iPercent = $iFilesDone / $iCount * 100
    GUICtrlSetData($progressbar1, $iPercent)
    GUICtrlSetData($label1, $iFilesDone & "/" & $iCount & " Dateien")
    $iBytesDone += $iDown
    $iPercent = $iBytesDone / $iSize * 100
    GUICtrlSetData($progressbar2, $iPercent)
    GUICtrlSetData($label2, $iBytesDone & "/" & $iSize & " Bytes")
    EndIf
    Next
    EndIf
    Else
    MsgBox(16, "Fehler", "Updateliste nicht gefunden!")
    EndIf
    Do
    $msg = GUIGetMsg()
    Until $msg = $GUI_EVENT_CLOSE or $msg = $button
    FileDelete("./list.txt")

    [/autoit]
  • noch was neues:
    so wie ich vorhin den patcher geschickt habe, funkitonert er wunderbar, allerdings funkitoniert dieser hier nocht mehr:

    Spoiler anzeigen
    [autoit]

    #include <file.au3>
    #include <GUIConstantsEx.au3>
    #include <ProgressConstants.au3>
    Opt('MustDeclareVars', 1)
    Local $label1, $label2, $progressbar1, $progressbar2, $button, $wait, $s, $msg, $m, $afile, $aData
    Local $iSize, $iCount, $iBytesDone, $iFilesDone, $iPercent, $iDown, $size, $sizeonline
    GUICreate("Updater", 220, 140)
    $label1 = GUICtrlCreateLabel("Dateien", 10, 8, 200, 16)
    $progressbar1 = GUICtrlCreateProgress(10, 25, 200, 20)
    GUICtrlSetColor(-1, 32250); not working with Windows XP Style
    $label2 = GUICtrlCreateLabel("Bytes", 10, 58, 200, 16)
    $progressbar2 = GUICtrlCreateProgress(10, 75, 200, 20, $PBS_SMOOTH)
    $button = GUICtrlCreateButton("Beenden", 75, 115, 70, 20)
    GUISetState()
    If InetGet("http://mmorpgaming.pytalhost.com/autoit/list.txt", @ScriptDir & "\list.txt", 1) > 0 Then
    If _FileReadToArray(@ScriptDir & ".\" & "list.txt", $afile) Then
    ; Schleife für Gesamtgröße und Anzahl der Files
    For $i = 1 To $afile[0]
    $size = FileGetSize(@ScriptDir & "\" & $afile[$i])
    $sizeonline = InetGetSize("http://mmorpgaming.pytalhost.com/download/" & $afile[$i],8)
    If Not FileExists(@ScriptDir & "\" & $afile[$i]) or $size <> $sizeonline Then
    $iSize += InetGetSize("http://mmorpgaming.pytalhost.com/autoit/" & $afile[$i],8)
    $iCount += 1
    EndIf
    Next
    GUICtrlSetData($label1, "0/" & $iCount & " Dateien")
    For $i = 1 To $afile[0]
    $size = FileGetSize(@ScriptDir & "\" & $afile[$i])
    $sizeonline = InetGetSize("http://mmorpgaming.pytalhost.com/download/" & $afile[$i],8)
    If Not FileExists(@ScriptDir & "\" & $afile[$i]) or $size <> $sizeonline Then
    $iDown = InetGet("http://mmorpgaming.pytalhost.com/autoit/" & $afile[$i], @ScriptDir & ".\" & $afile[$i], 1)
    $iFilesDone += 1
    $iPercent = $iFilesDone / $iCount * 100
    GUICtrlSetData($progressbar1, $iPercent)
    GUICtrlSetData($label1, $iFilesDone & "/" & $iCount & " Dateien")
    $iBytesDone += $iDown
    $iPercent = $iBytesDone / $iSize * 100
    GUICtrlSetData($progressbar2, $iPercent)
    GUICtrlSetData($label2, $iBytesDone & "/" & $iSize & " Bytes")
    EndIf
    Next
    EndIf
    Else
    MsgBox(16, "Fehler", "Updateliste nicht gefunden!")
    EndIf
    Do
    $msg = GUIGetMsg()
    Until $msg = $GUI_EVENT_CLOSE or $msg = $button
    FileDelete("\list.txt")

    [/autoit]


    Ich wollte einbauen, dass auch gepatcht wird, wenn die datenmenge sich verändert hat (habe ich in dem patcher davor schon, allerdings hat der ja nicht diese wunderschönen anzeigen ;))
    hier las vergleich mal der ohne die schönen balken: :(

    Spoiler anzeigen
    [autoit]

    InetGet("http://mmorpgaming.pytalhost.com/download/list.txt", ".\list.txt")
    #include <file.au3>
    Global $afile
    If _FileReadToArray(@ScriptDir & ".\" & "list.txt",$afile) Then
    For $i = 1 To $afile[0]
    If Not FileExists(@ScriptDir & "\" & $afile[$i]) Then
    InetGet("http://mmorpgaming.pytalhost.com/download/" & $afile[$i],@ScriptDir & "\" & $afile[$i],1,1)
    EndIf
    $size = FileGetSize(@ScriptDir & "\" & $afile[$i])
    $sizeonline = InetGetSize("http://mmorpgaming.pytalhost.com/download/" & $afile[$i],8)
    If $size <> $sizeonline Then
    InetGet("http://mmorpgaming.pytalhost.com/download/" & $afile[$i],@ScriptDir & "\" & $afile[$i],1,1)
    EndIf
    Next
    EndIf

    [/autoit]


    der funktionert schon perfekt, außer das er nicht wartet und das der schöne balken nicht da ist :(
    da ist wohl noch verbesserungsbedarf xD

  • Hallo black_skorbi,

    Zitat von black_skorbi

    du ahst einen kleinen fehler eingebaut, der "\" bei inetget in den () ist zu viel, des weiteren muss die list.txt natürlich immer gedownloadet werden, ist sonst ja unsinn ^^ danach lässt man sie am besten löschen

    ich habe jetzt extra das Skript von meinem Post heruntergeladen, über Replace die Pfade (vom Server) angepasst, es lief sofort. Die list.txt wurde immer als 1. heruntergeladen, damit man weis was herunter zu laden ist.

    Zitat von black_skorbi

    und außerdem war da noch ein fehler, der patcher soll die datei ja da speicern wo er ist und nicht in den temp dateien

    mein Skript speichert in @Scriptdir, aber Pfade kannst du ja anpassen
    Zu beiden: ich kann in deinem Skript keine Änderungen feststellen, ausser die unnötige Zeile 1 und die Punkte in der Pfadangabe.

    hier eine erweiterte Version, mit Überprüfen des Datums:

    Spoiler anzeigen
    [autoit]

    #include <file.au3>
    #include <GUIConstantsEx.au3>
    #include <ProgressConstants.au3>

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

    Opt('MustDeclareVars', 1)

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

    Local $label1, $label2, $progressbar1, $progressbar2, $button, $wait, $s, $msg, $m, $afile, $aData
    Local $iSize, $iCount, $iBytesDone, $iFilesDone, $iPercent, $iDown, $bLoadIt

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

    GUICreate("Updater", 220, 140, 100, 200)
    $label1 = GUICtrlCreateLabel("Dateien", 10, 8, 200, 16)
    $progressbar1 = GUICtrlCreateProgress(10, 25, 200, 20)
    GUICtrlSetColor(-1, 32250); not working with Windows XP Style
    $label2 = GUICtrlCreateLabel("Bytes", 10, 58, 200, 16)
    $progressbar2 = GUICtrlCreateProgress(10, 75, 200, 20, $PBS_SMOOTH)
    $button = GUICtrlCreateButton("Be&enden", 75, 115, 70, 20)
    GUISetState()
    If InetGet("http://mmorpgaming.pytalhost.com/autoit/list.txt", @ScriptDir & "\list.txt", 1) > 0 Then
    If _FileReadToArray(@ScriptDir & ".\" & "list.txt", $afile) Then
    ;Schleife für Gesamtgröße und Anzahl der Files
    For $i = 1 To $afile[0]
    $aData = StringSplit($afile[$i],"|")
    If Not FileExists(@ScriptDir & "\" & $aData[1]) Then
    $bLoadIt = True
    Else
    if FileGetTime($aData[1]) < $aData[2] Then $bLoadIt = True
    EndIf
    if $bLoadIt Then
    $iSize += InetGetSize("http://mmorpgaming.pytalhost.com/autoit/" & $aData[1], 1)
    $iCount += 1
    EndIf
    Next
    GUICtrlSetData($label1, "0/" & $iCount & " Dateien")

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

    For $i = 1 To $afile[0]
    $aData = StringSplit($afile[$i],"|")
    If Not FileExists(@ScriptDir & "\" & $aData[1]) Then
    $bLoadIt = True
    Else
    if FileGetTime($aData[1]) < $aData[2] Then $bLoadIt = True
    EndIf
    if $bLoadIt Then
    $iDown = InetGet("http://mmorpgaming.pytalhost.com/autoit/" & $afile[$i], @ScriptDir & "\" & $aData[1], 1)
    $iFilesDone += 1
    $iPercent = $iFilesDone / $iCount * 100
    GUICtrlSetData($progressbar1, $iPercent)
    GUICtrlSetData($label1, $iFilesDone & "/" & $iCount & " Dateien")
    $iBytesDone += $iDown
    $iPercent = $iBytesDone / $iSize * 100
    GUICtrlSetData($progressbar2, $iPercent)
    GUICtrlSetData($label2, $iBytesDone & "/" & $iSize & " Bytes")
    EndIf
    Next
    EndIf
    Else
    MsgBox(16, "Fehler", "Updateliste nicht gefunden!")
    EndIf
    Do
    $msg = GUIGetMsg()
    if $msg = $button Then Exit
    Until $msg = $GUI_EVENT_CLOSE

    [/autoit]

    dazu müsstest du die List.txt anpassen:

    Code
    test.au3|201003121042
    example.txt|201003191804

    wobei das 1. File auf dem Server nicht existiert

    mfg (Auto)Bert

  • naja datum ist sehr ungünstig, das dauert zu lange, die list.txt zu schreiben (habe ein programm für meine variante)
    ich meinte nur, dass man die bytes prüft und mit der vorhandenen datei vergleicht, sind sie unterschiedlich, ist warscheinlich etwas verändert worden und der patcher bemerkt dies, somit ist sichergestellt, dass niemand daran herumpfuschen kann, oder dass kein update vergessen wird ;)
    ich hab ja geschickt, wie ich das vorher gelöst hatte ^^
    es stimmt, ich habe ein file gelöscht, weil der meine änderung an der au3 gelöscht hat -.-
    aber die list.txt erneuert sich jetzt ja immer wieder (bei meiner version jedenfalls)

  • naja datum ist sehr ungünstig, das dauert zu lange, die list.txt zu schreiben (habe ein programm für meine variante)
    ich meinte nur, dass man die bytes prüft und mit der vorhandenen datei vergleicht, sind sie unterschiedlich, ist warscheinlich etwas verändert worden und der patcher bemerkt dies, somit ist sichergestellt, dass niemand daran herumpfuschen kann, oder dass kein update vergessen wird ;)

    Bytes sind sehr unngünstig, da patchst du ein Skript wegen einem Tippfehler, die Bytezahl ändert sich nicht, das Skript wird nie upgedatet ==> Skript für list.txt anpassen

    [autoit]

    FileGetTime

    [/autoit]
    Zitat

    aber die list.txt erneuert sich jetzt ja immer wieder (bei meiner version jedenfalls)

    bei meiner auch schon immer, deine doppeltes herunterladen ist unnötig,

    mfg (Auto)Bert

  • sry wenn ich es 2 mal runterlade... war dann ein fehler beim schreiben, ändere ja ständig was...
    guck dir das script hier doch nochmal genauer an.... das mit den bytescheck ist genial, gerade für den zweck, für den ich den patcher gedacht habe, zum aktualisieren eines ordners von anderen via server!

    Spoiler anzeigen
    [autoit]

    InetGet("http://mmorpgaming.pytalhost.com/download/list.txt", ".\list.txt")
    #include <file.au3>
    Global $afile
    If _FileReadToArray(@ScriptDir & ".\" & "list.txt",$afile) Then
    For $i = 1 To $afile[0]
    If Not FileExists(@ScriptDir & "\" & $afile[$i]) Then
    InetGet("http://mmorpgaming.pytalhost.com/download/" & $afile[$i],@ScriptDir & "\" & $afile[$i],1,1)
    EndIf
    $size = FileGetSize(@ScriptDir & "\" & $afile[$i])
    $sizeonline = InetGetSize("http://mmorpgaming.pytalhost.com/download/" & $afile[$i],8)
    If $size <> $sizeonline Then
    InetGet("http://mmorpgaming.pytalhost.com/download/" & $afile[$i],@ScriptDir & "\" & $afile[$i],1,1)
    EndIf
    Next
    EndIf

    [/autoit]


    das mit den bytescheck ist wirklich (für mich auf jeden fall) die beste lösung... wenn du eine andere variante des patchers bevorzugst, dann benutze ihn so ^^ ich bin für den bytescheck ;)

  • Hallo black_skorbi,

    du hast ja das Grundgerüst, kannst es ja mit ein paar Files über das Datum testen. Wenn es klappt einfach die Logik auf Bytes übertragen,

    mfg (Auto)Bert

  • Hallo black_skorbi,

    ich habe das Skript nochmals verändert (war leider fehlerhaft):

    Spoiler anzeigen
    [autoit]

    #include <file.au3>
    #include <GUIConstantsEx.au3>
    #include <ProgressConstants.au3>

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

    Opt('MustDeclareVars', 1)

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

    Local $label1, $label2, $progressbar1, $progressbar2, $button, $wait, $s, $msg, $m, $afile, $aData
    Local $iSize, $iCount, $iBytesDone, $iFilesDone, $iPercent, $iDown, $bLoadIt

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

    GUICreate("Updater", 220, 140, 100, 200)
    $label1 = GUICtrlCreateLabel("Dateien", 10, 8, 200, 16)
    $progressbar1 = GUICtrlCreateProgress(10, 25, 200, 20)
    GUICtrlSetColor(-1, 32250); not working with Windows XP Style
    $label2 = GUICtrlCreateLabel("Bytes", 10, 58, 200, 16)
    $progressbar2 = GUICtrlCreateProgress(10, 75, 200, 20, $PBS_SMOOTH)
    $button = GUICtrlCreateButton("Be&enden", 75, 115, 70, 20)
    GUISetState()
    If InetGet("http://mmorpgaming.pytalhost.com/autoit/list.txt", @ScriptDir & "\list.txt", 1) > 0 Then
    If _FileReadToArray(@ScriptDir & ".\" & "list.txt", $afile) Then
    ;Schleife für Gesamtgröße und Anzahl der Files
    For $i = 1 To $afile[0]
    $aData = StringSplit($afile[$i],"|")
    $bLoadIt = False
    If Not FileExists(@ScriptDir & "\" & $aData[1]) Then
    ConsoleWrite("Not exists yet ")
    $bLoadIt = True
    Else
    if FileGetTime($aData[1]) < $aData[2] Then
    $bLoadIt = True
    ConsoleWrite("There is a newer File: " & FileGetTime($aData[1]) & " " & $aData[2])
    EndIf
    EndIf
    if $bLoadIt Then
    $iSize += InetGetSize("http://mmorpgaming.pytalhost.com/autoit/" & $aData[1], 1)
    $iCount += 1
    ConsoleWrite("SizeAdd " & $iSize & " " & $iCount &@CRLF)
    EndIf
    Next
    GUICtrlSetData($label1, "0/" & $iCount & " Dateien")

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

    For $i = 1 To $afile[0]
    $aData = StringSplit($afile[$i],"|")
    $bLoadIt = False
    If Not FileExists(@ScriptDir & "\" & $aData[1]) Then
    $bLoadIt = True
    Else
    if FileGetTime($aData[1]) < $aData[2] Then $bLoadIt = True
    EndIf
    if $bLoadIt Then
    $iDown = InetGet("http://mmorpgaming.pytalhost.com/autoit/" & $aData[1], @ScriptDir & "\" & $aData[1], 1)
    $iFilesDone += 1
    $iPercent = $iFilesDone / $iCount * 100
    GUICtrlSetData($progressbar1, $iPercent)
    GUICtrlSetData($label1, $iFilesDone & "/" & $iCount & " Dateien")
    $iBytesDone += $iDown
    $iPercent = $iBytesDone / $iSize * 100
    GUICtrlSetData($progressbar2, $iPercent)
    GUICtrlSetData($label2, $iBytesDone & "/" & $iSize & " Bytes")
    ConsoleWrite("Downloaded " & $aData[1] & @CRLF)
    EndIf
    Next
    EndIf
    Else
    MsgBox(16, "Fehler", "Updateliste nicht gefunden!")
    EndIf
    Do
    $msg = GUIGetMsg()
    if $msg = $button Then Exit
    Until $msg = $GUI_EVENT_CLOSE

    [/autoit]

    ich habe es mit einer lokalen list.txt getestet, es funktioniert jetzt mit Datum List.Txt:

    Code
    test.au3|20100320000000
    example.txt|20100320000000

    mfg (Auto)Bert

  • wie versprochen hier nochmal der endcode ;)
    der ladebalken ist von NoName (damit niemand sagt geklaut xD)
    die prozentanzeige spinnt ein wenig weil ich nicht weiß, wie man die zahl rundet
    es werden nach wie vor nur dateipfade in der list.txt angebgeben, sollten die angegebenen dateien nicht vorhanden oder verändert sein, werden sie gedownloadet/ersetzt. hier nun das script: (in anhang zum downloaden (geht schneller ;)))

    &lt;= Patcher
    [autoit]

    #NoTrayIcon
    #include <GUIConstantsEx.au3>
    #include <GDIPlus.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ###
    $hGUI = GUICreate("Patchvorgang", 179, 16, -1, -1, -$WS_Popup, BitOr($WS_EX_TOOLWINDOW, $WS_EX_TOPMOST))
    $hGUIProgress = GUICtrlCreatePic("", 0, 0, 180, 17)
    #EndRegion ### END Koda GUI section ###
    GUISetState()

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

    _GDIPlus_Startup()

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

    #include <file.au3>
    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <ProgressConstants.au3>
    #include <WindowsConstants.au3>

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

    $iSize = 0
    $iBytesAll = 0
    $iPercent = 0
    $iPercentAll= 0
    $i = 0

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

    $iPercentAll += $iPercent
    $hBitmap = _WinAPI_CreateBitmap(180, 17, 1, 32)
    $hImage = _GDIPlus_BitmapCreateFromHBITMAP($hBitmap)
    $hGraphic = _GDIPlus_ImageGetGraphicsContext($hImage)
    _ProgressCreate($hGraphic, 0x6FFF0000, "Fortschritt: " & $iPercentAll & "%", $i * 1.8, 180, $i * 0.85)
    $hNewBitmapHandle = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
    _SetBitmapToCtrl($hGUIProgress, $hNewBitmapHandle)

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

    InetGet("http://mmorpgaming.pytalhost.com/autoit/list.txt", @TempDir & "\list.txt",1)
    Global $afile
    If _FileReadToArray(@TempDir & ".\" & "list.txt",$afile) Then
    For $i = 1 To $afile[0]
    If Not FileExists(@ScriptDir & "\" & $afile[$i]) Then
    $iSize = $iSize + InetGetSize("http://mmorpgaming.pytalhost.com/autoit/" & $afile[$i],8)
    EndIf
    $size = FileGetSize(@ScriptDir & "\" & $afile[$i])
    $sizeonline = InetGetSize("http://mmorpgaming.pytalhost.com/autoit/" & $afile[$i],8)
    If FileExists(@ScriptDir & "\" & $afile[$i]) And $size <> $sizeonline Then
    $iSize = $iSize + InetGetSize("http://mmorpgaming.pytalhost.com/autoit/" & $afile[$i],8)
    EndIf
    Next

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

    For $i = 1 To $afile[0]
    If Not FileExists(@ScriptDir & "\" & $afile[$i]) Then
    InetGet("http://mmorpgaming.pytalhost.com/autoit/" & $afile[$i],@ScriptDir & "\" & $afile[$i],8,0)
    $iBytesDone = InetGetSize("http://mmorpgaming.pytalhost.com/autoit/" & $afile[$i],8)
    $iPercent = $iBytesDone / $iSize * 100
    EndIf
    $iPercentAll += $iPercent
    $hBitmap = _WinAPI_CreateBitmap(180, 17, 1, 32)
    $hImage = _GDIPlus_BitmapCreateFromHBITMAP($hBitmap)
    $hGraphic = _GDIPlus_ImageGetGraphicsContext($hImage)
    _ProgressCreate($hGraphic, 0x6FFF0000, "Fortschritt: " & $iPercentAll & "%", $i * 1.8, 180, $i * 0.85)
    $hNewBitmapHandle = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
    _SetBitmapToCtrl($hGUIProgress, $hNewBitmapHandle)
    Next
    EndIf

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

    _GDIPlus_Shutdown()

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

    Func _ProgressCreate($hGraphic, $vColor, $vText, $vPercent, $vWidth, $vTextWidth)
    _GDIPlus_GraphicsClear($hGraphic, 0xFFFFFFFF)

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

    Dim $hPenProgress[99]
    For $i = 0 To 8
    $vSWColor = "0xFF" & Hex($i * 2 * 10, 2) & Hex($i *2* 10, 2) & Hex($i * 2 * 10, 2)
    $hPenProgress[$i] = _GDIPlus_PenCreate($vSWColor)
    _GDIPlus_GraphicsDrawLine($hGraphic, 0, $i, $vWidth, $i, $hPenProgress[$i])
    _GDIPlus_PenDispose($hPenProgress[$i])
    Next
    For $i = 0 To 7
    $vSWColor = "0xFF" & Hex($i*2 * 10, 2) & Hex($i *2* 10, 2) & Hex($i *2* 10, 2)
    $hPenProgress[$i] = _GDIPlus_PenCreate($vSWColor)
    _GDIPlus_GraphicsDrawLine($hGraphic, 0, 16 - $i, $vWidth, 16 - $i, $hPenProgress[$i])
    _GDIPlus_PenDispose($hPenProgress[$i])
    Next

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

    $hBrushProgress = _GDIPlus_BrushCreateSolid($vColor)
    _GDIPlus_GraphicsFillRect($hGraphic, 0, 0, $vPercent, 17, $hBrushProgress)

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

    $hFontFamilyProgress = _GDIPlus_FontFamilyCreate("Arial")
    $hFontProgress = _GDIPlus_FontCreate($hFontFamilyProgress, 8, 1)
    $hLayoutProgress = _GDIPlus_RectFCreate($vTextWidth, 1, $vWidth, 17)
    $hFormatProgress = _GDIPlus_StringFormatCreate()
    $hBrushTextProgress = _GDIPlus_BrushCreateSolid(0xFFFFFFFF)
    _GDIPlus_GraphicsDrawStringEx($hGraphic, $vText, $hFontProgress, $hLayoutProgress, $hFormatProgress, $hBrushTextProgress)

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

    $hPenOutLineTL = _GDIPlus_PenCreate(0xFF666666)
    $hPenOutLineBR = _GDIPlus_PenCreate(0xFFDDDDDD)
    _GDIPlus_GraphicsDrawLine($hGraphic, 0, 0, $vWidth, 0, $hPenOutLineTL)
    _GDIPlus_GraphicsDrawLine($hGraphic, 0, 0, 0, 16, $hPenOutLineTL)
    _GDIPlus_GraphicsDrawLine($hGraphic, 0, 16, $vWidth, 16, $hPenOutLineBR)
    _GDIPlus_GraphicsDrawLine($hGraphic, $vWidth - 1, 0, $vWidth - 1, 16, $hPenOutLineBR)

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

    _GDIPlus_PenDispose($hPenOutLineTL)
    _GDIPlus_PenDispose($hPenOutLineBR)
    _GDIPlus_BrushDispose($hBrushProgress)
    _GDIPlus_FontFamilyDispose($hFontFamilyProgress)
    _GDIPlus_FontDispose($hFontProgress)
    _GDIPlus_StringFormatDispose($hFormatProgress)
    _GDIPlus_BrushDispose($hBrushTextProgress)
    EndFunc

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

    Func _SetBitmapToCtrl($vCtrlID, $h_Bitmap)
    Local $hWnd = GUICtrlGetHandle($vCtrlID)
    If $hWnd = 0 Then Return SetError(1, 0, 0)

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

    Local $vOldStyle = _WinAPI_GetWindowLong($hWnd, -16)
    _WinAPI_SetWindowLong($hWnd, -16, BitOR($vOldStyle, 0xE))

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

    Local $vOldBmp = _SendMessage($hWnd, 0x0172, 0, $h_Bitmap)
    If $vOldBmp <> 0 Then _WinAPI_DeleteObject($vOldBmp)
    EndFunc

    [/autoit]


    der patcher hat keinen fensterrahmen und ist nicht in der explorerleiste versehen, somt kann er nicht so einfach gestoppt werden (damit niemand das so leicht verhindern kann ;))
    mein server ist bereits eingegeben, ihr könnt aber auch einen eigenen wählen
    (der patcher ist zum updaten vom server aus gedacht!)

    ps: wer kein winrar zum entpacken hat nimmt 7-zip

  • Hallo Black_Skorbi,

    zum Runden kannst du round verwenden:

    Zitat von Hilfe Deutsch

    Round

    Gibt eine Zahl gerundet auf eine angegebene Anzahl von Nachkommastellen zurück.

    Round ( expression [, decimalplaces] )

    mfg (Auto)Bert

  • schon ein Release xD
    version 1.1

    &lt;= Patcher Release 1.1
    [autoit]

    ; =<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>= ; =<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>= ;
    ; =<>=<>=<>=<>=<>! AllesPatcher !<>=<>=<>=<>=<>= ; =<>=<>=< Made for: Autoit.de, private >=<>=<>= ;
    ; AutoIt version: 3.3.4.0 <=!= ; Script Copyright: ==>>=> black_skorpy <=<<== ;
    ; Language: German <=!= ; >Darf in unveränderter compileter Form auch <= ;
    ; Author: "black_skorpi",Porgress by NoName <=!= ; >anderweitig genutzt und hochgeladen werden <= ;
    ; =<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>= ; =<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>= ;
    ; >==<>=<>=<> ==>> Script Start <<== <>=<>=<>==< ; => ==>> <>Verändern nicht erlaubt!xD<> <<== <= ;
    ; =<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>= ; =<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>= ;

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

    #NoTrayIcon
    #include <GUIConstantsEx.au3>
    #include <GDIPlus.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ###
    $hGUI = GUICreate("Patchvorgang", 179, 16, -1, -1, -$WS_Popup, BitOr($WS_EX_TOOLWINDOW, $WS_EX_TOPMOST))
    $hGUIProgress = GUICtrlCreatePic("", 0, 0, 180, 17)
    #EndRegion ### END Koda GUI section ###
    GUISetState()
    _GDIPlus_Startup()
    #include <file.au3>
    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <ProgressConstants.au3>
    #include <WindowsConstants.au3>
    $iSize = 0
    $iBytesAll = 0
    $iPercent = 0
    $iPercentAll= 0
    $iPercentRound = 0
    $i = 0
    $iPercentAll += $iPercent
    $hBitmap = _WinAPI_CreateBitmap(180, 17, 1, 32)
    $hImage = _GDIPlus_BitmapCreateFromHBITMAP($hBitmap)
    $hGraphic = _GDIPlus_ImageGetGraphicsContext($hImage)
    _ProgressCreate($hGraphic, 0x6FFF0000, "Fortschritt: " & $iPercentRound & "%", $i * 1.8, 180, $i * 0.85)
    $hNewBitmapHandle = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
    _SetBitmapToCtrl($hGUIProgress, $hNewBitmapHandle)
    InetGet("http://mmorpgaming.pytalhost.com/autoit/list.txt", @TempDir & "\list.txt",1)
    Global $afile
    If _FileReadToArray(@TempDir & ".\" & "list.txt",$afile) Then
    For $i = 1 To $afile[0]
    If Not FileExists(@ScriptDir & "\" & $afile[$i]) Then
    $iSize = $iSize + InetGetSize("http://mmorpgaming.pytalhost.com/autoit/" & $afile[$i],8)
    EndIf
    $size = FileGetSize(@ScriptDir & "\" & $afile[$i])
    $sizeonline = InetGetSize("http://mmorpgaming.pytalhost.com/autoit/" & $afile[$i],8)
    If FileExists(@ScriptDir & "\" & $afile[$i]) And $size <> $sizeonline Then
    $iSize = $iSize + InetGetSize("http://mmorpgaming.pytalhost.com/autoit/" & $afile[$i],8)
    EndIf
    Next
    For $i = 1 To $afile[0]
    If Not FileExists(@ScriptDir & "\" & $afile[$i]) Then
    InetGet("http://mmorpgaming.pytalhost.com/autoit/" & $afile[$i],@ScriptDir & "\" & $afile[$i],8,0)
    $iBytesDone = InetGetSize("http://mmorpgaming.pytalhost.com/autoit/" & $afile[$i],8)
    $iPercent = $iBytesDone / $iSize * 100
    EndIf
    $iPercentAll += $iPercent
    $iPercentRound = Round($iPercentAll, 1)
    $hBitmap = _WinAPI_CreateBitmap(180, 17, 1, 32)
    $hImage = _GDIPlus_BitmapCreateFromHBITMAP($hBitmap)
    $hGraphic = _GDIPlus_ImageGetGraphicsContext($hImage)
    _ProgressCreate($hGraphic, 0x6FFF0000, "Fortschritt: " & $iPercentRound & "%", $i * 1.8, 180, $i * 0.85)
    $hNewBitmapHandle = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
    _SetBitmapToCtrl($hGUIProgress, $hNewBitmapHandle)
    Next
    EndIf
    _GDIPlus_Shutdown()
    Func _ProgressCreate($hGraphic, $vColor, $vText, $vPercent, $vWidth, $vTextWidth)
    _GDIPlus_GraphicsClear($hGraphic, 0xFFFFFFFF)
    Dim $hPenProgress[99]
    For $i = 0 To 8
    $vSWColor = "0xFF" & Hex($i * 2 * 10, 2) & Hex($i *2* 10, 2) & Hex($i * 2 * 10, 2)
    $hPenProgress[$i] = _GDIPlus_PenCreate($vSWColor)
    _GDIPlus_GraphicsDrawLine($hGraphic, 0, $i, $vWidth, $i, $hPenProgress[$i])
    _GDIPlus_PenDispose($hPenProgress[$i])
    Next
    For $i = 0 To 7
    $vSWColor = "0xFF" & Hex($i*2 * 10, 2) & Hex($i *2* 10, 2) & Hex($i *2* 10, 2)
    $hPenProgress[$i] = _GDIPlus_PenCreate($vSWColor)
    _GDIPlus_GraphicsDrawLine($hGraphic, 0, 16 - $i, $vWidth, 16 - $i, $hPenProgress[$i])
    _GDIPlus_PenDispose($hPenProgress[$i])
    Next
    $hBrushProgress = _GDIPlus_BrushCreateSolid($vColor)
    _GDIPlus_GraphicsFillRect($hGraphic, 0, 0, $vPercent, 17, $hBrushProgress)
    $hFontFamilyProgress = _GDIPlus_FontFamilyCreate("Arial")
    $hFontProgress = _GDIPlus_FontCreate($hFontFamilyProgress, 8, 1)
    $hLayoutProgress = _GDIPlus_RectFCreate($vTextWidth, 1, $vWidth, 17)
    $hFormatProgress = _GDIPlus_StringFormatCreate()
    $hBrushTextProgress = _GDIPlus_BrushCreateSolid(0xFFFFFFFF)
    _GDIPlus_GraphicsDrawStringEx($hGraphic, $vText, $hFontProgress, $hLayoutProgress, $hFormatProgress, $hBrushTextProgress)
    $hPenOutLineTL = _GDIPlus_PenCreate(0xFF666666)
    $hPenOutLineBR = _GDIPlus_PenCreate(0xFFDDDDDD)
    _GDIPlus_GraphicsDrawLine($hGraphic, 0, 0, $vWidth, 0, $hPenOutLineTL)
    _GDIPlus_GraphicsDrawLine($hGraphic, 0, 0, 0, 16, $hPenOutLineTL)
    _GDIPlus_GraphicsDrawLine($hGraphic, 0, 16, $vWidth, 16, $hPenOutLineBR)
    _GDIPlus_GraphicsDrawLine($hGraphic, $vWidth - 1, 0, $vWidth - 1, 16, $hPenOutLineBR)
    _GDIPlus_PenDispose($hPenOutLineTL)
    _GDIPlus_PenDispose($hPenOutLineBR)
    _GDIPlus_BrushDispose($hBrushProgress)
    _GDIPlus_FontFamilyDispose($hFontFamilyProgress)
    _GDIPlus_FontDispose($hFontProgress)
    _GDIPlus_StringFormatDispose($hFormatProgress)
    _GDIPlus_BrushDispose($hBrushTextProgress)
    EndFunc
    Func _SetBitmapToCtrl($vCtrlID, $h_Bitmap)
    Local $hWnd = GUICtrlGetHandle($vCtrlID)
    If $hWnd = 0 Then Return SetError(1, 0, 0)
    Local $vOldStyle = _WinAPI_GetWindowLong($hWnd, -16)
    _WinAPI_SetWindowLong($hWnd, -16, BitOR($vOldStyle, 0xE))
    Local $vOldBmp = _SendMessage($hWnd, 0x0172, 0, $h_Bitmap)
    If $vOldBmp <> 0 Then _WinAPI_DeleteObject($vOldBmp)
    EndFunc

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

    ; =<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>= ; =<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>= ;
    ; >==<>=<>=<>! ==>> Script End <<== !<>=<>=<>==< ; => ==>->!-! =>=> Version 1.10 <=<= !-!<-<== <= ;
    ; =<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>= ; =<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>= ;

    [/autoit]
  • es werden nach wie vor nur dateipfade in der list.txt angebgeben, sollten die angegebenen dateien nicht vorhanden oder verändert sein, werden sie gedownloadet/ersetzt

    das stimmt nur für nicht vorhandene, du berücksichtigst zwar in der Schleife für die Summe der herunter zu ladenden Dateien die veränderten Dateien über die Größe, nicht aber in der Schleife in der du herunterladest,

    mfg (Auto)Bert

  • Huch ^^
    habe ich wohl beim neuschreiben übersehen, wird sofort ergänzt => V1.2
    Edit kommt gleich

    Edit1:

    Release 1.2
    Beim downloaden der geänderten Dateien spinnt die Anzeige noch. Ich erkenne das Problem nicht ;(
    Naja hier das Script, da unten zum Download

    &lt;= Release 1.2
    [autoit]

    ; =<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>= ; =<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>= ;
    ; =<>=<>=<>=<>=<>! AllesPatcher !<>=<>=<>=<>=<>= ; =<>=<>=< Made for: Autoit.de, private >=<>=<>= ;
    ; AutoIt version: 3.3.4.0 <=!= ; Script Copyright: ==>>=> black_skorpy <=<<== ;
    ; Language: German <=!= ; >Darf in unveränderter compileter Form auch <= ;
    ; Author: "black_skorpi",Porgress by NoName <=!= ; >anderweitig genutzt und hochgeladen werden <= ;
    ; =<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>= ; =<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>= ;
    ; >==<>=<>=<> ==>> Script Start <<== <>=<>=<>==< ; => ==>> <>Verändern nicht erlaubt!xD<> <<== <= ;
    ; =<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>= ; =<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>= ;

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

    #NoTrayIcon
    #include <GUIConstantsEx.au3>
    #include <GDIPlus.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ###
    $hGUI = GUICreate("Patchvorgang", 179, 16, -1, -1, -$WS_Popup, BitOr($WS_EX_TOOLWINDOW, $WS_EX_TOPMOST))
    $hGUIProgress = GUICtrlCreatePic("", 0, 0, 180, 17)
    #EndRegion ### END Koda GUI section ###
    GUISetState()
    _GDIPlus_Startup()
    #include <file.au3>
    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <ProgressConstants.au3>
    #include <WindowsConstants.au3>
    $iSize = 0
    $iBytesAll = 0
    $iPercent = 0
    $iPercentAll= 0
    $iPercentRound = 0
    $i = 0
    $iPercentAll += $iPercent
    $hBitmap = _WinAPI_CreateBitmap(180, 17, 1, 32)
    $hImage = _GDIPlus_BitmapCreateFromHBITMAP($hBitmap)
    $hGraphic = _GDIPlus_ImageGetGraphicsContext($hImage)
    _ProgressCreate($hGraphic, 0x6FFF0000, "Fortschritt: " & $iPercentRound & "%", $i * 1.8, 180, $i * 0.85)
    $hNewBitmapHandle = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
    _SetBitmapToCtrl($hGUIProgress, $hNewBitmapHandle)
    InetGet("http://mmorpgaming.pytalhost.com/autoit/list.txt", @TempDir & "\list.txt",1)
    Global $afile
    If _FileReadToArray(@TempDir & ".\" & "list.txt",$afile) Then
    For $i = 1 To $afile[0]
    If Not FileExists(@ScriptDir & "\" & $afile[$i]) Then
    $iSize += InetGetSize("http://mmorpgaming.pytalhost.com/autoit/" & $afile[$i],8)
    EndIf
    $size = FileGetSize(@ScriptDir & "\" & $afile[$i])
    $sizeonline = InetGetSize("http://mmorpgaming.pytalhost.com/autoit/" & $afile[$i],8)
    If FileExists(@ScriptDir & "\" & $afile[$i]) And $size <> $sizeonline Then
    $iSize += InetGetSize("http://mmorpgaming.pytalhost.com/autoit/" & $afile[$i],8)
    EndIf
    Next
    For $i = 1 To $afile[0]
    $size = FileGetSize(@ScriptDir & "\" & $afile[$i])
    $sizeonline = InetGetSize("http://mmorpgaming.pytalhost.com/autoit/" & $afile[$i],8)
    If FileExists(@ScriptDir & "\" & $afile[$i]) And $size <> $sizeonline Then
    InetGet("http://mmorpgaming.pytalhost.com/autoit/" & $afile[$i],@ScriptDir & "\" & $afile[$i],8,0)
    $iBytesDone = InetGetSize("http://mmorpgaming.pytalhost.com/autoit/" & $afile[$i],8)
    $iPercent = $iBytesDone / $iSize * 100
    EndIf
    If Not FileExists(@ScriptDir & "\" & $afile[$i]) Then
    InetGet("http://mmorpgaming.pytalhost.com/autoit/" & $afile[$i],@ScriptDir & "\" & $afile[$i],8,0)
    $iBytesDone = InetGetSize("http://mmorpgaming.pytalhost.com/autoit/" & $afile[$i],8)
    $iPercent = $iBytesDone / $iSize * 100
    EndIf
    $iPercentAll += $iPercent
    $iPercentRound = Round($iPercentAll, 1)
    $hBitmap = _WinAPI_CreateBitmap(180, 17, 1, 32)
    $hImage = _GDIPlus_BitmapCreateFromHBITMAP($hBitmap)
    $hGraphic = _GDIPlus_ImageGetGraphicsContext($hImage)
    _ProgressCreate($hGraphic, 0x6FFF0000, "Fortschritt: " & $iPercentRound & "%", $i * 1.8, 180, $i * 0.85)
    $hNewBitmapHandle = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
    _SetBitmapToCtrl($hGUIProgress, $hNewBitmapHandle)
    Next
    EndIf
    _GDIPlus_Shutdown()
    Func _ProgressCreate($hGraphic, $vColor, $vText, $vPercent, $vWidth, $vTextWidth)
    _GDIPlus_GraphicsClear($hGraphic, 0xFFFFFFFF)
    Dim $hPenProgress[99]
    For $i = 0 To 8
    $vSWColor = "0xFF" & Hex($i * 2 * 10, 2) & Hex($i *2* 10, 2) & Hex($i * 2 * 10, 2)
    $hPenProgress[$i] = _GDIPlus_PenCreate($vSWColor)
    _GDIPlus_GraphicsDrawLine($hGraphic, 0, $i, $vWidth, $i, $hPenProgress[$i])
    _GDIPlus_PenDispose($hPenProgress[$i])
    Next
    For $i = 0 To 7
    $vSWColor = "0xFF" & Hex($i*2 * 10, 2) & Hex($i *2* 10, 2) & Hex($i *2* 10, 2)
    $hPenProgress[$i] = _GDIPlus_PenCreate($vSWColor)
    _GDIPlus_GraphicsDrawLine($hGraphic, 0, 16 - $i, $vWidth, 16 - $i, $hPenProgress[$i])
    _GDIPlus_PenDispose($hPenProgress[$i])
    Next
    $hBrushProgress = _GDIPlus_BrushCreateSolid($vColor)
    _GDIPlus_GraphicsFillRect($hGraphic, 0, 0, $vPercent, 17, $hBrushProgress)
    $hFontFamilyProgress = _GDIPlus_FontFamilyCreate("Arial")
    $hFontProgress = _GDIPlus_FontCreate($hFontFamilyProgress, 8, 1)
    $hLayoutProgress = _GDIPlus_RectFCreate($vTextWidth, 1, $vWidth, 17)
    $hFormatProgress = _GDIPlus_StringFormatCreate()
    $hBrushTextProgress = _GDIPlus_BrushCreateSolid(0xFFFFFFFF)
    _GDIPlus_GraphicsDrawStringEx($hGraphic, $vText, $hFontProgress, $hLayoutProgress, $hFormatProgress, $hBrushTextProgress)
    $hPenOutLineTL = _GDIPlus_PenCreate(0xFF666666)
    $hPenOutLineBR = _GDIPlus_PenCreate(0xFFDDDDDD)
    _GDIPlus_GraphicsDrawLine($hGraphic, 0, 0, $vWidth, 0, $hPenOutLineTL)
    _GDIPlus_GraphicsDrawLine($hGraphic, 0, 0, 0, 16, $hPenOutLineTL)
    _GDIPlus_GraphicsDrawLine($hGraphic, 0, 16, $vWidth, 16, $hPenOutLineBR)
    _GDIPlus_GraphicsDrawLine($hGraphic, $vWidth - 1, 0, $vWidth - 1, 16, $hPenOutLineBR)
    _GDIPlus_PenDispose($hPenOutLineTL)
    _GDIPlus_PenDispose($hPenOutLineBR)
    _GDIPlus_BrushDispose($hBrushProgress)
    _GDIPlus_FontFamilyDispose($hFontFamilyProgress)
    _GDIPlus_FontDispose($hFontProgress)
    _GDIPlus_StringFormatDispose($hFormatProgress)
    _GDIPlus_BrushDispose($hBrushTextProgress)
    EndFunc
    Func _SetBitmapToCtrl($vCtrlID, $h_Bitmap)
    Local $hWnd = GUICtrlGetHandle($vCtrlID)
    If $hWnd = 0 Then Return SetError(1, 0, 0)
    Local $vOldStyle = _WinAPI_GetWindowLong($hWnd, -16)
    _WinAPI_SetWindowLong($hWnd, -16, BitOR($vOldStyle, 0xE))
    Local $vOldBmp = _SendMessage($hWnd, 0x0172, 0, $h_Bitmap)
    If $vOldBmp <> 0 Then _WinAPI_DeleteObject($vOldBmp)
    EndFunc

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

    ; =<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>= ; =<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>= ;
    ; >==<>=<>=<>! ==>> Script End <<== !<>=<>=<>==< ; => ==>->!-! =>=> Version 1.20 <=<= !-!<-<== <= ;
    ; =<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>= ; =<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<>= ;

    [/autoit]
  • musstest du wirklich solch einen alten thread wieder herauskramen? (naja 2 monate...)

    wenn jemand noch etwas fragen will, dann soll dieser mir eine pn schreiben ;)

    ich denke mal er hat dies hier gelesen:

    darf ich hierauf hinweisen? (schon geschehen xD)
    da kannst du mal nachblättern... schon ein bisschen alt aber geht noch
    ich muss das mal bald aktualisieren, das ist fast peinlich, wie das aufgebaut ist xD


    sieh es also als Erinnerung,

    mfg (Auto)Bert

  • das war ja nur ein hinweiß darauf, dass es den thread gibt (machst du ja auch manchmal) und dass das als grundlage gut verwendet werden kann... (ich räum das überhaupt mal kurz auf, davon kann man nicht lernen... zu durcheinander xD)

    Edit1:

    kleines update (das war ja chaos -.- und so viel unnütz, naja, ich war auch mal anfänger)
    changelog: ohne zwischenspeicher geschiet die prüfung, in der console ist der ablauf dokumentiert, allgemein aufgeräumt

    Patcher 2.0
    [autoit]

    #NoTrayIcon
    #include <GDIPlus.au3>
    #include <INet.au3>

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

    ; GUI ===<<<===>>>===
    $hGUI = GUICreate("Patchvorgang", 179, 16, -1, -1, 2147483648, 136)
    $hGUIProgress = GUICtrlCreatePic("", 0, 0, 180, 17)
    GUISetState()
    ; === ===<<<===>>>===

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

    Local $iSize = 0, $iBytesAll = 0, $iPercent = 0, $iPercentAll= 0, $iPercentRound = 0

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

    ; GDIPlus zeichne Ladebalken ====<<<<====>>>>====
    _GDIPlus_Startup()
    $hBitmap = _WinAPI_CreateBitmap(180, 17, 1, 32)
    $hImage = _GDIPlus_BitmapCreateFromHBITMAP($hBitmap)
    $hGraphic = _GDIPlus_ImageGetGraphicsContext($hImage)
    _ProgressCreate($hGraphic, 0x6FFF0000, "Fortschritt: " & $iPercentRound & "%", 0, 180, 0)
    $hNewBitmapHandle = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
    _SetBitmapToCtrl($hGUIProgress, $hNewBitmapHandle)
    $hBitmap = _WinAPI_CreateBitmap(180, 17, 1, 32)
    $hImage = _GDIPlus_BitmapCreateFromHBITMAP($hBitmap)
    $hGraphic = _GDIPlus_ImageGetGraphicsContext($hImage)
    ; ========================== ====<<<<====>>>>====

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

    Local $source = _INetGetSource("http://mmorpgaming.pytalhost.com/autoit/list.txt")
    If IsString($source) Then
    Global $afile = StringSplit($source, @LF, 1) ; Splitte den String zu einer 0-basierenden Array
    ConsoleWrite("Files need to Update:" & @CRLF)
    For $i = 1 To $afile[0] ; Prüfe, ob Datei existiert und lese, wenn nicht, die Dateigröße
    If Not FileExists(@ScriptDir & "\" & $afile[$i]) Then
    $iSize += InetGetSize("http://mmorpgaming.pytalhost.com/autoit/" & $afile[$i],8)
    ConsoleWrite(@Tab & $afile[$i] & @CRLF)
    EndIf
    $size = FileGetSize(@ScriptDir & "\" & $afile[$i])
    $sizeonline = InetGetSize("http://mmorpgaming.pytalhost.com/autoit/" & $afile[$i],8)
    If FileExists(@ScriptDir & "\" & $afile[$i]) And $size <> $sizeonline Then
    $iSize += InetGetSize("http://mmorpgaming.pytalhost.com/autoit/" & $afile[$i],8)
    ConsoleWrite(@Tab & $afile[$i] & @CRLF)
    EndIf
    Next
    ConsoleWrite("Updating..." & @CRLF)
    For $i = 1 To $afile[0] ; Vergleiche die Dateigröße aller angegebenen Dateien und downloade sie bei Unterschied/Nichtexistenz
    $size = FileGetSize(@ScriptDir & "\" & $afile[$i])
    $sizeonline = InetGetSize("http://mmorpgaming.pytalhost.com/autoit/" & $afile[$i],8)
    If FileExists(@ScriptDir & "\" & $afile[$i]) And $size <> $sizeonline Then ; Wenn Datei existiert und die Größe anders ist
    InetGet("http://mmorpgaming.pytalhost.com/autoit/" & $afile[$i],@ScriptDir & "\" & $afile[$i],8,0)
    $iBytesDone = InetGetSize("http://mmorpgaming.pytalhost.com/autoit/" & $afile[$i],8)
    $iPercent = $iBytesDone / $iSize * 100
    ConsoleWrite(@Tab & $afile[$i] & " = Done" & @CRLF)
    EndIf
    If Not FileExists(@ScriptDir & "\" & $afile[$i]) Then ; Wenn Datei nicht
    InetGet("http://mmorpgaming.pytalhost.com/autoit/" & $afile[$i],@ScriptDir & "\" & $afile[$i],8,0)
    $iBytesDone = InetGetSize("http://mmorpgaming.pytalhost.com/autoit/" & $afile[$i],8)
    $iPercent = $iBytesDone / $iSize * 100
    ConsoleWrite(@Tab & $afile[$i] & " = Done" & @CRLF)
    EndIf
    $iPercentAll += $iPercent
    $iPercentRound = Round($iPercentAll, 1)
    _ProgressCreate($hGraphic, 0x6FFF0000, "Fortschritt: " & $iPercentRound & "%", $i * 1.8, 180, $i * 0.85)
    $hNewBitmapHandle = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
    _SetBitmapToCtrl($hGUIProgress, $hNewBitmapHandle)
    Next
    ConsoleWrite("Update complete!" & @CRLF)
    EndIf
    _GDIPlus_Shutdown()
    Func _ProgressCreate($hGraphic, $vColor, $vText, $vPercent, $vWidth, $vTextWidth)
    _GDIPlus_GraphicsClear($hGraphic, 0xFFFFFFFF)
    Dim $hPenProgress[99]
    For $i = 0 To 8
    $vSWColor = "0xFF" & Hex($i * 2 * 10, 2) & Hex($i *2* 10, 2) & Hex($i * 2 * 10, 2)
    $hPenProgress[$i] = _GDIPlus_PenCreate($vSWColor)
    _GDIPlus_GraphicsDrawLine($hGraphic, 0, $i, $vWidth, $i, $hPenProgress[$i])
    _GDIPlus_PenDispose($hPenProgress[$i])
    Next
    For $i = 0 To 7
    $vSWColor = "0xFF" & Hex($i*2 * 10, 2) & Hex($i *2* 10, 2) & Hex($i *2* 10, 2)
    $hPenProgress[$i] = _GDIPlus_PenCreate($vSWColor)
    _GDIPlus_GraphicsDrawLine($hGraphic, 0, 16 - $i, $vWidth, 16 - $i, $hPenProgress[$i])
    _GDIPlus_PenDispose($hPenProgress[$i])
    Next
    $hBrushProgress = _GDIPlus_BrushCreateSolid($vColor)
    _GDIPlus_GraphicsFillRect($hGraphic, 0, 0, $vPercent, 17, $hBrushProgress)
    $hFontFamilyProgress = _GDIPlus_FontFamilyCreate("Arial")
    $hFontProgress = _GDIPlus_FontCreate($hFontFamilyProgress, 8, 1)
    $hLayoutProgress = _GDIPlus_RectFCreate($vTextWidth, 1, $vWidth, 17)
    $hFormatProgress = _GDIPlus_StringFormatCreate()
    $hBrushTextProgress = _GDIPlus_BrushCreateSolid(0xFFFFFFFF)
    _GDIPlus_GraphicsDrawStringEx($hGraphic, $vText, $hFontProgress, $hLayoutProgress, $hFormatProgress, $hBrushTextProgress)
    $hPenOutLineTL = _GDIPlus_PenCreate(0xFF666666)
    $hPenOutLineBR = _GDIPlus_PenCreate(0xFFDDDDDD)
    _GDIPlus_GraphicsDrawLine($hGraphic, 0, 0, $vWidth, 0, $hPenOutLineTL)
    _GDIPlus_GraphicsDrawLine($hGraphic, 0, 0, 0, 16, $hPenOutLineTL)
    _GDIPlus_GraphicsDrawLine($hGraphic, 0, 16, $vWidth, 16, $hPenOutLineBR)
    _GDIPlus_GraphicsDrawLine($hGraphic, $vWidth - 1, 0, $vWidth - 1, 16, $hPenOutLineBR)
    _GDIPlus_PenDispose($hPenOutLineTL)
    _GDIPlus_PenDispose($hPenOutLineBR)
    _GDIPlus_BrushDispose($hBrushProgress)
    _GDIPlus_FontFamilyDispose($hFontFamilyProgress)
    _GDIPlus_FontDispose($hFontProgress)
    _GDIPlus_StringFormatDispose($hFormatProgress)
    _GDIPlus_BrushDispose($hBrushTextProgress)
    EndFunc
    Func _SetBitmapToCtrl($vCtrlID, $h_Bitmap)
    Local $hWnd = GUICtrlGetHandle($vCtrlID)
    If $hWnd = 0 Then Return SetError(1, 0, 0)
    Local $vOldStyle = _WinAPI_GetWindowLong($hWnd, -16)
    _WinAPI_SetWindowLong($hWnd, -16, BitOR($vOldStyle, 0xE))
    Local $vOldBmp = _SendMessage($hWnd, 0x0172, 0, $h_Bitmap)
    If $vOldBmp <> 0 Then _WinAPI_DeleteObject($vOldBmp)
    EndFunc

    [/autoit]

    (ich pusche mit absicht nicht!)