Sign in to follow this  
Followers 0
mud409

help with _filereadtoarray

6 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

sorry didn't mean to sound like an ass... double reading it now it came off like it even with the thanks...

Share this post


Link to post
Share on other sites

thank you, your suggestion actually has helped me except for the part that I questioned... I needed to include more within the for else

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