Jump to content

Downloader Script Help?


Recommended Posts

DirCreate("Downloads")
$FileUrl = InputBox("Download", "Url:", "", "", -1, 10)
$FileName = InputBox("Save As", "Save As:", "", "", -1, 10)

  _Download($FileUrl, @scriptDir & "/Downloads/" & $FileName )
  Sleep(100)

Func _Download($File, $name)
    
    $FileSize1 = InetGetSize($file)
    InetGet($file, $name, 1, 1)
    While @InetGetActive
        
        $filedownload = Round(@InetGetBytesRead / 1048576, 5)
        $Percent = $filedownload / $FileSize1
        
        TrayTip("", "" & $filedownload & "Mb", 10, 16)
        Sleep(250)
    WEnd
    Sleep(500)
EndFunc

Ok, here's what I need help with.

# How can I add the download speed. (( eg, 5kb s )) underneath the mb downloaded?

# Is it possible to use a proxy? ((eg, input box, you put in the proxy, another one, you put in the port ))

# And, how could I remove the need to have a "$name", so make it so it saves as the name of the file, instead of having to type in ((eg, patch.exe ))

Thanks -

# MY LOVE FOR YOU... IS LIKE A TRUCK- #
Link to comment
Share on other sites

# Is it possible to use a proxy? ((eg, input box, you put in the proxy, another one, you put in the port ))

HttpSetProxy() perhaps?

# And, how could I remove the need to have a "$name", so make it so it saves as the name of the file, instead of having to type in ((eg, patch.exe ))

DownloadFile("http://www.somesite.com/somefile.ext")
Func DownloadFile($Link)
    Local $Temp = StringSplit($Link, "/")
    Return InetGet($Link, $Temp[$Temp[0]])
EndFunc

Untested but should work :D

Link to comment
Share on other sites

HttpSetProxy() perhaps?

DownloadFile("http://www.somesite.com/somefile.ext")
Func DownloadFile($Link)
    Local $Temp = StringSplit($Link, "/")
    Return InetGet($Link, $Temp[$Temp[0]])
EndFunc

Untested but should work :D

Hmm, how could I get this to have the mb downloaded and stuff?

And, would anyone know, like, if I put a list of proxy's in the script, and everytime you run the script, it usese on of the proxies, like it randomly picks one from the list?

@valuater

Ill look at those links now

# MY LOVE FOR YOU... IS LIKE A TRUCK- #
Link to comment
Share on other sites

Ok, Ive got the proxy working, but Is it possible to make it choose a random proxy from the list everytime Its opened?

&

I still need a way to find what speed its downloading at

&

@ Emperor

I couldnt get it working

# MY LOVE FOR YOU... IS LIKE A TRUCK- #
Link to comment
Share on other sites

Ok, Ive got the proxy working, but Is it possible to make it choose a random proxy from the list everytime Its opened?

&

I still need a way to find what speed its downloading at

&

@ Emperor

I couldnt get it working

Hmm, using a random proxy, would that work using the
RandomoÝ÷ Ùû§rب@ÈLj·!ªê-­©Ý¢jk£ªºZ×ë©Â+a¶¬jëh×6
Hello(Random(1,10))

Func Hello($Number)
     Select
          Case $Number = 1
               ;Do func #1 code here
          Case $Number = 2
               ;Do func #2 code here
          Case $Number = 3
               ;Do func #3 code here
          Case $Number = 4
               ;Do func #4 code here
          Case $Number = 5
               ;Do func #5 code here
          Case $Number = 6
               ;Do func #6 code here
          Case $Number = 7
               ;Do func #7 code here
          Case $Number = 8
               ;Do func #8 code here
          Case $Number = 9
               ;Do func #9 code here
          Case $Number = 10
               ;Do func #10 code here
     EndSelect
EndFunc

This would work, no? just modifying it now.

Edited by AzKay
# MY LOVE FOR YOU... IS LIKE A TRUCK- #
Link to comment
Share on other sites

Hmm, how could I get this to have the mb downloaded and stuff?

Func _Download($File)
    $name = StringSplit($File, "/")
    $FileSize1 = InetGetSize($file)
    InetGet($file, $name[$name[0]], 1, 1)
    While @InetGetActive
        
        $filedownload = Round(@InetGetBytesRead / 1048576, 5)
        $Percent = $filedownload / $FileSize1
        
        TrayTip("", "" & $filedownload & "Mb", 10, 16)
        Sleep(250)
    WEnd
    Sleep(500)
EndFunc
Link to comment
Share on other sites

Func _Download($File)
    $name = StringSplit($File, "/")
    $FileSize1 = InetGetSize($file)
    InetGet($file, $name[$name[0]], 1, 1)
    While @InetGetActive
        
        $filedownload = Round(@InetGetBytesRead / 1048576, 5)
        $Percent = $filedownload / $FileSize1
        
        TrayTip("", "" & $filedownload & "Mb", 10, 16)
        Sleep(250)
    WEnd
    Sleep(500)
EndFunc
Didnt work

C:\Documents and Settings\Asus\My Documents\AutoIt\Updater\Downloader.au3 (7) : ==> Incorrect number of parameters in function call.: 
_Download($FileUrl, @scriptDir & "/Downloads/") 
_Download($FileUrl, ^ ERROR
Edited by AzKay
# MY LOVE FOR YOU... IS LIKE A TRUCK- #
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...