feistcomputers Posted September 28, 2015 Posted September 28, 2015 I am trying to automate about 5 programs to basically click the buttons i would click. Should be pretty simple if you i knew more but just beginning and starting to get the hang of it. I hate to bug you all but been working on this for 3hrs , testing, searching for info. and i'm stuck. Here is my code.#RequireAdminRun (@ScriptDir & '\CCleaner.exe'); Always use this, it does mapping using the window versus the the whole screen, because every computer can have diff. resolutions.; have to change it in the info getter too. options/coordmode/windowsAutoItSetOption ('MouseCoordMode', 0);Waits for our window to come upWinWait("Piriform CCleaner");When it see's it the windows gets activated right away.WinActivate("Piriform CCleaner");primary means left click mouse, secondary means to right click. coord for where button is from info from mouse tab on into tool. 1 means 1 click.MouseClick('primary', 727, 530, 1, 0); Close the temporary warning msgbox - Got this to work , snippet i found on forum so figured use same for chrome waring also. If WinWait('', 'Do not show me this message again', 4) Then WinActivate("", 'Do not show me this message again') ControlClick('', 'Do not show me this message again', 1, 'left', 1) EndIf ; Close the temporary chrome warning msgbox - comes up with closing program, it is set to button 1 just like first one, but can get past it now. If WinWait('', 'Do you want CCleaner to close Google Chrome', 4) Then WinActivate("", 'Do you want CCleaner to close Google Chrome') ControlClick('', 'Do you want CCleaner to close Google Chrome', 1, 'left', 1) EndIfSleep (300)WinWait("Piriform CCleaner")WinActivate("Piriform CCleaner")MouseClick('primary', 716, 521, 1, 0) so if chromes not open i get to here. it does the clean. now how to i get it to watch for the " run cleaner button" to be active again and not greyed out. Once this shows active i can move on to next step but cant find much info on it. tried looking for ifenabled. I do alot of scans for virus infections. and waiting is part of the game for me. If i can get these to work that means less work and more time with my kids. GOAL any help appreciated. i watched tut.orial 9 & 10. Can you recommend any others for basic push buttons and wait secnario. Thanks for any help.
computergroove Posted September 28, 2015 Posted September 28, 2015 https://www.piriform.com/docs/ccleaner/advanced-usage/command-line-parameters Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html
feistcomputers Posted September 28, 2015 Author Posted September 28, 2015 On 9/28/2015 at 4:18 AM, computergroove said: https://www.piriform.com/docs/ccleaner/advanced-usage/command-line-parametersThankyou ComputerGroove, that just solved two my issues. Just one to go. I can put 5min wait timer on here if i have to do it. But i would rather have autoit see that button become ungreyed out and move onto the next step. Can anyone please point me in the right direction. thanks for the help.
VenusProject2 Posted September 28, 2015 Posted September 28, 2015 Just a quick heads up on posting code, please use the add code icon"<>" in the toobar, e.g. your script:#RequireAdmin Run (@ScriptDir & '\CCleaner.exe') ; Always use this, it does mapping using the window versus the the whole screen, because every computer can have diff. resolutions. ; have to change it in the info getter too. options/coordmode/windows AutoItSetOption ('MouseCoordMode', 0) ;Waits for our window to come up WinWait("Piriform CCleaner") ;When it see's it the windows gets activated right away. WinActivate("Piriform CCleaner") ;primary means left click mouse, secondary means to right click. coord for where button is from info from mouse tab on into tool. 1 means 1 click. MouseClick('primary', 727, 530, 1, 0) ; Close the temporary warning msgbox - Got this to work , snippet i found on forum so figured use same for chrome waring also. If WinWait('', 'Do not show me this message again', 4) Then WinActivate("", 'Do not show me this message again') ControlClick('', 'Do not show me this message again', 1, 'left', 1) EndIf ; Close the temporary chrome warning msgbox - comes up with closing program, it is set to button 1 just like first one, but can get past it now. If WinWait('', 'Do you want CCleaner to close Google Chrome', 4) Then WinActivate("", 'Do you want CCleaner to close Google Chrome') ControlClick('', 'Do you want CCleaner to close Google Chrome', 1, 'left', 1) EndIf Sleep (300) WinWait("Piriform CCleaner") WinActivate("Piriform CCleaner") MouseClick('primary', 716, 521, 1, 0)
VenusProject2 Posted September 28, 2015 Posted September 28, 2015 (edited) From "Autoit Window Info" determine the color of the greyed button a hexidecimal representation of the color e.g.'c0c0c0'Use something like PixelGetColor (see AutoIT Help for more information)Usually something like: (Note haven't tested)$Color_Gray = 'C0C0C0' $Color_Green = '00FF00' MouseClick('left', x, y) While 1 If Hex(PixelGetColor(x, y), 6) = $Color_Green Then ExitLoop Sleep(100) Wend Edited September 28, 2015 by VenusProject2 tight while loop
Bert Posted September 28, 2015 Posted September 28, 2015 if you have the paid version of ccleaner you can use command line to run it. The Vollatran project My blog: http://www.vollysinterestingshit.com/
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now