![]() |
|
#1
|
|||
|
|||
|
Hi all, I'm using an AHK script that is loosely based on the "mouseless poker" scripts found here.
I just started playing on stars, and there are serious problems related to tables stealing focus. Basically what happens is that I switch to the table at the top-left corner using this section ; WindowNW joy5:: CoordMode, Mouse, Screen MouseMove,176,100 MouseGetPos, curPosX, curPosY, curWin WinGetTitle, title, ahk_id %curWin% WinActivate, %title% ; I added this MouseClick below at some point, not really sure why: MouseClick return then consider my decision, then click on the check/fold/raise button that looks like this: ;Fold joy1:: WinGetTitle, title, ahk_id %curWin% WinActivate, %title% if title contains Good Luck { xvar := 240 yvar := 474 } else if title contains Logged In as XXXX { xvar := 470 yvar := 530 } else { xvar := 210 yvar := 495 } MouseClick, left, xvar, yvar Sleep, 100 return (the if/else blocks are something that I added to allow me to play multiple sites at the same time.) The problem is at some point, I'm assuming inside the if/else blocks, the focus changes to some other table, and my mouse clicks end up going to the wrong table (BAD!). So i'm thinking I either need to do something ghetto like this: MouseGetPos, curPosX, curPosY, curWin WinGetTitle, title, ahk_id %curWin% WinActivate, %title% again, right before doing the fold/call/raise mouseclick. This is ghetto because there still seems to be a race condition (though seemlingly much smaller) before the click, or switch to absolute mouse coords (which I'm not sure I know how to do). I'm assuming I can just set a base x/y coord (0/0 for NW, 800/0 for NE, etc) then add that to the button offset coords. how to do absolute coordinates though, anyone know off hand? any better options for getting this done? |
|
|