Sign in to follow this  
Followers 0
axe.killer

progress bar

9 posts in this topic

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.

Share this post


Link to post
Share on other sites



Read in the helpfile about these useful macros/functions for your script:

@InetGetActive, @InetGetBytesRead.

InetGet(), InetGetSize()

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

#4 ·  Posted (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 by hgeras

Share this post


Link to post
Share on other sites

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"

next

sleep(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 :whistle: so new at this.

Share this post


Link to post
Share on other sites

#6 ·  Posted (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 by hgeras

Share this post


Link to post
Share on other sites

Ok, an alternative...

Suggestion: Read carefully your helpfile. :whistle:

$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!" )

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

thankyou, both work fine :whistle: 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 :dance:

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