Sign in to follow this  
Followers 0
revtex

CCleaner Automation Script

5 posts in this topic

ok.. What im trying to do is run a automated script that goes through and "clicks" on each stage of the script.

The problem im having is here:

While 1
    $func1 = ControlCommand("CCleaner", "Fix selected issues...", 4, "IsEnabled", "")
    $func2 = ControlCommand("CCleaner", "Exit", 6, "IsEnabled", "")
    If $func1 = 1 And $func2 = 1 Then ExitLoop
    If $func1 = 0 And $func2 = 1 Then;ContinueLoop
        MouseMove(575,45)
        MouseDown("left")
        MouseUp("left")
        Sleep(2000)
        Exit
    EndIf
WEnd

I get this code from Valuater Automated CrapCleaner v1.19.108 script, Automate cleaning process

Problem im having is when it gets to the "Issues" part of the scan it wont let the scan finnish and run this code "If $func1 = 0 And $func2 = 1 Then" even tho its not yet true.

Can anyone help me out with this?

#region --- ScriptWriter generated code Start ---
$m1 = "No issues were found"
Run('C:\Program Files\CCleaner\ccleaner.exe')
WinWait("CCleaner","")
If Not WinActive("CCleaner","") Then WinActivate("CCleaner","")
WinWaitActive("CCleaner",""); <== Click "Run Cleaner"
MouseMove(536,368)
MouseDown("left")
MouseUp("left")
Sleep(1000)
WinWait("classname=ThunderRT6FormDC","This process will permanently delete files from your system.")
If Not WinActive("classname=ThunderRT6FormDC","") Then WinActivate("classname=ThunderRT6FormDC","")
WinWaitActive("classname=ThunderRT6FormDC","")
;   MouseMove(17,131)
;   MouseDown("left")
;   MouseUp("left")
;   Sleep(1000)
MouseMove(356,39)
MouseDown("left")
MouseUp("left")
Sleep(1000)
WinWait("CCleaner","CLEANING COMPLETE")
If Not WinActive("CCleaner","") Then WinActivate("CCleaner","")
WinWaitActive("CCleaner","")
MouseMove(196,111)
MouseDown("left")
MouseUp("left")
Sleep(1000)
MouseMove(533,368)
MouseDown("left")
MouseUp("left")
Sleep(1000)
WinWait("classname=ThunderRT6FormDC","This process will permanently delete files from your system.")
If Not WinActive("classname=ThunderRT6FormDC","") Then WinActivate("classname=ThunderRT6FormDC","")
WinWaitActive("classname=ThunderRT6FormDC","")
;   MouseMove(17,131)
;   MouseDown("left")
;   MouseUp("left")
;   Sleep(1000)
MouseMove(356,39)
MouseDown("left")
MouseUp("left")
Sleep(1000)
WinWait("CCleaner","CLEANING COMPLETE")
If Not WinActive("CCleaner","") Then WinActivate("CCleaner","")
WinWaitActive("CCleaner","")
MouseMove(46,178)
MouseDown("left")
MouseUp("left")
Sleep(1000)
MouseMove(373,369)
MouseDown("left")
MouseUp("left")
Sleep(1000)
WinWait("CCleaner","")
If Not WinActive("CCleaner","") Then WinActivate("CCleaner","")
WinWaitActive("CCleaner","")
Sleep(1000)
While 1
    $func1 = ControlCommand("CCleaner", "Fix selected issues...", 4, "IsEnabled", "")
    $func2 = ControlCommand("CCleaner", "Exit", 6, "IsEnabled", "")
    If $func1 = 1 And $func2 = 1 Then ExitLoop
    If $func1 = 0 And $func2 = 1 Then;ContinueLoop
        MouseMove(575,45)
        MouseDown("left")
        MouseUp("left")
        Sleep(2000)
        Exit
    EndIf
WEnd
MouseMove(537,370)
MouseDown("left")
MouseUp("left")
Sleep(1000)
WinWait("CCleaner","Do you want to backup changes to the registry?")
If Not WinActive("CCleaner","Do you want to backup changes to the registry?") Then WinActivate("CCleaner","Do you want to backup changes to the registry?")
WinWaitActive("CCleaner","Do you want to backup changes to the registry?")
MouseMove(72,99)
MouseDown("left")
MouseUp("left")
Sleep(1000)
WinWait("Save As","")
If Not WinActive("Save As","") Then WinActivate("Save As","")
WinWaitActive("Save As","")
MouseMove(513,370)
MouseDown("left")
MouseUp("left")
Sleep(1000)
WinWait("Fix issues","")
If Not WinActive("Fix issues","") Then WinActivate("Fix issues","")
WinWaitActive("Fix issues","")
MouseMove(238,224)
MouseDown("left")
MouseUp("left")
Sleep(1000)
WinWait("CCleaner","Are you sure you want to Fix all selected Issues?")
If Not WinActive("CCleaner","Are you sure you want to Fix all selected Issues?") Then WinActivate("CCleaner","Are you sure you want to Fix all selected Issues?")
WinWaitActive("CCleaner","Are you sure you want to Fix all selected Issues?")
MouseMove(89,80)
MouseDown("left")
MouseUp("left")
Sleep(1000)
WinWait("Fix issues","")
If Not WinActive("Fix issues","") Then WinActivate("Fix issues","")
WinWaitActive("Fix issues","")
While 1
    $func1 = ControlCommand("Fix issues", "Fix Issue", 4, "IsEnabled", "")
    $func2 = ControlCommand("Fix issues", "Fix All Selected Isses", 3, "IsEnabled", "")
    $func3 = ControlCommand("Fix issues", "Exit", 5, "IsEnabled","")
    
    If $func1 = 0 And $func2 = 0 And $func3 = 1 Then
        MouseMove(390,225)
        MouseDown("left")
        MouseUp("left")
        Sleep(1000)
        WinWait("CCleaner","")
        If Not WinActive("CCleaner","") Then WinActivate("CCleaner","")
        WinWaitActive("CCleaner","")
        MouseMove(575,45)
        MouseDown("left")
        MouseUp("left")
        Sleep(1000)
        Exit
    EndIf
WEnd

Share this post


Link to post
Share on other sites



Nevermind... found out the problem... it was the "&Fix selected issues..." and "E&xit" ... Didnt know the "&" was a big deal.. :">

Share this post


Link to post
Share on other sites

[... more code...]

Local $runcc = "C:Program FilesCCleanerCCleaner.exe /AUTO"

RUN($runcc)

sleep(1000)

[... more code...]

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