Jump to content
Sign in to follow this  
Sphaera_ORbis

Wait for progressbar to complete then continue

Recommended Posts

Update: i've completed the script and i've posted it in scripts and scraps for public-testing... let me know what you think of it..!

I want to automate a cleaning program, so far i've managed to figure out some things but i got stuck trying to wait for a progressbar to complete.

I will try to explain with a picture (See attachment)

What i want to do is let the script wait for the Progressbar to complete then

Sleep (100) and continue with the rest of the script...

Here's my script (The BOLD section below is were i want to put the code)

;Opstarten Applicatie

Run("C:\Program Files\CCleaner\ccleaner.exe")

WinWaitActive("CCleaner")

; Begin opschonen sectie Windows

ControlFocus ( "CCleaner", "Opschonen", 3 )

ControlClick ( "CCleaner", "Opschonen", 3 , "left" , 1 )

Sleep (2000) ; wacht 2 seconden

; Begin opschonen sectie Applicaties

Send ( "{TAB}")

Sleep (100)

Send ( "{TAB}")

Sleep (100)

Send ( "{TAB}")

Sleep (100)

Send ( "{TAB}")

Sleep (100)

Send ( "{TAB}")

Sleep (100)

Send ( "{TAB}")

Sleep (100)

Send ( "{TAB}")

Sleep (100)

Send ( "{TAB}")

Sleep (100)

Send ( "{RIGHT}")

Sleep (100)

ControlFocus ( "CCleaner", "Opschonen", 3 )

ControlClick ( "CCleaner", "Opschonen", 3 , "left" , 1 )

Sleep (5000) ; wacht 5 seconden

; Begin opschonen sectie Fouten

Send ( "{TAB}")

Sleep (100)

Send ( "{TAB}")

Sleep (100)

Send ( "{TAB}")

Sleep (100)

Send ( "{TAB}")

Sleep (100)

Send ( "{TAB}")

Sleep (100)

Send ( "{TAB}")

Sleep (100)

Send ( "{TAB}")

Sleep (100)

Send ( "{TAB}")

Sleep (100)

Send ( "{RIGHT}")

Sleep (100)

ControlFocus ( "CCleaner", "Scannen naar fouten", 3 )

ControlClick ( "CCleaner", "Scannen naar fouten", 3 , "left" , 1 )

Sleep (5000)

WinWait ( "CCleaner", "Herstel geselecteerde fouten..." )

ControlFocus ( "CCleaner", "Herstel geselecteerde fouten...", 4 )

ControlClick ( "CCleaner", "Herstel geselecteerde fouten...", 4 , "left" , 1 )

;Script not completed yet.

can anyone tell me what to do?

Thanks in advance!!

Edited by Sphaera_ORbis

Share this post


Link to post
Share on other sites

;Opstarten Applicatie


Run("C:\Program Files\CCleaner\ccleaner.exe")
WinWaitActive("CCleaner")

; Begin opschonen sectie Windows

ControlFocus ( "CCleaner", "Opschonen", 3 )
ControlClick ( "CCleaner", "Opschonen", 3 , "left" , 1 ) 

Sleep (2000); wacht 2 seconden


; Begin opschonen sectie Applicaties
; Tab 8 times, with 100 sleep between.

For $i = 1 To 8
    Send ( "{TAB}")
    Sleep (100)
Next
Send ( "{RIGHT}")
Sleep (100)

ControlFocus ( "CCleaner", "Opschonen", 3 )
ControlClick ( "CCleaner", "Opschonen", 3 , "left" , 1 )

Sleep (5000); wacht 5 seconden

    
; Begin opschonen sectie Fouten

For $i = 1 To 8
    Send ( "{TAB}")
    Sleep (100)
Next
Send ( "{RIGHT}")
Sleep (100)

ControlFocus ( "CCleaner", "Scannen naar fouten", 3 )

ControlClick ( "CCleaner", "Scannen naar fouten", 3 , "left" , 1 )

Sleep (5000)

; While the Bottom right start button? is disabled, then just loop, with a 1 second sleep.
; Need to use Au3Info, to correct ControlID.

While 1
    If ControlCommand('CCleaner', '', 'Button?', 'IsEnabled', '') Then ExitLoop
    Sleep(1000)
WEnd
    
WinWait ( "CCleaner", "Herstel geselecteerde fouten..." )

ControlFocus ( "CCleaner", "Herstel geselecteerde fouten...", 4 )

ControlClick ( "CCleaner", "Herstel geselecteerde fouten...", 4 , "left" , 1 )

Cannot test, but may work for you. Basically just checking if a button is enabled, if so then progress.

Edited by MHz

Share this post


Link to post
Share on other sites

Thanks for your response, i'm going to test this and i will let you know if it worked..

For $i = 1 To 8

Send ( "{TAB}")

Sleep (100)

Next

Send ( "{RIGHT}")

Sleep (100)

Nice job ! why didn't i think of that??

;-)

Share this post


Link to post
Share on other sites

The command didn't worked with the Sleep (1000) in between, somehow it got passed the loop and messed up the whole script..

While 1

If ControlCommand ( "CCleaner", "Herstel geselecteerde fouten...", 4, "IsEnabled", "") Then ExitLoop

Sleep (1000)

WEnd

Changed to;

While 1

If ControlCommand ( "CCleaner", "Herstel geselecteerde fouten...", 4, "IsEnabled", "") Then ExitLoop

WEnd

Now it's working.

i pasted the code below for you to see.

But there's 1 more problem right after the script exists the loop. (see attachment)

Does anyone know a way to check those boxes without having to know the exact number of boxes to be checked?

; Start Application

Run("C:\Program Files\CCleaner\ccleaner.exe")

WinWaitActive("CCleaner")

; Begin cleaning of the windows section

ControlFocus ( "CCleaner", "Opschonen", 3 )

ControlClick ( "CCleaner", "Opschonen", 3 , "left" , 1 )

; Wait for button to become active then continue

While 1

If ControlCommand("CCleaner", "Opschonen", 3, "IsEnabled", "") Then ExitLoop

WEnd

; Begin cleaning the applications section

; Tab 8 times, with 100 sleep between.

For $i = 1 To 8

Send ( "{TAB}")

Sleep (100)

Next

Send ( "{RIGHT}")

Sleep (100)

ControlFocus ( "CCleaner", "Opschonen", 3 )

ControlClick ( "CCleaner", "Opschonen", 3 , "left" , 1 )

; Wait for button to become active then continue

While 1

If ControlCommand("CCleaner", "Opschonen", 3, "IsEnabled", "") Then ExitLoop

WEnd

; Begin cleaning errors

For $i = 1 To 8

Send ( "{TAB}")

Sleep (100)

Next

Send ( "{RIGHT}")

Sleep (100)

ControlFocus ( "CCleaner", "Scannen naar fouten", 3 )

ControlClick ( "CCleaner", "Scannen naar fouten", 3 , "left" , 1 )

Sleep (2000)

; Wait for button to become active then continue

While 1

If ControlCommand ( "CCleaner", "Herstel geselecteerde fouten...", 4, "IsEnabled", "") Then ExitLoop

WEnd

Sleep (2000)

ControlFocus ( "CCleaner", "Herstel geselecteerde fouten...", 4 )

ControlClick ( "CCleaner", "Herstel geselecteerde fouten...", 4, "left" , 1 )

Sleep (100)

Send ( "!n")

WinWaitActive("Fix issues")

Sleep (100)

ControlFocus ( "Fix issues", "Herstel alle geselecteerde fouten", 3 )

ControlClick ( "Fix issues", "Herstel alle geselecteerde fouten", 3 , "left" , 1 )

Sleep (100)

Send ( "{ENTER}" )

Sleep (100)

ControlFocus ( "Fix issues", "Sluiten", 5 )

ControlClick ( "Fix issues", "Sluiten", 5 , "left" , 1 )

Sleep (100)

ControlFocus ( "CCleaner", "Sluiten", 6 )

ControlClick ( "CCleaner", "Sluiten", 6 , "left" , 1 )

Sleep (100)

MsgBox ( 1, "CC-auto", "Cleaning Completed" )

Share this post


Link to post
Share on other sites

First I would strongly suggest that you up-date to the new version

Your version is 1.17.094

The latest versions include

v1.19.108 - [18th May 2005]

- Added Portuguese (Brazil) and Finnish languages.

- Fixed IE Autocomplete History shutdown problem.

- Fixed Type Mismatch error in Issue scanner.

- Fixed error in saving options under a restricted account.

- Added support for HKEY_USERS (HKU) in ini files.

- Fixed Real Player cleaning.

- Changed MS Office cleaning (again).

- Minor display tweaks.

v1.19.105 - [2nd May 2005]

- Added automatic update checking.

- New redesigned Options section.

- Issues are now selected by default.>>>>>> this is what you want to do

- Added Cancel button to Analyze feature.

- Tools section now opens much faster.

- Added setting to hide the backup issues prompt.

- Fixed IE Cache cleaning on Non-English systems.

- Fixed website links, so they work on all machines.

- Fixed some window resizing errors.

- Fixed bug in applications tree when switching languages.

- Fixed applications section order with winapp2.ini.

- Fixed bug in shutdown process.

- Fixed bug when invalid cookie is found.

- Fixed 'subscript out of range' error on issue fixing.

- Minor restyling to Tools.

- Adding cleaning for MS Snapshot Viewer.

- Updated eMule cleaning.

- Updated Media Player Classic cleaning.

- Updated MS Office 2003 cleaning.

- Fixed MS Office cleaning to stop settings being deleted.

- Minor tweaks and fixes.

more version info...

But please post your automator when you complete it

Good luck

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

Het script werkt perfect maar... als hij geen fouten vind dan blijft hij hangen en sluit hij niet automatisch af.Ik heb de laatste versie van Ccleaner.

I have the latest version of Ccleaner and the script works fine by me but...

If he found no errors he is not going forward and don't shutdown.


Sapiente vince, rex, noli vincere ferro!

Share this post


Link to post
Share on other sites

Didn't know there was an newer version, i will update the program asap..! thnx Valuater

Yes, Mosquitos that's true, i haven't been able to find a way to solve that issue

If anyone know's a way tell me but if i figure out a way i will post it asap!...

Share this post


Link to post
Share on other sites

Didn't know there was an newer version, i will update the program asap..! thnx Valuater

Yes, Mosquitos that's true, i haven't been able to find a way to solve that issue

If anyone know's a way tell me but if i figure out a way i will post it asap!...

<{POST_SNAPBACK}>

I am assuming this is like a virus/spyware cleaner? Similar to Ad-Aware and Spybot's Search & Destroy?

That being the case... is it possible to right click any of the options and press select all? I know that is an available option in Ad-Aware.

Just a thought,

JS


AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Share this post


Link to post
Share on other sites

I am assuming this is like a virus/spyware cleaner? Similar to Ad-Aware and Spybot's Search & Destroy?

That being the case... is it possible to right click any of the options and press select all? I know that is an available option in Ad-Aware.

Just a thought,

JS

<{POST_SNAPBACK}>

No, its a cleaner only

**** thats the problem, and thats why i developed *XPClean Menu* it invokes

Restore point -Adaware - Microsoft Spyware - file cleaner - reg cleaner - defrag

its a process

And yes, you are correct about the "right click" to select all - it works on her program

**** Everyone should take advantage of Microsoft Spyware ********

Because later this year Microsoft will release *OneCare* a paid subscription

Edited by Valuater

NEWHeader1.png

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...