Two Plus Two Newer Archives  

Go Back   Two Plus Two Newer Archives > Internet Gambling > Software
FAQ Community Calendar Today's Posts Search

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-03-2006, 01:47 PM
jba jba is offline
Senior Member
 
Join Date: Feb 2005
Posts: 9,596
Default AutoHotKey on PokerStars

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?
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:18 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.