erika87 Posted July 31, 2016 Share Posted July 31, 2016 Hello My first post here and i hope i do everything right. I am pretty new to Autoit and heard about it from a friend. Until recently I only made very small and easy automations for my PC. Recently I tried to automate the installing of my accounting program the other day, but wasn't able to do it. I always have to update the program each time I start it, which starts downloading updates - it often takes more than 20 minutes. Afterwards it asks for install. I would have liked to automate the install process. I want the program to do the click on install after the download has finished. The screen changes when the download finishes and so I thought I could make some kind of survey which looks for a pixel change and then clicks on a specific position. I looked around on the internet for a while and wasnt able to find a solution (everything I tried failed) Now I found this website and hope one of you kind souls could help me do this. Your help would be much appreciated Have a nice start into the new week! Link to comment Share on other sites More sharing options...
SadBunny Posted August 1, 2016 Share Posted August 1, 2016 (edited) Well, with as little information as this it's hard to offer anything substantial. Ideally the installation process uses a GUI with standard Windows controls, which makes it easy to automate. Try the Au3Info tool from Scite (Ctrl+F6, if it doesn't work make sure you installed the full version, the top one from here). You can use that to inspect the installer window and check for windows controls. Then you can use commands like WinExists, WinWaitActive and many others to interact with the installer window, and commands like ControlClick, ControlSend to interact with specific controls. Check the helpfile under Function Reference -> Window Management. See how far you get, and if you get stuck, be sure to ask a more specific question and post the code you managed to come up with, and if possible some screenshots of the window(s) you have trouble with, so there's something to actually help you with /edit: but first make sure that your installer doesn't simply have a "silent" mode where you run it with some commandline paratemeter to make it run automatically in the background without bothering the user. Many installers do. Edited August 1, 2016 by SadBunny Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
erika87 Posted August 1, 2016 Author Share Posted August 1, 2016 Thank you for the reply I tried the info tool with the latest version, but it doesn't seem to work with the program window. I do not think its a standart Windows GUI and unfortunately I couldn't find a silent mode or something comparable. I found this code on google searching and think it is pretty close to what i need: Dim $color, $tmp While Sleep(20000) $color = PixelGetColor(x, y) If $color<>$tmp Then "Have to add mouseclick here with the correct position" EndIf WEnd The way I understood this it creates 2 variables with the same color value. Afterwards it surveys the value of $color and if the $tmp and $color are different the action will be carried out. Maybe someone can point me to an error in the code Thank you! Link to comment Share on other sites More sharing options...
SadBunny Posted August 1, 2016 Share Posted August 1, 2016 Please post your code in code tags (the <> button above the reply box), that way it looks like this: Dim $color, $tmp While Sleep(20000) $color = PixelGetColor(x, y) If $color <> $tmp Then "Have to add mouseclick here with the correct position" EndIf WEnd And yes, it creates two variables ($color and $tmp), but they are empty when created. The only thing the loop does is assign the color of your pixel on coordinates x,y to the $color variable, then see whether it is something else than $tmp. As nothing is in $tmp, any value stored in $color will be different than $tmp, so the "have to add" will activate. For a mouse click, you can use the MouseClick() function. This code will not work as is, as 1) you have to replace the x,y with actual numbers (or variables storing those numbers), and 2) obviously you will have to add the mouse clicking code. Having said all that... It is really quite typical for office applications like accounting software to not use standard windows controls in their installers. Automating a gui by pixelhunting and mouseclicking coordinates is notoriously unreliable and almost never necessary. If you could, please post a screenshot (black out any privacy info of course); it will be much easier for everyone to provide better assistance. Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
water Posted August 1, 2016 Share Posted August 1, 2016 Can you post a screenshot of the Control tab of the Window Info Tool? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
erika87 Posted August 1, 2016 Author Share Posted August 1, 2016 @Sadbunny: I changed the things you mentioned and it works now like a charm. I tried it with another program and it seems reliable. Whenever the pixel changes the click is executed. @water: when I click into the program with that targetting function everything stays blank. I am not sure why it does. You helped me alot, TYVM guys :) Link to comment Share on other sites More sharing options...
SadBunny Posted August 1, 2016 Share Posted August 1, 2016 Did you unfreeze the au3info tool? Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
water Posted August 1, 2016 Share Posted August 1, 2016 The AutoIt Window Info Tool should at least show some info for the window. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
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