Alias Posted January 14, 2009 Share Posted January 14, 2009 (edited) 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 January 14, 2009 by Alias Link to comment Share on other sites More sharing options...
azure Posted January 14, 2009 Share Posted January 14, 2009 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 More sharing options...
Alias Posted January 14, 2009 Author Share Posted January 14, 2009 Thanks for the quick response azure, that worked perfectly! 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