StMaSi Posted August 2, 2021 Share Posted August 2, 2021 I have a script I'm working on and I just about have it complete...save one piece of functionality. The script proceeds through 3 or 4 different screens (depending on the series of button clicks), but one of the automated ControlClick() commands works (welcome screen), but the same automated ControlClick() commands fails (defer screen). Can anyone provide some insight as to why the aforementioned ControlClick() isn't working, but the first one does? I've attached a basic flowchart of how the code is supposed to work as well as the code. Thanx in advance. code.txt Link to comment Share on other sites More sharing options...
Danp2 Posted August 2, 2021 Share Posted August 2, 2021 Instead of this -- ControlClick($Form_Defer, "Update", $Button1_Defer) have you tried without the "Update" check, like this? ControlClick($Form_Defer, "", $Button1_Defer) Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Nine Posted August 2, 2021 Share Posted August 2, 2021 Another possibility is that your timer expires before the window shows up. ControlClick would error out then. BTW, I cannot emphase it more, put some error handling in your code. It will not hurt you. And at least you would know when a statement fails... NassauSky 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
StMaSi Posted August 2, 2021 Author Share Posted August 2, 2021 Danp2, blanking the text data element made no difference. As you'll note, the first welcome screen was already that way, but works without issue. Nine, the expiration of the timer (while the defer screen is visible), is what is supposed to trigger the controlclick, as in the first welcome screen. Also, what suggestions would you make as pertains to error handling? Link to comment Share on other sites More sharing options...
Danp2 Posted August 2, 2021 Share Posted August 2, 2021 When I run your code, it causes Autoit to crash. Haven't determined the actual cause yet, but one issue I see is that your timers continue to run even if the user clicks the button. You can observe this by putting a ConsoleWrite statement at the beginning of _Countdown_Welcome and _Countdown_Defer. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
StMaSi Posted August 2, 2021 Author Share Posted August 2, 2021 Weird. It's never crashed for me. With what you're saying about the timers, must be that the "_Timer_KillTimer" commands aren't doing anything? Link to comment Share on other sites More sharing options...
Nine Posted August 2, 2021 Share Posted August 2, 2021 As @Danp2and I suggested, put some error handling. One easiest way is to ConsoleWrite return value AND @error after each statement to understand which of the lines is failing. The way you programmed your script is like a blind running a 100m. He may get in the right direction and win. But what happens when he runs against the crowd ? “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Danp2 Posted August 2, 2021 Share Posted August 2, 2021 AFAICS, you only call _Timer_KillTimer if the timer gets to zero. You should also be killing the timer if the user clicks one of the buttons. You would either need to save the timer ID and then pass it to _Timer_KillTimer or you could call _Timer_KillAllTimers with the window's handle. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Nine Posted August 2, 2021 Share Posted August 2, 2021 Beside, I do not really like _Timer* functions UDF. Consider using AdLib* functions. They are simpler to use and do not interfere between each other. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy 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