kibr Posted February 4, 2021 Posted February 4, 2021 Hello there! I have been experimenting with automating google sheets with ControlClick and have a small issue where sometimes it clicks and sometimes it doesn't. I figured this was because the click was happening too fast for the website to register it (Adding a snipper that times the click shows it happen ~80-100 times per second). I was reading the docs and saw that there's "MouseClickDelay" and "MouseClickDownDelay" that may help solve my issue. MouseClickDelay, as explained in the docs adds delay after the click, which works just fine with the syntax Opt("MouseClickDelay", "100") or AutoItSetOption ("MouseClickDelay","100") When I try using MouseClickDownDelay however, absolutely no changes happen and the console still prints out the same click speed no matter the value I give it. Here's the test script: #include <MsgBoxConstants.au3> #include <Misc.au3> #RequireAdmin ;Opt("MouseClickDelay", "100") ;Opt("MouseClickDownDelay", "100") ;AutoItSetOption ("MouseClickDelay","100") AutoItSetOption ("MouseClickDownDelay","100") ControlClick("","","","left",1,75,253) ; Click on the row A column 2 once I attempted using 100 without quotation marks but no luck, is this a bug or am I missing something?
Nine Posted February 4, 2021 Posted February 4, 2021 Since your ControlClick does not provide Windows nor Control info, why don't you use MouseClick ? “They did not know it was impossible, so they did it” ― Mark Twain Reveal hidden contents 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) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
kibr Posted February 4, 2021 Author Posted February 4, 2021 On 2/4/2021 at 2:50 PM, Nine said: Since your ControlClick does not provide Windows nor Control info, why don't you use MouseClick ? Expand Ah yes sorry I should've added more details about that, I have tried to get ControlClick working by specifying window title, control info, instance ID etc and have not been able to get any results out of it. The only case where ControlClick actually clicked once was with the ControlClick("","","","left",1,x,y) configuration. I wanted to try and get it clicking consistently with the MouseClickDownDelay before figuring out how to use window / control info properly (as to not get bad feedback where the script actually works but refuses to click)
Nine Posted February 4, 2021 Posted February 4, 2021 Yes, it seems that MouseClickDownDelay does not apply to ControlClick : Opt("MouseClickDownDelay", 250) Local $hTimer = TimerInit() ControlClick("", "", "", "left", 1, 100, 100) ConsoleWrite (TimerDiff($hTimer) & @CRLF) $hTimer = TimerInit() MouseClick("left", 200, 200, 1, 0) ConsoleWrite (TimerDiff($hTimer) & @CRLF) Opt("MouseClickDownDelay", 10) Opt("MouseClickDelay", 250) $hTimer = TimerInit() ControlClick("", "", "", "left", 2, 100, 100) ConsoleWrite (TimerDiff($hTimer) & @CRLF) $hTimer = TimerInit() MouseClick("left", 200, 200, 2, 0) ConsoleWrite (TimerDiff($hTimer) & @CRLF) And ControlClick is not reacting the same as MouseClick with MouseClickDelay. Not sure if all this is a bug or not... “They did not know it was impossible, so they did it” ― Mark Twain Reveal hidden contents 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) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
kibr Posted February 4, 2021 Author Posted February 4, 2021 On 2/4/2021 at 3:31 PM, Nine said: Yes, it seems that MouseClickDownDelay does not apply to ControlClick : Opt("MouseClickDownDelay", 250) Local $hTimer = TimerInit() ControlClick("", "", "", "left", 1, 100, 100) ConsoleWrite (TimerDiff($hTimer) & @CRLF) $hTimer = TimerInit() MouseClick("left", 200, 200, 1, 0) ConsoleWrite (TimerDiff($hTimer) & @CRLF) Opt("MouseClickDownDelay", 10) Opt("MouseClickDelay", 250) $hTimer = TimerInit() ControlClick("", "", "", "left", 2, 100, 100) ConsoleWrite (TimerDiff($hTimer) & @CRLF) $hTimer = TimerInit() MouseClick("left", 200, 200, 2, 0) ConsoleWrite (TimerDiff($hTimer) & @CRLF) And ControlClick is not reacting the same as MouseClick with MouseClickDelay. Not sure if all this is a bug or not... Expand Interesting, so does ControlClick not technically classify as a click and therefore is unaffected by MouseClickDownDelay? This doesn't really make sense seeing as the name of the options are "MouseClickDelay" and "MouseClickDownDelay" where the former does affect ControlClick but not the latter. Is there a way to achieve the same affect as MouseClickDownDelay in some way together with ControlClick?
kibr Posted February 4, 2021 Author Posted February 4, 2021 On 2/4/2021 at 3:31 PM, Nine said: And ControlClick is not reacting the same as MouseClick with MouseClickDelay. Expand This is odd, I get the exact same results with ControlClick and MouseClick in terms of CPS (clicks per second, according to the timer) with MouseClickDelay, what timings are you getting?
Nine Posted February 4, 2021 Posted February 4, 2021 Please do not quote every thing I said. I know what I have just told you. It makes the topic cumbersome for nothing. Use the reply box at the bottom of the thread instead. With MouseClick it is 2 times the delay (about 500ms) and with ControlClick 1 time delay (250ms), based on the script I post. “They did not know it was impossible, so they did it” ― Mark Twain Reveal hidden contents 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) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Nine Posted February 4, 2021 Posted February 4, 2021 (edited) On 2/4/2021 at 3:34 PM, kibr said: Is there a way to achieve the same affect as MouseClickDownDelay in some way together with ControlClick? Expand I do not think at any way...You can open a ticket in Bug Tracker if you wish to. It may be a bug after all. Edited February 4, 2021 by Nine “They did not know it was impossible, so they did it” ― Mark Twain Reveal hidden contents 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) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
kibr Posted February 4, 2021 Author Posted February 4, 2021 Alright, I'll open a ticket in the Bug Tracker, thanks!
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