Jump to content

[HELP]GUICtrlProgressbar


jerwin
 Share

Recommended Posts

anyone can help me to use GUICtrlProgressbar

i try to search in HELP but some idiotic mind of mine cant really understand << sorry for that

anyway this is autopatch launcher im thinking if while patching the progress bar is working .....

see my SS pls...

Posted Image

heres my code for PATCH CHECK BUTTON

Case $msg = $PATCH
        
                    InetGet("http://trows-rancp.servegame.com/patch/serverversion.ini", "serverversion.ini")
                    sleep(500)
                    $chk = IniRead("serverversion.ini", "version", "ver", "NotFound")
                    $chk2 = IniRead("clientversion.ini", "version", "ver", "NotFound")
                    
                ;Declare File
                    $patch1 = inetgetsize("http://trows-rancp.servegame.com/patch/patch01.exe")
                    $patch2 = inetgetsize("http://trows-rancp.servegame.com/patch/patch02.exe")
                    $patch3 = inetgetsize("http://trows-rancp.servegame.com/patch/patch03.exe")
                    $param = InetGetsize("http://trows-rancp.servegame.com/patch/param.cfg")
                    $clientver = InetGetSize("http://trows-rancp.servegame.com/patch/clientversion.ini")


                    
                If $chk2 < $chk Then
                    GUICtrlSetState($Launch, $GUI_DISABLE)
                    MsgBox(0, "TRan Patch Check", "New Patch Detected!")
                    
                ;Download File Glogic
                    if($patch1 > "0") then
                ;$size = InetGetSize("http://yourdomain/patch/patch1.exe")
                    InetGet("http://trows-rancp.servegame.com/patch/patch01.exe", "patch01.exe", 1, 1)
                        While @InetGetActive
                        TrayTip("Downloading Patch01", "Bytes = " & @InetGetBytesRead, 5, 16)
                        Sleep(250)
                        WEnd
                    Traytip("Patching Step 1", "Please Wait...",5,16)
                    ShellExecute("patch01.exe")
                    Sleep(300)
                    FileDelete("patch01.exe")
                    EndIf

                    if($patch2 > "0") then
                ;$size = InetGetSize("http://yourdomain/patch/patch02.exe")
                    InetGet("http://trows-rancp.servegame.com/patch/patch02.exe", "patch02.exe", 1, 1)
                        While @InetGetActive
                        TrayTip("Downloading Patch02", "Bytes = " & @InetGetBytesRead, 5, 16)
                        Sleep(250)
                        WEnd
                    Traytip("Patching Step 2", "Please Wait...",5,16)
                    ShellExecute("patch02.exe")
                    Sleep(300)
                    FileDelete("patch02.exe")
                    EndIf
                
                    if($patch3 > "0") then
                    InetGet("http://trows-rancp.servegame.com/patch/patch03.exe", "patch03.exe", 1, 1)
                        While @InetGetActive
                        TrayTip("Downloading Patch03", "Bytes = " & @InetGetBytesRead, 5, 16)
                        Sleep(250)
                        WEnd
                    Traytip("Patching Step 3", "Please Wait...",5,16)
                    ShellExecute("patch03.exe")
                    Sleep(300)
                    FileDelete("patch03.exe")
                    EndIf
                
            ;Param
                if($param > "0" ) then
                    InetGet("http://trows-rancp.servegame.com/patch/param.cfg", "param.cfg", 1, 1)
                        While @InetGetActive
                        TrayTip("Downloading", "Bytes = " & @InetGetBytesRead, 5, 16)
                        Sleep(250)
                        WEnd
                    FileMove("param.cfg", "param.cfg",1)
                EndIf

                ;Download Clientversion
                    if($clientver > "0" ) then
                    InetGet("http://trows-rancp.servegame.com/patch/clientversion.ini", "clientversion.ini", 1, 1)
                    While @InetGetActive
                        TrayTip("Done", "Now You Can Enter Trows Ran", 5, 16)
                        Sleep(250)
                    WEnd
                    FileMove("clientversion.ini", "clientversion.ini",1)
                    Endif   
                    
                    
                    MsgBox(0, "TRan Patcher", "Done ! !")
                ;_FileWriteToLine("versionclient.ini", 2, "ver="& $chk, 1)
                    FileDelete("serverversion.ini")
                    GUICtrlSetState($Launch, $GUI_ENABLE)
                    
                ElseIf $chk2 = $chk Then
                    MsgBox(0, "TRan Patch Check", "You Have Last Patch!!!")
                    FileDelete("serverversion.ini")
                ;exitloop
                EndIf
[font="Arial Black"]Looking for a partner in making Perfect Bot for DEKARONPm me if you wanna join.....[/font]
Link to comment
Share on other sites

Add up the sizes of all the files you want to download first to get $TotalBytes.

Have a variable $GotBytes which is the amount downloaded so far

Then have something like you already have for your tray tip

$GotBytes = 0;before first download
$TotalBytes = $patch1+$patch2+$patch3;etc
While @InetGetActive
    GUICtrlSetData($progress1, ($GotBytes + @InetGetBytesRead)* 100 / $TotalBytes)
    TrayTip("Downloading Patch02", "Bytes = " & @InetGetBytesRead, 5, 16)
    Sleep(250)
WEnd
$GotBytes += $patch1
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

ahmm can u add it in my script i try it but im so confused wer do i put it sorry for being noob...

i try to edit it but its not working hmm i guess i put it in wrong line

Edited by jerwin
[font="Arial Black"]Looking for a partner in making Perfect Bot for DEKARONPm me if you wanna join.....[/font]
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...