Sign in to follow this  
Followers 0
Velnes

multi download

13 posts in this topic

#1 ·  Posted (edited)

im tryingto make some downloader with reading how many links to download from text file

and reading links from text file

but it wont work in any ways i try :////

this is where i ended up now

i just cant figure out wat to do

#include <WindowsConstants.au3>
#include <GuiConstantsEx.au3>
#include <Timers.au3>
#include <GuiStatusBar.au3>
#include <ProgressConstants.au3>
#include <SendMessage.au3>
#include <GuiButton.au3>
#include <StaticConstants.au3>
#include <GuiTab.au3>
#include <TabConstants.au3>
#include <GuiSlider.au3>
#include <Date.au3>
#include <File.au3>
#include <IE.au3>
#include <INet.au3>
#include <ClipBoard.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <ComboConstants.au3>
#include <winapi.au3>
#Include <String.au3>
#include <Inet.au3>



$ALLOW_DOWNLOADS_FOR_UPDATE_LIF = FileReadLine("Launcher\Data\config\ALLOW_DOWNLOADS_FOR_UPDATE.LIF",1)
$3 = $ALLOW_DOWNLOADS_FOR_UPDATE_LIF
Global $i[$3]

$LINKS_FOR_UPDATE_DOWNLOADS_LIF = FileReadLine("Launcher\Data\config\DOWNLOAD_LINKS.LIF",$i)

$START_OF_WITH_ZERO = 0
do
    Local $Url = "", $FileDir = "", $DownloadSize = 0, $Percent = 0, $DownloadSpeed1 = 0, $DownloadSpeed2 = 0, $DownloadRate = 0
    $Url = $LINKS_FOR_UPDATE_DOWNLOADS_LIF
        ProgressOn("Progress Window", "Initializing...", "", 1, 1, 18)
        $DownloadSize = Int(InetGetSize($Url))
        $FileDir = @ScriptDir & "\TR_BG.rar"
        InetGet($Url, $FileDir, 1, 1)
        Sleep(1000)
        While @InetGetActive
            $Percent = Int((@InetGetBytesRead / $DownloadSize) * 100)
            $DownloadSpeed1 = @InetGetBytesRead
            Sleep(1000)
            $DownloadSpeed2 = @InetGetBytesRead
            $DownloadRate = Int(($DownloadSpeed2 - $DownloadSpeed1) / 1024)
            If $DownloadRate < 0 Then $DownloadRate = 0
            ProgressSet($Percent, $DownloadRate & " kb/s" & "  " & "   Filesize: " & Round($DownloadSize / 1048576, 1) & "mb" & @CRLF & $Percent & "% of File Downloaded" & @CRLF & "Cancel downloading by Right Clicking Icon in System Tray!", "1")
        WEnd
        ProgressOff()
$START_OF_WITH_ZERO = $START_OF_WITH_ZERO + 1
until $START_OF_WITH_ZERO = $ALLOW_DOWNLOADS_FOR_UPDATE_LIF
Exit 1

nobody? :)

Edited by Velnes

Share this post


Link to post
Share on other sites



ok ive edited the code and got as far as here

now the problem is getting all the links from text file line 1,2,3,4 so on and so on (reading the links of files from text file)

#include <WindowsConstants.au3>
#include <GuiConstantsEx.au3>
#include <Timers.au3>
#include <GuiStatusBar.au3>
#include <ProgressConstants.au3>
#include <SendMessage.au3>
#include <GuiButton.au3>
#include <StaticConstants.au3>
#include <GuiTab.au3>
#include <TabConstants.au3>
#include <GuiSlider.au3>
#include <Date.au3>
#include <File.au3>
#include <IE.au3>
#include <INet.au3>
#include <ClipBoard.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <ComboConstants.au3>
#include <winapi.au3>
#Include <String.au3>
#include <Inet.au3>



$ALLOW_DOWNLOADS_FOR_UPDATE_LIF = FileReadLine("Launcher\Data\config\ALLOW_DOWNLOADS_FOR_UPDATE.LIF",1)
$START_OF_WITH_ZERO = 0
do
    Local $Url[$ALLOW_DOWNLOADS_FOR_UPDATE_LIF], $FileDir = "", $DownloadSize = 0, $Percent = 0, $DownloadSpeed1 = 0, $DownloadSpeed2 = 0, $DownloadRate = 0
for $i = 1 to 99 Step + 1
$LINKS_FOR_UPDATE_DOWNLOADS_LIF = FileReadLine("Launcher\Data\config\DOWNLOAD_LINKS.LIF",$i)
next

For $Next_Next = 1 to 99 Step + 1
    $Url[$Next_Next] = $LINKS_FOR_UPDATE_DOWNLOADS_LIF
        ProgressOn("Progress Window", "Initializing...", "", 1, 1, 18)
        $DownloadSize = Int(InetGetSize($Url[$Next_Next]))
        $FileDir = @ScriptDir & "\TR_BG.rar"
        InetGet(($Url[$Next_Next]), $FileDir, 1)
        Sleep(1000)
        While @InetGetActive
            $Percent = Int((@InetGetBytesRead / $DownloadSize) * 100)
            $DownloadSpeed1 = @InetGetBytesRead
            Sleep(1000)
            $DownloadSpeed2 = @InetGetBytesRead
            $DownloadRate = Int(($DownloadSpeed2 - $DownloadSpeed1) / 1024)
            If $DownloadRate < 0 Then $DownloadRate = 0
            ProgressSet($Percent, $DownloadRate & " kb/s" & "  " & "   Filesize: " & Round($DownloadSize / 1048576, 1) & "mb" & @CRLF & $Percent & "% of File Downloaded" & @CRLF & "Cancel downloading by Right Clicking Icon in System Tray!", "1")
        WEnd
        ProgressOff()
Next
$START_OF_WITH_ZERO = $START_OF_WITH_ZERO + 1
until $START_OF_WITH_ZERO = $ALLOW_DOWNLOADS_FOR_UPDATE_LIF
Exit 1

Share this post


Link to post
Share on other sites

Firstly, do you need all those Include Files as this increases the File Size if you are not using Obfuscator and secondly I would look at _FileReadToArray() in the Help File. If you also want inspiration look at >>


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

that didnt help at all for my situation :/

Share this post


Link to post
Share on other sites

that didnt help at all for my situation :/

OK, lets break it down why my solution didn't solve your problem completely :)

1. @InetGetBytesRead isn't used anymore in the newest Version of AutoIt! (any reason why you have an old Version of AutoIt?)

2. I have no idea what the File looks like! How are the links ordered? Are they on 1 line?

now the problem is getting all the links from text file line 1,2,3,4 so on and so on (reading the links of files from text file)

3. _FileReadToArray() is one way to Read the File into an Array and then loop through each Array element of the Array. If the File looks like this >>

http://awebsite.com
http://awebsite1.com

then this would solve the Reading the contents of the File.

I would suggesting Reading the Help File (F1) and having a look at _FileReadToArray() & InetGetInfo()


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

hmm i have 3.3.0.0 isnt that latest? xD

and i did read the _filereadtoarray() but i dont get it at all seriously... man mind showing example wit that thing? if not ill understand.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

No, V3.3.6.1 is the latest. There are many Examples in the forum to be honest, it seems a little silly creating something that has already been created. Have a little Search and then come back :)

And it wasn't a case of it didn't work, you just didn't understand the Function!

Edited by guinness

_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

i was searching just now and since 1hour... till now :)

but nothing there wat im looking for

#include <WindowsConstants.au3>
#include <GuiConstantsEx.au3>
#include <Timers.au3>
#include <GuiStatusBar.au3>
#include <ProgressConstants.au3>
#include <SendMessage.au3>
#include <GuiButton.au3>
#include <StaticConstants.au3>
#include <GuiTab.au3>
#include <TabConstants.au3>
#include <GuiSlider.au3>
#include <Date.au3>
#include <File.au3>
#include <IE.au3>
#include <INet.au3>
#include <ClipBoard.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <ComboConstants.au3>
#include <winapi.au3>
#Include <String.au3>
#include <Inet.au3>

$ALLOW_DOWNLOADS_FOR_UPDATE_LIF = FileReadLine("Launcher\Data\config\ALLOW_DOWNLOADS_FOR_UPDATE.LIF",1)
$START_OF_WITH_ZERO = 0
do
Local $Url[$ALLOW_DOWNLOADS_FOR_UPDATE_LIF], $FileDir = "", $DownloadSize = 0, $Percent = 0, $DownloadSpeed1 = 0, $DownloadSpeed2 = 0, $DownloadRate = 0,$LINKS_FOR_UPDATE_DOWNLOADS_LIF[99]


$LINKS_FOR_UPDATE_DOWNLOADS_LIF[1] = FileReadLine("Launcher\Data\config\DOWNLOAD_LINKS.LIF",1) ; download links in lines 1,2,3,4, so on
    $Url[1] = $LINKS_FOR_UPDATE_DOWNLOADS_LIF ;download files reading links from file using readfileline and read lines 1,2,3,4, so on

        ProgressOn("Progress Window", "Initializing...", "", 1, 1, 18)
        $DownloadSize = Int(InetGetSize($Url[1]))
        $FileDir = @ScriptDir & "\TR_BG.rar"
        InetGet(($Url[1]), $FileDir, 1)
        Sleep(1000)
        While @InetGetActive
            $Percent = Int((@InetGetBytesRead / $DownloadSize) * 100)
            $DownloadSpeed1 = @InetGetBytesRead
            Sleep(1000)
            $DownloadSpeed2 = @InetGetBytesRead
            $DownloadRate = Int(($DownloadSpeed2 - $DownloadSpeed1) / 1024)
            If $DownloadRate < 0 Then $DownloadRate = 0
            ProgressSet($Percent, $DownloadRate & " kb/s" & "  " & "   Filesize: " & Round($DownloadSize / 1048576, 1) & "mb" & @CRLF & $Percent & "% of File Downloaded" & @CRLF & "Cancel downloading by Right Clicking Icon in System Tray!", "1")
        WEnd
        ProgressOff()
$START_OF_WITH_ZERO = $START_OF_WITH_ZERO + 1
until $START_OF_WITH_ZERO = $ALLOW_DOWNLOADS_FOR_UPDATE_LIF
Exit 1

this is the part where im stuck

$LINKS_FOR_UPDATE_DOWNLOADS_LIF[1] = FileReadLine("Launcher\Data\config\DOWNLOAD_LINKS.LIF",1) ; download links in lines 1,2,3,4, so on
    $Url[1] = $LINKS_FOR_UPDATE_DOWNLOADS_LIF ;download files reading links from file using readfileline and read lines 1,2,3,4, so on
Edited by Velnes

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

OK, I tried! But I would suggest updating AutoIt in the Future! I haven't looked at the use of Arrays, but I would also suggest looking at Arrays in the Help File too.. I can't Test your code because I don't have V3.3.0.0!

$Count = 1 ; <<<<< Place outside the Do Loop!
LINKS_FOR_UPDATE_DOWNLOADS_LIF[1] = FileReadLine("Launcher\Data\config\DOWNLOAD_LINKS.LIF",$Count) ; download links in lines 1,2,3,4, so on
If @error then ExitLoop
$Count += 1
Edited by guinness

_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

#include <WindowsConstants.au3>
#include <GuiConstantsEx.au3>
#include <Timers.au3>
#include <GuiStatusBar.au3>
#include <ProgressConstants.au3>
#include <SendMessage.au3>
#include <GuiButton.au3>
#include <StaticConstants.au3>
#include <GuiTab.au3>
#include <TabConstants.au3>
#include <GuiSlider.au3>
#include <Date.au3>
#include <File.au3>
#include <IE.au3>
#include <INet.au3>
#include <ClipBoard.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <ComboConstants.au3>
#include <winapi.au3>
#Include <String.au3>
#include <Inet.au3>

$ALLOW_DOWNLOADS_FOR_UPDATE_LIF = FileReadLine("Launcher\Data\config\ALLOW_DOWNLOADS_FOR_UPDATE.LIF",1)
$START_OF_WITH_ZERO = 0
$Count = 1 ; <<<<< Place outside the Do Loop!
do
Local $Url[$ALLOW_DOWNLOADS_FOR_UPDATE_LIF], $FileDir = "", $DownloadSize = 0, $Percent = 0, $DownloadSpeed1 = 0, $DownloadSpeed2 = 0, $DownloadRate = 0,$LINKS_FOR_UPDATE_DOWNLOADS_LIF[99]

    $LINKS_FOR_UPDATE_DOWNLOADS_LIF[1] = FileReadLine("Launcher\Data\config\DOWNLOAD_LINKS.LIF",$Count) ; download links in lines 1,2,3,4, so on
    If @error then ExitLoop
    $Count += 1
    $Url = $LINKS_FOR_UPDATE_DOWNLOADS_LIF ;download files reading links from file using readfileline and read lines 1,2,3,4, so on
        ProgressOn("Progress Window", "Initializing...", "", 1, 1, 18)
        $DownloadSize = Int(InetGetSize($Url[1]))
        $FileDir = @ScriptDir & "\TR_BG.rar"
        InetGet(($Url[1]), $FileDir, 1)
        Sleep(1000)
        While @InetGetActive
            $Percent = Int((@InetGetBytesRead / $DownloadSize) * 100)
            $DownloadSpeed1 = @InetGetBytesRead
            Sleep(1000)
            $DownloadSpeed2 = @InetGetBytesRead
            $DownloadRate = Int(($DownloadSpeed2 - $DownloadSpeed1) / 1024)
            If $DownloadRate < 0 Then $DownloadRate = 0
            ProgressSet($Percent, $DownloadRate & " kb/s" & "  " & "   Filesize: " & Round($DownloadSize / 1048576, 1) & "mb" & @CRLF & $Percent & "% of File Downloaded" & @CRLF & "Cancel downloading by Right Clicking Icon in System Tray!", "1")
        WEnd
        ProgressOff()
$START_OF_WITH_ZERO = $START_OF_WITH_ZERO + 1
until $START_OF_WITH_ZERO = $ALLOW_DOWNLOADS_FOR_UPDATE_LIF
Exit 1

lol i failed ,the progress comes on but its just stuck there.

dont do anything lolz

btw thnx alot for ur helping man :) ild kiss u if i was gay ;)

Edited by Velnes

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

Update your script to the new Version of AutoIt and then come back, because as far as I can see (quickly without Testing) it shouldn't fail if the Arrays are correct and the URLs are correct too. Maybe as well ADD If @error Then ExitLoop in the While...WEnd Loop. I have given you enough information to solve your initial problem, its a case of taking what I have told you and reading the Help File!

Edited by guinness

_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

Firstly, do you need all those Include Files as this increases the File Size if you are not using Obfuscator and secondly I would look at _FileReadToArray() in the Help File. If you also want inspiration look at >>

@guiness

Multi segment downloading is not same thing that multi downloads ! Posted Image


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

Yeh, all I did was search Downloads and chose the first example just to give the OP an idea of how to use InetGetInfo() But I should have chose a better example :)

Edited by guinness

_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

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