axe.killer Posted August 10, 2005 Posted August 10, 2005 how do i make like a progress bar for % downloaded here is my script, which is useless so far ProgressOn("Loading Host Helper v1.0", "Loading Please Wait", "0 percent") For $i = 1 to 100 step 43 sleep(100) ProgressSet( $i, $i & " percent") Next ProgressSet(100 , "Done", "Host Helper Loaded") sleep(500) ProgressOff() SoundPlay("C:\Windows\media\start.wav") InetGet("http://maietweb.nefficient.com/maiet/GunzInternational_20050804.exe", "index.exe") the loading thing dont work cuz its fake.
Josbe Posted August 10, 2005 Posted August 10, 2005 Read in the helpfile about these useful macros/functions for your script:@InetGetActive, @InetGetBytesRead.InetGet(), InetGetSize() AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta
axe.killer Posted August 10, 2005 Author Posted August 10, 2005 Read in the helpfile about these useful macros/functions for your script:@InetGetActive, @InetGetBytesRead.InetGet(), InetGetSize()<{POST_SNAPBACK}>still dosent seem to work ;'( pls help
hgeras Posted August 10, 2005 Posted August 10, 2005 (edited) First of all you have made a virtual progress....You have to first call the InetGet() and then call the ProgreesOn(). As for the progress update you should play with InetGetSize() and @InetGetBytesRead.... It is natural that current percentage complete is (@InetGetBytesRead\InetGetSize())*100.... Edited August 10, 2005 by hgeras Useful information about COM/Objects referenceMy Scripts:PapDefragNvidia Temperature Logger V3.0 with graph analyzerAutoiIt Update Checker And Downloader V1.0ArrayPush UDF
axe.killer Posted August 10, 2005 Author Posted August 10, 2005 First of all you have made a virtual progress....You have to first call the InetGet() and then call the ProgreesOn(). As for the progress update you should play with InetGetSize() and @InetGetBytesRead.... It is natural that current percentage complete is (@InetGetBytesRead\InetGetSize())*100....<{POST_SNAPBACK}>Didnt work here is what i got so far InetGet("http://www.pc-defender.net/pc-defender.zip", "index.exe")ProgressOn("Loading Host Helper v1.0", "Loading Please Wait", "0 percent")For $i = 1 to 100 step "(@InetGetBytesRead\InetGetSize())*100"nextsleep(1000)ProgressSet"((@InetGetBytesRead\InetGetSize())*100" , "Done", "Host Helper Loaded")ProgressOff()SoundPlay("C:\Windows\media\start.wav")it just freezes at -% and does nothing, though i thankyou for your time. BTW, im a noob so new at this.
hgeras Posted August 10, 2005 Posted August 10, 2005 (edited) I can see you are noob...Your approach is wrong...Totally... Try this and tell me if it works for ya cos i have never done something like this before.... $size=InetGetSize("http://www.pc-defender.net/pc-defender.zip") sleep(5000) InetGet("http://www.pc-defender.net/pc-defender.zip", "index.zip",0,1) ProgressOn("Loading Host Helper v1.0", "Loading Please Wait", "") While @InetGetActive ProgressSet((@InetGetBytesRead/$size)*100) sleep(500) Wend ProgressSet(100 , "Done", "Host Helper Loaded") sleep(2000) ProgressOff() SoundPlay("C:\Windows\media\start.wav") C ya EDIT:Too many mistakes which i corrected them.... Edited August 11, 2005 by hgeras Useful information about COM/Objects referenceMy Scripts:PapDefragNvidia Temperature Logger V3.0 with graph analyzerAutoiIt Update Checker And Downloader V1.0ArrayPush UDF
Josbe Posted August 11, 2005 Posted August 11, 2005 Ok, an alternative...Suggestion: Read carefully your helpfile. $sURL = "http://maietweb.nefficient.com/maiet/GunzInternational_20050804.exe" $sLocalFile = "index.exe" ProgressOn("Loading Host Helper v1.0", "Searching file...(Please Wait)", "0%", 5, -1, 16 ) $fSize = InetGetSize( $sURL ); looking the size before to start ProgressSet( 0, '0%', "Loading file...(Please wait)") InetGet( $sURL, $sLocalFile, 0, 1); request the file ; Downloading process While @InetGetActive $bytesR = @InetGetBytesRead;macro reading the progress $bPercent = Round(($bytesR / $fSize) * 100) ProgressSet( $bPercent, $bPercent & "% ( " & Round($bytesR/1024) & 'kb / ' & Round($fSize/1024) & 'kb )', 'Downloading "' & $sLocalFile& '"...') Sleep(100); to reduce the flickering WEnd ProgressOff() SoundPlay("C:\Windows\media\start.wav") MsgBox(0, "", "Download succesful!" ) AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta
hgeras Posted August 11, 2005 Posted August 11, 2005 As you can see Josbe's code and mine do the same thing...Josbe's is more "professional". But you can start studying mine which is simpler and then Josbe's to get a wider view of AutoIt structure.... And as Josbe mentioned...Read carefully the Help File....It is perfect and not many questions should arise if properly and focused read..... Useful information about COM/Objects referenceMy Scripts:PapDefragNvidia Temperature Logger V3.0 with graph analyzerAutoiIt Update Checker And Downloader V1.0ArrayPush UDF
axe.killer Posted August 11, 2005 Author Posted August 11, 2005 thankyou, both work fine I LOVE YOU. im hosting this on my domain pc-defender.net making a lot of downloaders. Have you heard of bittorrent? Well anyway, best regards
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