yeah i did this a while ago for my own use
Simple script to auto close the PartyPoker popup which says:
"Due to an extended period of inactivity, your connection has been terminated.
Please click on OK to re-establish the connection"
author: greg nice (2+2)
SetTimer, PopupSearch, 1000, on
if ( popuphwnd := WinExist("PartyPoker ahk_class #32770", "Due to an extended period of inactivity"))
ControlClick, Button1, ahk_id %popuphwnd%