Downloader

08/26/2013 13:21 kimboy600#1
Hi everyone , i decided to share some little home-made creation.
This is a downloader.
PHP Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
$doIng "0"
#Region ### START Koda GUI section ### Form=C:\Users\Utente\Documents\loldownlaod.kxf
$Form2 GUICreate("Downloader"24164, -1, -1)
$Download GUICtrlCreateButton("Download"16167525)
$link GUICtrlCreateInput(""7715024)
$Dprogress GUICtrlCreateProgress(73415024)
$Dspeed GUICtrlCreateLabel("0kb/s"168393624)
$Cp GUICtrlCreateLabel("0"209392224)
GUICtrlCreateLabel("%"219393624)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg 
GUIGetMsg()
    Switch 
$nMsg
         
Case $GUI_EVENT_CLOSE
            
If $doIng "0" Then
            
Exit
         Else
            
InetClose ($do)
            
Sleep (600)
            Exit
         EndIf
         Case 
$Download
            $DLINK 
GUICtrlRead ($link)
            If 
$DLINK "" Then
               MsgBox 
(0,"Error","A link must be inserted")
            Else
            
_Download()
            EndIf
    EndSwitch
WEnd
 Func _Download
()
      
$doIng "1"
      
$est StringRight ($DLINK,3)
      
$nick FileSaveDialog ("Choose a filename","","File in download (*." $est ")",2,"")
      If 
$nick "" Then
         Sleep 
(100)
      Else
      
$do InetGet ($DLINK$nick "." $est,1,1)
      
$doneornot InetGetInfo ($do,2)
      While 
$doneornot False
         $byteD 
InetGetInfo ($do,0)
         
Sleep (1000)
         
$NbyteD InetGetInfo ($do,0)
         
$bps $NbyteD $byteD
         $kbps 
$bps 1024
         
If $kbps 1024 Then
            $kbps 
$kbps /1024
         GuiCtrlSetData 
($Dspeed,$kbps " mbs")
      Else
         
GuiCtrlSetData ($Dspeed,$kbps " kbs")
         EndIf
         
$size InetGetInfo ($do,1)
         
$percent $byteD $size 100
         GUICtrlSetData 
($Dprogress,$percent)
         
GUICtrlSetData ($Cp,$percent)    
         If 
$percent 100 Then
            Sleep 
(700)
            
MsgBox (0,"","Download complete")
            
GUICtrlSetData ($Dprogress,"0")
            
InetClose ($do)
            
$doIng "0"
            
GUICtrlSetData ($Cp,"0")            
            
ExitLoop
         
EndIf         
      
WEnd
      
EndIf

EndFunc 
It still have to do some improovements , use it as you like (I think it's quite useless).
08/26/2013 17:18 alpines#2
kimboy600, I saw you uploading some scripts but to me it seems that you don't spent much time with them. You read about that on the internet and then you put it online.

If you would spend some time with your downloader script for example, you could make a downloader that can queue files or read self-made containers.

In my opinion I'd say that this is less than useless because it shows no signs of creativity, but if you think that the speed metre is something new then I have to say that every program has that.
08/26/2013 18:08 kimboy600#3
Quote:
Originally Posted by alpines View Post
kimboy600, I saw you uploading some scripts but to me it seems that you don't spent much time with then. You read about that on the internet and then you put it online.

If you would spend some time with your downloader script for example, you could make a downloader that can queue files or read self-made containers.

In my opinion I'd say that this is less than useless because it shows no signs of creativity, but if you think that the speed metre is something new then I have to say that every program has that.
As you said , i don't spend lot of time in scripting but i don't serach for them online and i put them there , i search a function and then i try to do a script based on that function. I know that the spped metre isn't new , but i use this program as an internet speed metre.
Btw , i'm not creative at all and i'm searching for ideas about any script to do, post it here if you have one.
08/26/2013 18:11 .yorliK#4
Sorry, but i can't cancel the download :awesome:

Good Script but this problem must be solved :D

PS: Its better when you round the long numbers.. f.E.
$Kbps = "50.2156943"
Round($kbps,2) -> Round to 50.22


MfG
Kilroy.
08/26/2013 19:01 alpines#5
What you said may be right but I don't think so but it's not the goal to achieve a working script for every function.
I think it's more important to combine these functions to a even bigger script with UDFs and much more.

If you want to improve your skill (reading your texts I don't think you want to) you have to make something better.
An idea to start is for example a container for your Downloader and also a queue, so users can easily load in the container to have all of the links they want to download in the list.