autoit progress bar

Posted on 2014-12-31
Last Modified: 2014-12-31
How would I make what I would think is a simple progress bar?
What I want is to enter a start number say 300 and then a goal number say 245 and it show the number and percentage mark.

I was thinking something like
ProgressOn ("Progress bar", "Start and Goal", "Working...")
$start = inputbox ("start value","enter value")
$goal = inputbox ("goal value", enter value")

$percentcomplete = $g/$c


Open in new window

I'm very new to this. Thanks!
Question by:bbimis
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 30

Expert Comment

ID: 40525497
Here is a simple one I found that you can modify:

 ProgressOn("Progress Bar", "Sample progress bar", "Working...")
 For $i = 0 To 100
 ProgressSet(100, "Done!")

Not sure I understand your start and goal numbers. Do you mean you want to increment another 245? Or go down from 300 to 245? Your division would give you a very small number. Perhaps you could explain a bit more.
LVL 81

Expert Comment

by:David Johnson, CD, MVP
ID: 40525503
ProgressOn ("Progress bar", "Start and Goal", "Working...")
$start = inputbox ("start value","enter value")
$goal = inputbox ("goal value", enter value")
$percentcomplete = ($g/$c) [b]* 100[/b]
 ProgressSet(100, "Done!")

Open in new window

it needs a percentage which is (current value/ max value) * 100

Author Comment

ID: 40525511
I'm trying to do something like this then I can fix the graphical part of it.  
the math just isn't clicking for me.
$c = InputBox("Start Weight", "Enter current Weight")
$g = InputBox("Goal Weight", "Enter Goal Weight")

   $TotalPoundstoLoose = $c * .04 ;Four percent of the weight needed to loose in terms of pounds
   MsgBox(0,"total",$TotalPoundstoLoose) ; used for testing
   $Lost = $c - $g ; amount of wait currently lost
   $percent = $lost/$TotalPoundstoLoose ; percentage out of 100 for ticker/progress bar
   MsgBox(0,"lost",$lost); used for testing
	MsgBox(0,"Percent", $percent); used for testing
	$value = $Lost * 100 ; percentage converted to 100 for ticker
	ProgressOn("Progress Bar", "Sample progress bar", "Working...")

 ;ProgressSet(100, "Done!")

Open in new window

Scamming the Scammers!

Have you ever heard of Scam Baiting?
It's a highly entertaining sport that you can participate in.
Introduction to beating scammers at their own game and how you can help
Share your thoughts, ideas and experiences on the topic.
Links to top Anti-Scam resources provided.


Author Comment

ID: 40525556
Basically what I'm trying to do is make it where lets say I weigh 280
I want to loose 4 percent of that weight which is 11.2 pounds

I want the percentage to reflect how close I am to that goal
Basically a weight loss ticker.
LVL 54

Expert Comment

by:Joe Winograd, EE MVE
ID: 40525585
Since you're very new to this, you may want to consider a similar language called AutoHotkey. I think it is better than AutoIT, although there are certainly folks who think the opposite. But if you're not already wedded to AutoIT, take a look at AutoHotkey (also free, of course). There have been many forks of the original language and recently a new community was established to move the language forward. The latest release at the new community has a Windows installer, an offline help file, and a compiler that turns the AHK source code (plain text) into a stand-alone/no-install executable (an EXE file).

There is excellent documentation:

...including an alphabetical command and function index:

...a good tutorial:

...and an active user forum:

If you'd like to see AutoHotkey in full programs, here are a few EE articles that I've written with source code:

In terms of the progress bar, here are two lines of code from one of those articles that will do it:


The complete syntax for the Progress command is:

Progress, ProgressParam1 [, SubText, MainText, WinTitle, FontName]

Also, here's the command to turn off the progress bar:


Regards, Joe
LVL 81

Accepted Solution

David Johnson, CD, MVP earned 500 total points
ID: 40525672
	$starting = InputBox("Start Weight", "Enter Starting Weight")
	$current = InputBox("Current Weight","Enter Current Weight")
	$TotalPoundstoLoose = $starting * .04 
	MsgBox(0,"Your Goal Pounds to Lose:",$TotalPoundstoLoose) ; used for testing
	$Lost = $Starting - $current ; amount of weight currently lost
	$percent = ($lost/$TotalPoundstoLoose) * 100 ; percentage out of 100 for ticker/progress bar
	MsgBox(0,"You have lost:",$lost); used for testing
	MsgBox(0,"Which is Percent of your Goal", $percent); used for testing
	ProgressOn("Progress Bar", "Goal Achievement", "Working...")

Open in new window


Author Closing Comment

ID: 40525678

Featured Post

RoboForm Secure Password Management System

RoboForm Everywhere - Superb Browser Support
Windows / Apple / IOS / Android / Linux / Chrome OS
Use different complex passwords everywhere
Best Secure Password Management by far
Synchronize all of your devices instantly
Safe, Secure & Highly Recommended!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
When you try to extract and to view the contents of a Microsoft Update Standalone Package (MSU) for Windows Vista, you cannot extract the files from the MSU. Here we are going to explain how to extract those hotfix details without using any third pa…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question