I am writing a script that will automatically click on the Waiting List button on the pokerstars lobby. I tried Click x,y and it works, but the problem with this is that if the focus switched from lobby to table, the raise/call button is clicked–DISASTER.
Looking for solutions, I found that ControlClick can do the job for me, but I can’t get the script to work. I read about the parameters needed for ControlClick to work, and using different combinations of the paramters that I found using WindowSpy, I can’t get the script to work.
Here are some of the lines I have already tried–
a::
SetControlDelay -1
ControlClick PokerStarsButtonClass34, PokerStars Lobby, Waiting List
return
a::
SetControlDelay -1
ControlClick x900 y65, Pokerstars Lobby, Waiting List
return
can you help me fix this–thanks
First, I would try omitting the WinText parameter of your
ControlClickcalls (that means removing the trailing “, Waiting List”) because I’m not sure if the Stars Lobby actually has that text as part of its text visible via the window spy. The WinTitle should be enough.If you search the AHK forums, you will find that there are many threads of people complaining that
ControlClickis not properly sending clicks to buttons or windows. So your problem is not unique.Now, afaik
ControlClickis just a wrapper for sendingWM_LBUTTONDOWNmessages. But, in some cases, sending the messages directly actually does work, whenControlClickfails. In fact, this function is commonly used in AHK scripts designed for Pokerstars.So you can try the above function and see if it works. You’ll need to get the handle of the lobby first, with something like
lobbyhwnd := WinExist("Pokerstars Lobby")and then passlobbyhwndas the third param to the above function.If it doesn’t work, I would suggest just using
Clicknormally, but explicitly activating the lobby before sending the click, that way you can be certain that the click gets sent to the correct window. For example: