Sign in to follow this  
Followers 0
2words4uready

Why doesnt this code work?

2 posts in this topic

why doesnt this code work? Inet returns -1 (error)

#include <GUIConstants.au3>
#Include <GuiDateTimePicker.au3>

#Region ### START Koda GUI section ### Form=c:\documents and settings\tyler\desktop\new folder\koda_1.7.0.1\forms\downlaod.kxf
$Form1_1 = GUICreate("Form1", 275, 171, 193, 125)
$loc = GUICtrlCreateInput("File path", 8, 16, 257, 21)
$down = GUICtrlCreateButton("Download", 64, 136, 121, 33, 0)
$hour = GUICtrlCreateInput("Start", 72, 80, 41, 21)
$min = GUICtrlCreateInput("Time", 112, 80, 41, 21)
$hour2 = GUICtrlCreateInput("Stop", 72, 104, 41, 21)
$min2 = GUICtrlCreateInput("Time", 112, 104, 41, 21)
$sec = GUICtrlCreateInput("sec", 152, 80, 41, 21)
$sec2 = GUICtrlCreateInput("", 152, 104, 41, 21)
$save = GUICtrlCreateInput("Save Path", 8, 40, 257, 21)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch

If $nMsg = $down Then

    ToolTip("Download Progress: " & @InetGetBytesRead,0,0)
$loc1 = GUICtrlRead($loc)
$save1 = GUICtrlRead($save)
If @HOUR = $hour And @MIN = $min And @SEC = $sec Then
    InetGet($loc1, $save1)
    EndIf
    If @HOUR = $hour2 And @MIN = $min2 And @SEC = $sec2 +1 Then
        Exit
    EndIf
EndIf
WEnd

READ BEFORE POSTINGMy UDF'sMessagesYou say plz because its shorter than please. I say no because its shorter than yes.Join My Website

Share this post


Link to post
Share on other sites



#include <GUIConstants.au3>
#Include <GuiDateTimePicker.au3>


$Form1_1 = GUICreate("Form1", 275, 171, 193, 125)
$loc = GUICtrlCreateInput("File path", 8, 16, 257, 21)
$down = GUICtrlCreateButton("Download", 64, 136, 121, 33, 0)
$hour = GUICtrlCreateInput("Start", 72, 80, 41, 21)
$min = GUICtrlCreateInput("Time", 112, 80, 41, 21)
$hour2 = GUICtrlCreateInput("Stop", 72, 104, 41, 21)
$min2 = GUICtrlCreateInput("Time", 112, 104, 41, 21)
$sec = GUICtrlCreateInput("sec", 152, 80, 41, 21)
$sec2 = GUICtrlCreateInput("", 152, 104, 41, 21)
$save = GUICtrlCreateInput("Save Path", 8, 40, 257, 21)
GUISetState(@SW_SHOW)


While 1
    
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
            
        Case $down
            $loc1 = GUICtrlRead($loc)
            $save1 = GUICtrlRead($save)
            InetGet($loc1, $save1, 1)
            $time = TimerInit()
            While @InetGetActive
                TrayTip("Downloading", "Bytes = " & @InetGetBytesRead, 10, 16)
                Sleep(250)
            Wend
            $time = TimerDiff($time)
            ToolTip("Downloading completed in " & $time & " seconds!")
            Sleep(2000)
            ToolTip("")


EndSwitch


WEnd

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