View Single Post
  #3  
Old 01-04-2006, 06:35 AM
MrMoo MrMoo is offline
Senior Member
 
Join Date: Sep 2004
Location: Las Vegas
Posts: 750
Default Re: AutoHotKey on PokerStars

Try this:


Xcall = 405 ; The x coordinate of the call button in a PartyPoker window
Ycall = 475 ; The y coordinate of the call button in a PartyPoker window

MouseGetPos, , , WinID,
WinGetPos, x, y, w, h, ahk_id %winID%
newX := x + Xcall
newY := y + Ycall
WinActivate, ahk_id %winID%
BlockInput
OnMouseClick, left, newX, newY
BlockInput Off
return

There's still a race condition albeit very small. I personally can't think of a way around it. There is always going to be a miniscule chance that the window focus will change between the time you grab the window id and the time you activate the click. You could possibly try assigning two clicks which may have a faster execution than grabbing window id's. But, you might run into issues with misclicks.
Reply With Quote