Jump to content

CCleaner Automation Script


Recommended Posts

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

  • 7 years later...

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...