Jump to content

help with _filereadtoarray


mud409
 Share

Recommended Posts

This bit of code should download each file stored in downloads.txt which is just a list of url's to those files... it seems as if it's not reading "For $x = 1 to $source2[0]" because it'll only download 1 file then quit... Seems like it's not getting the number of downloads available in the text file...

Dim $source2
If Not _FileReadToArray("downloads.txt",$source2) Then
MsgBox(4096,"Error", " Error reading downloads.txt   error:" & @error)
   Exit
EndIf

For $x = 1 to $source2[0]
$splita = StringSplit($source2[$x], "/")
    $num = $splita[0]
    InetGet($source2[$x], $splita[$num], 1, 1)

      Next
    
    While @InetGetActive
            If @InetGetActive = 1 Then
  TrayTip($splita, @InetGetBytesRead, 10, 16)
Edited by mud409
Link to comment
Share on other sites

Maybe....

#include <File.au3>

Dim $source2

If Not _FileReadToArray("downloads.txt", $source2) Then
    MsgBox(4096, "Error", " Error reading downloads.txt     error:" & @error)
    Exit
EndIf

For $x = 1 To $source2[0]
    
    $splita = StringSplit($source2[$x], "/")
    $num = $splita[0]
    TrayTip("Downloading...",  $source2[$x], 10, 16)
    InetGet($source2[$x], $x & "_" & $splita[$num] & ".txt", 1, 0) 

Next

***** NOT TESTED

8)

NEWHeader1.png

Link to comment
Share on other sites

I'm not exactly sure what you did to that inet...

I haven't tested that but I'd assume it'd make a line like this...

("http://www.whatever.com/download.exe", "1_download.exe.txt", 1, 0)

thanks for the suggestion though

Edited by mud409
Link to comment
Share on other sites

I'm not exactly sure what you did to that inet...

I haven't tested that but I'd assume it'd make a line like this...

("http://www.whatever.com/download.exe", "1_download.exe.txt", 1, 0)

thanks for the suggestion though

without knowing what type of files you are downloading and if the original $splita[$num] was possibly coping over itself every time you downloaded.

Listen, this is an example to help your direction, you can change the file name back, otherwise it should work.

....or thanks anway for not giving all the info needed

8)

NEWHeader1.png

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...