Sign in to follow this  
Followers 0
Raffle

Getting Download file information

6 posts in this topic

; A Daimonin Skin switcher for win32 By Ross Dimassimo (Raf)

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

_Main()

Func _Main()
    Local $Triton, $BlackMetal, $RoyalBlue, $ClassicGray, $DaiDirectory, $DaiDirectoryExists, $DaiDirectoryInput, $msg

    GUICreate("Daimonin Skin Changer", 300, 80)

    $Triton = GUICtrlCreateButton("Triton", 10, 55, 70, 20)
    $BlackMetal = GUICtrlCreateButton("BlackMetal", 80, 55, 70, 20)
    $RoyalBlue = GUICtrlCreateButton("RoyalBlue", 150, 55, 70, 20)
    $ClassicGray = GUICtrlCreateButton("ClassicGray", 220, 55, 70, 20)

    GUICtrlCreateLabel("Daimonin Path:", 10, 33)
    $DaiDirectoryExists = FileExists("C:\daimonin")
    if $DaiDirectoryExists = 1 Then
        $DaiDirectoryInput = GUICtrlCreateInput("C:\daimonin", 90, 30, 120, 20)
        GUICtrlCreateLabel("Directory Exists!", 215, 33)
    Else
        $DaiDirectoryInput = GUICtrlCreateInput("", 90, 30, 120, 20)
    EndIf
    GUISetState()  ; display the GUI        

    
    
    Do
        $msg = GUIGetMsg()
        $DaiDirectory = GUICtrlRead( $DaiDirectoryInput)
        $DaiDirectory = $Daidirectory & "\client"
        Select
            Case $msg = $Triton
                Local $TritonFile = $DaiDirectory & "\Triton.zip"
                Local $TritonSize = InetGetSize("http://www.daimonin.org/sites/default/files/media/artists/Addons/Skins/Triton.zip")
                if FileExists($TritonFile) = 0 Then
                    Local $Download = InetGet("http://www.daimonin.org/sites/default/files/media/artists/Addons/Skins/Triton.zip", $DaiDirectory & "\Triton.zip", 1, 1)
                    Local $TritonData = InetGetInfo($Download)
                    Local $DownloadMsgbox = msgbox(0, "Downloading..", "Download: " & $TritonData[0] & "/ " & $TritonSize)
                    Do

                    Until InetGetInfo($Download, 2)
                EndIf   
                    
            Case $msg = $BlackMetal
                MsgBox(0, "You clicked on", "Black Metal")
            Case $msg = $RoyalBlue
                MsgBox(0, "You clicked on", "Royal Blue")
            Case $msg = $ClassicGray
                MsgBox(0, "You clicked on", "Classic Gray")
            Case $msg = $GUI_EVENT_CLOSE
                MsgBox(0, "You clicked on", "Close")
        EndSelect
    Until $msg = $GUI_EVENT_CLOSE
EndFunc   ;==>_Main

Im trying to make it so that the do until loop in the case $Triton will auto update the $TritonData[0] in the msgbox every second. But what happens no matter what i have put in there is it just says "0/2236647" and never updates the 0. I am a VERY noob autoit coder, I've just been using the function list in the documentation. Please help me

Share this post


Link to post
Share on other sites



MsgBox is a blocking function, your script basically pauses while it exists, when you press the ok button, your script continues.

In the loop after maybe add a gui of your own or even a tooltip, which can update .


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

MsgBox is a blocking function, your script basically pauses while it exists, when you press the ok button, your script continues.

In the loop after maybe add a gui of your own or even a tooltip, which can update .

I get the same problem with the tooltip, it says 0/2236647 always ;) i put the tooltip in the do btw

Share this post


Link to post
Share on other sites

show your revised code

I got it working, apparently adding sleep(1) made it work flawlessly ;) Thank you!

Share this post


Link to post
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
Sign in to follow this  
Followers 0