mr-es335 Posted 13 hours ago Posted 13 hours ago (edited) Good day, I have been unable to obtain an answer to my query regarding the MouseClick() function. Two examples may be beneficial here: #cs The following example WILL produce an error wherein the inital command IS NEVER completed successfully! #ce ; ----------------------------------------------- Opt("MustDeclareVars", 1) ; ----------------------------------------------- Global $iTimeOut = 100 ; ----------------------------------------------- Example1() ; ----------------------------------------------- Func Example1() MouseClick($MOUSE_CLICK_LEFT, 684, 112, 1, 0) Sleep($iTimeOut) Send("{ALTDOWN}") Sleep($iTimeOut) MouseClick($MOUSE_CLICK_LEFT, 486, 112, 1, 0) Sleep($iTimeOut) Send("{ALTUP}") Sleep($iTimeOut) Send("I") Sleep($iTimeOut) MouseClick($MOUSE_CLICK_LEFT, 50, 160, 1, 1) EndFunc ;==>Example1 ; ----------------------------------------------- ============================================ #cs The following example will NOT produce an error wherein the inital command IS completed successfully! #ce ; ----------------------------------------------- Opt("MustDeclareVars", 1) ; ----------------------------------------------- Global $iTimeOut = 100 ; ----------------------------------------------- Example2() ; ----------------------------------------------- Func Example2() Sleep($iTimeOut) MouseClick($MOUSE_CLICK_LEFT, 684, 112, 1, 0) Sleep($iTimeOut) Send("{ALTDOWN}") Sleep($iTimeOut) MouseClick($MOUSE_CLICK_LEFT, 486, 112, 1, 0) Sleep($iTimeOut) Send("{ALTUP}") Sleep($iTimeOut) Send("I") Sleep($iTimeOut) MouseClick($MOUSE_CLICK_LEFT, 50, 160, 1, 1) EndFunc ;==>Example2 ; ----------------------------------------------- My question is, "Is a pause generally required prior to the execution of a MouseClick() function?" What is even "odder" to me is that I often have to execute scripts more-than-once in order to obtain the results that are required!?! "Why?" As always...any assistance in this matter would be greatly appreciated! Thank you all for your time! Edited 13 hours ago by mr-es335 mr-es335 Sentinel Music Studios
Nine Posted 10 hours ago Posted 10 hours ago 3 hours ago, mr-es335 said: Is a pause generally required prior to the execution of a MouseClick() function? No, but... Your last MouseClick is not followed by a Sleep. Probably the reason. mr-es335 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) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
mr-es335 Posted 9 hours ago Author Posted 9 hours ago Nine, May I ask why the last MouseClick should be succeeded by a Sleep? mr-es335 Sentinel Music Studios
Nine Posted 6 hours ago Posted 6 hours ago If you're running this script in a loop, then you are not leaving enough time to the last click to complete. “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) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
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