AzKay Posted July 22, 2006 Share Posted July 22, 2006 Would anyone half an example for this? Like, the progress going up for whatever its downloading? # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
Sokko Posted July 22, 2006 Share Posted July 22, 2006 What's so difficult about it that you need an example to understand? Setting the value of a progress bar is basic math: Take however many units you've completed so far, divide it by the total number of units that you're working on, multiply by 100 and round it off. It's always the same calculations no matter what you're tracking the progress of. The help file has an example under GUICtrlCreateProgress, and an example of downloading a file in the background (thus allowing you to check its progress) can be found under InetGet. Link to comment Share on other sites More sharing options...
AzKay Posted July 22, 2006 Author Share Posted July 22, 2006 I suck at maths, What you just said, confused me. # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
Sokko Posted July 22, 2006 Share Posted July 22, 2006 The calculation is this: GUICtrlSetData($progressbar, Round(($X/$Y)*100))Where $X is the number of "things" (lines, files, bytes, or whatever) that you've finished so far, and $Y is the total number of "things" that you're doing. Make sense? Link to comment Share on other sites More sharing options...
AzKay Posted July 22, 2006 Author Share Posted July 22, 2006 Kinda. But still confused # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted July 22, 2006 Moderators Share Posted July 22, 2006 Kinda. But still confusedConfused? I thought sokko explained it wonderfully.Local $ItemsFinished = 0, $TotalItemsToDo = 30, $CompletionPercentage = 100 For $iCountDown = $ItemsFinished To $TotalItemsToDo ToolTip('You are Currently ' & Int(($iCountDown / $TotalItemsToDo) * $CompletionPercentage) & '% Done.' _ & @CR & 'Current Items Finished are: ' & $iCountDown, 0, 0) Sleep(500) NextNo pecentage bar example of what's going on basically. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Somniis Posted July 23, 2006 Share Posted July 23, 2006 (edited) $size = InetGetSize("file") $kb = Round($size / 1024) ProgressOn("Downloading...", "Retrieving new version.") While @InetGetActive $p = (100 * @InetGetBytesRead) / $size $kbi = Round(@InetGetBytesRead / 1024) ProgressSet($p, $kbi & "/" & $kb & " kilobytes", "Download in progress.") Sleep(130) WEnd ProgressOff() Example of downloading a file. Edited July 23, 2006 by Somniis Link to comment Share on other sites More sharing options...
AzKay Posted July 23, 2006 Author Share Posted July 23, 2006 $size = InetGetSize("file") $kb = Round($size / 1024) ProgressOn("Downloading...", "Retrieving new version.") While @InetGetActive $p = (100 * @InetGetBytesRead) / $size $kbi = Round(@InetGetBytesRead / 1024) ProgressSet($p, $kbi & "/" & $kb & " kilobytes", "Download in progress.") Sleep(130) WEnd ProgressOff() Example of downloading a file. Needed an example, using GUICtrlCreateProgress # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
Skruge Posted July 24, 2006 Share Posted July 24, 2006 Needed an example, using GUICtrlCreateProgressWhat's wrong with the example in the help file? [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font] Link to comment Share on other sites More sharing options...
AzKay Posted July 24, 2006 Author Share Posted July 24, 2006 It confuses me. # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted July 24, 2006 Moderators Share Posted July 24, 2006 It confuses me.Why don't you post what about it confuses you step by step, so you an be unconfused. You said in another thread, that the PixelSearch() confused you too, if the help file is confusing you, maybe it's confusing others too, and maybe it should be put in more lamens terms if it isn't already. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. 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