Tiger Posted September 19, 2007 Share Posted September 19, 2007 (edited) I have a question. I load al ot of files with INetGet. I have one progress bar for the download and how can i create a second progress bar for all downloads together. Edited September 19, 2007 by Tiger My UDFs:- _RegEnumKey Link to comment Share on other sites More sharing options...
Shevilie Posted September 19, 2007 Share Posted September 19, 2007 Show some code, so we can have a look at it... Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit Link to comment Share on other sites More sharing options...
Tiger Posted September 20, 2007 Author Share Posted September 20, 2007 (edited) This is the code: #cs ---------------------------------------------------------------------------- AutoIt Version: 3.2.4.9 Author: Tiger Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- Func InetGetwithProgress() $window = GUICreate("", 400, 40, -1, -1, $WS_POPUP + $WS_CAPTION, $WS_EX_TOOLWINDOW) $progress = GUICtrlCreateProgress(10, 10, 380, 20) GUISetState(@SW_SHOW, $window) InetGet($url, $path, 1, 1) While @InetGetActive Sleep(100) GUICtrlSetData($progress, Round(((@InetGetBytesRead / $size) * 100), 1)) WEnd GUIDelete($window) If FileExists($path) Then SetError(-1) Else SetError(1) EndIf EndFunc ;==>InetGetwithProgress Edited September 20, 2007 by Tiger My UDFs:- _RegEnumKey Link to comment Share on other sites More sharing options...
Shevilie Posted September 20, 2007 Share Posted September 20, 2007 Well you need something $size = InetGetSize ( "URL" ) But to make the total you could do something like.. $size = InetGetSize ( "URL1" ) $size = $size + InetGetSize ( "URL2" ) $size = $size + InetGetSize ( "URL3" ) $size = $size + InetGetSize ( "URL4" ) You would then have the global size... And then you could have a variabel to count upwards as the @InetGetBytesRead rises.. Gonna look at it in the morning Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit Link to comment Share on other sites More sharing options...
Tiger Posted September 20, 2007 Author Share Posted September 20, 2007 OK thanks My UDFs:- _RegEnumKey Link to comment Share on other sites More sharing options...
Shevilie Posted September 20, 2007 Share Posted September 20, 2007 Arg couldn't sleep expandcollapse popup#include <GUIConstants.au3> Func InetGetwithProgressMulti($arArray) $window = GUICreate("", 400, 70, -1, -1, $WS_POPUP + $WS_CAPTION, $WS_EX_TOOLWINDOW) $singleprogress = GUICtrlCreateProgress(10, 10, 380, 20) $multiprogress = GUICtrlCreateProgress(10, 40, 380, 20) GUISetState(@SW_SHOW, $window) $totalsize = 0 $totalread = 0 For $i = 0 To UBound($arArray) - 1 $totalsize += InetGetSize($arArray[$i][0]) Next For $i = 0 To UBound($arArray) - 1 $size = InetGetSize($arArray[$i][0]) GUICtrlSetData($singleprogress, 0, 1) InetGet($arArray[$i][0], $arArray[$i][1], 1, 1) While @InetGetActive Sleep(100) GUICtrlSetData($singleprogress, Round(((@InetGetBytesRead / $size) * 100), 1)) GUICtrlSetData($multiprogress, Round((((@InetGetBytesRead + $totalread) / $totalsize) * 100), 1)) WEnd $totalread += $size Next GUIDelete($window) EndFunc ;==>InetGetwithProgress Dim $list[3][2] $list[0][0] = "URL1" $list[0][1] = "PATH1" $list[1][0] = "URL2" $list[1][1] = "PATH2" $list[2][0] = "URL3" $list[2][1] = "PATH3" InetGetwithProgressMulti($list) Well the function expects an array as you can see... And I had to cut out the errorreport, can't really see a clever way to that. Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit Link to comment Share on other sites More sharing options...
Tiger Posted September 20, 2007 Author Share Posted September 20, 2007 ok thanks have you an example for the function. How can i use it My UDFs:- _RegEnumKey Link to comment Share on other sites More sharing options...
Shevilie Posted September 20, 2007 Share Posted September 20, 2007 (edited) ..... Its an example.. change the urls and the path to whatever and run it... Dim $list[3][2] $list[0][0] = "URL1" $list[0][1] = "PATH1" $list[1][0] = "URL2" $list[1][1] = "PATH2" $list[2][0] = "URL3" $list[2][1] = "PATH3" InetGetwithProgressMulti($list) The bottom is an example... Edited September 20, 2007 by Shevilie Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit Link to comment Share on other sites More sharing options...
Tiger Posted September 20, 2007 Author Share Posted September 20, 2007 ok i test it tomorrow My UDFs:- _RegEnumKey Link to comment Share on other sites More sharing options...
Tiger Posted September 21, 2007 Author Share Posted September 21, 2007 It run very good My UDFs:- _RegEnumKey Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now