Jump to content

Progress


Recommended Posts

I have just seen the Progress function in the help file.

Basically on my scripts when autoit running through a script and all the users see nothing happening. To stop them thinking the prog has frozen i use SplashTextOn and splashoff and somthing like please wait.

For example

SplashTextOn (please wait)

....autoit is doing copying or fileinstall

... autoit doing calculations

...autoit doing iniwrite or iniread

splashoff

msgbox (finished)

could i use the progess on, set and off function in the same way. How?

Link to comment
Share on other sites

sure, and it gives them a bar to show how much estimated time left.

ex from helpfile:

ProgressOn("Progress Meter", "Increments every second", "0 percent")
For $i = 10 to 100 step 10
    sleep(1000)
    ProgressSet( $i, $i & " percent")
Next
ProgressSet(100 , "Done", "Complete")
sleep(500)
ProgressOff()

you can also just use it in say a 3 step process:

ProgressOn("Progress Meter", "Starting step 1 of 3", "0 percent",0,0)
sleep(1000)
msgbox(1,"step1","done",10)
    ProgressSet( 33, "step 1 done")
sleep(1000)
msgbox(1,"step2","done",10)
    ProgressSet( 66, "step 1 done")
sleep(2000)
ProgressSet(100 , "Done", "Complete")
msgbox(1,"step3","done",10)
sleep(500)
ProgressOff()

AutoIt3, the MACGYVER Pocket Knife for computers.

Link to comment
Share on other sites

Thanks Script kitty

How do u implement it in the little example i gave. For example if i put it in front of the code it would just do the progressbar until it reach 100% and then carry on doing the rest of the script wouldn't it?

Would you put it under the adlib section? please help?

Link to comment
Share on other sites

You are making it far too hard.

Just start the progress bar,and update it as you go along, and finally end it at the end.

Manually put in the ProgressSet() parts. If you want to get complex, you could assign a variable to the progress, and adlib it, but you don't need to go through all that for something this simple.

Later on when more familiar you can do many more things with it.

; put this at the begining.
ProgressOn("Progress Meter", "Starting step 1 of 3", "0 percent",0,0)
sleep(1000)
; put a bunch of code here

msgbox(1,"step1","done",10)
   ProgressSet( 33, "step 1 done")

; put a bunch more code here
sleep(1000)
msgbox(1,"step2","done",10)

; put the last of your code here

   ProgressSet( 66, "step 1 done")
sleep(2000)
ProgressSet(100 , "Done", "Complete")
msgbox(1,"step3","done",10)
sleep(500)
ProgressOff()

AutoIt3, the MACGYVER Pocket Knife for computers.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...