Jump to content

Newbie ControlClick() Issues


Alias
 Share

Recommended Posts

I am working on a simple script to simply log into a user defined Tournement (PokerStars) and I am noticing some behaviour from ControlClick() that is really messing me up.

If the button that I want to click on is not visible OR is grayed out ControlClick is still clicking it somehow, it is messing up my if statements.

Is there a better way to do this? P.S. PokerStars doesn't give out much info for the AutoIt Window Info Tool.

Thanks to anyone that can help.

If WinWaitActive("Tournament Registration") then

If ControlClick("Tournament Registration", "OK","[CLASS:Button; INSTANCE:2]") Then
msgbox(64, "Info", "The 'OK' button has been clicked",4)
Sleep (4000)
Else
MsgBox(64,"Info", "The 'OK' button isn't active", 4)
Sleep (4000)
Endif

Endif
Edited by Alias
Link to comment
Share on other sites

If WinWaitActive("Tournament Registration") then
     If ControlCommand("Tournament Registration","OK","[CLASS:Button; INSTANCE:2]","IsVisible","") AND ControlCommand("Tournament Registration","OK","[CLASS:Button; INSTANCE:2]","IsEnabled","") Then
          ControlClick("Tournament Registration", "OK","[CLASS:Button; INSTANCE:2]")
          msgbox(64, "Info", "The 'OK' button has been clicked",4)
          Sleep (4000)
     Else
          MsgBox(64,"Info", "The 'OK' button isn't active", 4)
          Sleep (4000)
     Endif

Endif

Try this?

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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