Jump to content

Recommended Posts

Posted (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 by mr-es335

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...