Open Side Menu Go to the Top
Register
Table Counter AHK for PokerStars Table Counter AHK for PokerStars

06-09-2011 , 02:26 PM
I have $25 for anyone getting this to work on Ongame, ahk_class SunAwtFrame, can search for 'Table' in wintitle. You can count all tables, no need to differentiate tables I am not sitting at. The total table count isn't working, and current table count is counting the lobby, here's what I have:

Code:
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
#SingleInstance,Force

numtables:=0
TotalTabelsOpend:=0


Menu,TableCounter,Add,Minimize To Tray,Minimize
Menu,TableCounter,Add,Reset Counter, ResetCounter
Menu,Tablecounter,Add,Exit,GuiClose

Gui -MaximizeBox  -MinimizeBox +AlwaysOnTop  +Caption  +LastFound ;  Change +/- Caption To remove Or Add titlebar
Gui, Color, 000000
Gui, Font, s20 cWhite, Verdana

Gui,Margin,10,10
Gui, Add, Text, vMyControl Center,0000
Gui, Add, Text, y+ cGreen vTotalTabelsOpend Center,0000
Gui, Show,    AutoSize , Tbls
TabelCounterHwnd:=winExist()

OnMessage(0x201, "WM_LBUTTONDOWN")
SetTimer,TableCounter,1000
REturn    

; NumTables counts evry table ( also Non Seated tables and the Replayer )
; TotalTabelsOpend only Counts tables where you where Seated
; RightClick the window to Get a menu to Reset Or Close TableCounter  | Minimize  To Tray
; Hold Left button down to drag window
; Change -Caption To Remove Titlebar or +Caption To Add Titlebar
 


TableCounter:

    numtables := 0

    ;snippet will find all pokerstars windows
    WinGet, Id, list, ahk_class SunAwtFrame,, Program Manager
    Loop,%Id%
    {
       Hwnd:=id%A_index%
       
       
         numtables += 1
        IF  Hwnd not in  %TableHwndList% 
        { 
        	WinGettitle,Title,ahk_id%hwnd%
      		IF  Instr(Title,"Table")
       		{
        	
                	
                	TableHwndList:= TableHwndList ?  TableHwndList . "," . Hwnd : Hwnd
       				TotalTabelsOpend+=1 
 	        	
       		}    
    	}
   }


    if (numtables != lasttables) OR  (SaveTotalTabelsOpend != TotalTabelsOpend)
    {
      IF TrayCounter 
       WinSetTitle,Ahk_id%TabelCounterHwnd%,,%numtables% / %TotalTabelsOpend% 
       
      GuiControl,, MyControl, %numtables%
        lasttables = %numtables%
        SaveTotalTabelsOpend = %TotalTabelsOpend%
        GuiControl,, TotalTabelsOpend,%TotalTabelsOpend%
    
    }


return

Minimize: 
Gui,Minimize
WinSetTitle,Ahk_id%TabelCounterHwnd%,,%numtables% / %TotalTabelsOpend%
Return

GuiSize:
  TrayCounter := A_EventInfo=1 ? 1 : 0

Return

GuiContextMenu:
Menu, TableCounter, Show  
Return

ResetCounter:
TotalTabelsOpend:=0
GuiControl,, TotalTabelsOpend,0 
Return

GuiClose:
ExitApp

Return
Table Counter AHK for PokerStars Quote
06-09-2011 , 02:39 PM
Quote:
Originally Posted by Bishop22
I have $25 for anyone getting this to work on Ongame, ahk_class SunAwtFrame, can search for 'Table' in wintitle. You can count all tables, no need to differentiate tables I am not sitting at. The total table count isn't working, and current table count is counting the lobby, here's what I have:

Wat is the title of the lobby and Class , and can you post a title of a table that you get from Winspy

Last edited by MaxThread; 06-09-2011 at 02:46 PM.
Table Counter AHK for PokerStars Quote
06-09-2011 , 02:47 PM
Lobby is same class as table, lobby title is RedKings
Table title is: Table #1, Double or Nothing Turbo, No-Limit Texas Hold'em, $xx (real money), xx/xxx [ID= (and then tourney number)
Table Counter AHK for PokerStars Quote
06-09-2011 , 03:37 PM
Quote:
Originally Posted by Bishop22
I have $25 for anyone getting this to work on Ongame, ahk_class SunAwtFrame, can search for 'Table' in wintitle. You can count all tables, no need to differentiate tables I am not sitting at. The total table count isn't working, and current table count is counting the lobby, here's what I have:
With thi you can keep count of tables opened and it wont include lobby(should work on all skins+tourns+bottom counter shows total opened history) BUT

dont expect easy fix for seated-in tables[hard]

Code:
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
#SingleInstance,Force

numtables:=0
TotalTabelsOpend:=0


Menu,TableCounter,Add,Minimize To Tray,Minimize
Menu,TableCounter,Add,Reset Counter, ResetCounter
Menu,Tablecounter,Add,Exit,GuiClose

Gui -MaximizeBox  -MinimizeBox +AlwaysOnTop  +Caption  +LastFound ;  Change +/- Caption To remove Or Add titlebar
Gui, Color, 000000
Gui, Font, s20 cWhite, Verdana

Gui,Margin,10,10
Gui, Add, Text, vMyControl Center,0000
Gui, Add, Text, y+ cGreen vTotalTabelsOpend Center,0000
Gui, Show,    AutoSize , Tbls
TabelCounterHwnd:=winExist()

OnMessage(0x201, "WM_LBUTTONDOWN")
SetTimer,TableCounter,1000
REturn    

; NumTables counts evry table ( also Non Seated tables and the Replayer )
; TotalTabelsOpend only Counts tables where you where Seated
; RightClick the window to Get a menu to Reset Or Close TableCounter  | Minimize  To Tray
; Hold Left button down to drag window
; Change -Caption To Remove Titlebar or +Caption To Add Titlebar
 


TableCounter:

    numtables := 0

    ;snippet will find all pokerstars windows
    WinGet, Id, list, ahk_class SunAwtFrame,, Program Manager
    Loop,%Id%
    {
       Hwnd:=id%A_index%
       WinGettitle,Title,ahk_id%hwnd%
	   
	   if Instr(Title,"ID=")
	{
       
         numtables += 1
        IF  Hwnd not in  %TableHwndList%  
        { 
        	WinGettitle,Title,ahk_id%hwnd%
      		IF  Instr(Title,"ID=")
       		{
        	
                	
                	TableHwndList:= TableHwndList ?  TableHwndList . "," . Hwnd : Hwnd
       				TotalTabelsOpend+=1 
 	        	
       		}    
    	}
		
	}
   }


    if (numtables != lasttables) OR  (SaveTotalTabelsOpend != TotalTabelsOpend)
    {
      IF TrayCounter 
       WinSetTitle,Ahk_id%TabelCounterHwnd%,,%numtables% / %TotalTabelsOpend% 
       
      GuiControl,, MyControl, %numtables%
        lasttables = %numtables%
        SaveTotalTabelsOpend = %TotalTabelsOpend%
        GuiControl,, TotalTabelsOpend,%TotalTabelsOpend%
    
    }


return

Minimize: 
Gui,Minimize
WinSetTitle,Ahk_id%TabelCounterHwnd%,,%numtables% / %TotalTabelsOpend%
Return

GuiSize:
  TrayCounter := A_EventInfo=1 ? 1 : 0

Return

GuiContextMenu:
Menu, TableCounter, Show  
Return

ResetCounter:
TotalTabelsOpend:=0
GuiControl,, TotalTabelsOpend,0 
Return

GuiClose:
ExitApp

Return

Last edited by msim; 06-09-2011 at 03:48 PM.
Table Counter AHK for PokerStars Quote
06-09-2011 , 03:40 PM
Quote:
Originally Posted by Bishop22
Lobby is same class as table, lobby title is RedKings
Table title is: Table #1, Double or Nothing Turbo, No-Limit Texas Hold'em, $xx (real money), xx/xxx [ID= (and then tourney number)
Change : WinGet, Id, list, ahk_class SunAwtFrame,, Program Manager
To : WinGet, Id, list, ahk_class SunAwtFrame,,RedKings

That should stop the current table counter counting the Lobby
that the total counter is not working
Table Counter AHK for PokerStars Quote
06-09-2011 , 04:31 PM
msim's script does what I asked, do you have PMs? I can pay on Stars/Paypal immediately or on Ongame in about a month (acct is new). PM me your payment info.
Table Counter AHK for PokerStars Quote
01-25-2012 , 01:20 PM
THX OP, love it!
Table Counter AHK for PokerStars Quote
01-31-2012 , 09:02 AM
im such a fail
been trying to trade the value of white color (number of tables openned) for another value (total amount of cash made per session) where i edit the current value im making per game i.e 1.2 and it sums 1.2 every game (for the script in this thread, post #22)

should be pretty easy, can someone do this?
for HU players the number of tables is not important we always have a track of those since its few in numbers
Table Counter AHK for PokerStars Quote
01-31-2012 , 01:50 PM
I'm a total ****** when it comes to computers. What the heck is this script and how would i get it to run on my laptop? did i mention that i'm a total ****** already?
Table Counter AHK for PokerStars Quote
02-01-2012 , 12:50 AM
Deepak - do you want to add a single value (i.e $1.2 is your avg earn per game), or (much harder) add actual money won/lost in session?

Striiing - First you need to download and install authotkey (basic) from http://www.autohotkey.com/download/ - then you make a new AHK script, copy paste the code here over the empty template, save and run more detailed info in the software forum FAQ I think.
Table Counter AHK for PokerStars Quote
02-01-2012 , 08:20 AM
i want a single value i.e 1.2$ , just sum that value each game i play

what i did was everytime the TotalTablesOpned variable is added, i also added:
cash += [value]

then variable MyControl to be defined as %cash% and the value is correct but not centered, like instead of appearing 1.2, it showed 12000 (with the 1 mostly cutted )
Table Counter AHK for PokerStars Quote
02-01-2012 , 05:04 PM
have it working with right value
only problem is printing a value that has decimal numbers into the gui =/

someone knows how to do it? i tried defining as type float, or converting to string... no luck so far
Table Counter AHK for PokerStars Quote
02-01-2012 , 05:40 PM
use Round(var,dp) to truncate it at time of display

Last edited by _dave_; 02-01-2012 at 05:40 PM. Reason: or do you mean it isn't showing decimal places and you want it to?
Table Counter AHK for PokerStars Quote
02-01-2012 , 06:12 PM
tried it

but the decimals are correct, if i put 0.6 in the value i want to increment each game, the variable is correctly adding 0.6 each game, the thing is when i print it, instead of showing 0.6
it shows 60000 (with the 6 cutted), next game same thing but 20000 with the 2 cutted

i used the previous code and just tried to change some variables cause i dunno how to mess with autohotkey script

Quote:
TotalTabelsOpend:=0
cash:=0
MyControl = Round(%cash%,2)
....
Gui,Margin,10,10
Gui, Add, Text, c00FFFF vMyControl Center,0000
Gui, Add, Text, y+ cGreen vTotalTabelsOpend Center,0000
Gui, Show, AutoSize , Tbls
cash being the variable i want to print out
and when i take the 0000 of the code, it doesnt work, dunno why is that for
Table Counter AHK for PokerStars Quote
02-01-2012 , 06:42 PM
the 0000 in the above snippet sets the original width the control is created at, you might need to add another to get it wide enough?

post the whole script with your edits, I'll take a look
Table Counter AHK for PokerStars Quote
02-01-2012 , 07:18 PM
ty,
u were right, needed a bunch of 0's for space and the 0.6 showed
but the 0's keep getting at the number on the end now its 0.6000000

code:
didnt add much anyways, and its probs ugly code
ill bold the parts i mess around
Quote:
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#SingleInstance,Force

numtables:=0
TotalTabelsOpend:=0
cash:=0
MyControl = Round(%cash%,2)


Menu,TableCounter,Add,Minimize To Tray,Minimize
Menu,TableCounter,Add,Reset Counter, ResetCounter
Menu,Tablecounter,Add,Exit,GuiClose

Gui -MaximizeBox -MinimizeBox +AlwaysOnTop +Caption +LastFound ; Change +/- Caption To remove Or Add titlebar
Gui, Color, 000000
Gui, Font, s20 cWhite, Verdana

Gui,Margin,10,10
Gui, Add, Text, c00FFFF vMyControl Center,0000000
Gui, Add, Text, y+ cGreen vTotalTabelsOpend Center,0000000
Gui, Show, AutoSize , Tbls
TabelCounterHwnd:=winExist()

OnMessage(0x201, "WM_LBUTTONDOWN")
SetTimer,TableCounter,1000
REturn



; NumTables counts evry table ( also Non Seated tables and the Replayer )
; TotalTabelsOpend only Counts tables where you where Seated
; RightClick the window to Get a menu to Reset Or Close TableCounter | Minimize To Tray
; Hold Left button down to drag window
; Change -Caption To Remove Titlebar or +Caption To Add Titlebar



TableCounter:

numtables := 0

;snippet will find all pokerstars windows
WinGet, Id, list, ahk_class PokerStarsTableFrameClass,, Program Manager
Loop,%Id%
{
Hwnd:=id%A_index%


numtables += 1
IF Hwnd not in %TableHwndList%
{
WinGettitle,Title,ahk_id%hwnd%
IF Instr(Title," Logged In as ")
{


TableHwndList:= TableHwndList ? TableHwndList . "," . Hwnd : Hwnd
TotalTabelsOpend+=1
cash += 0.6

}
}
}


if (numtables != lasttables) OR (SaveTotalTabelsOpend != TotalTabelsOpend)
{
IF TrayCounter
WinSetTitle,Ahk_id%TabelCounterHwnd%,,%numtables% / %TotalTabelsOpend%

GuiControl,, MyControl, %cash%
lasttables = %numtables%
SaveTotalTabelsOpend = %TotalTabelsOpend%
GuiControl,, TotalTabelsOpend,%TotalTabelsOpend%

}


return

Minimize:
Gui,Minimize
WinSetTitle,Ahk_id%TabelCounterHwnd%,,%cash% / %TotalTabelsOpend%
Return

GuiSize:
TrayCounter := A_EventInfo=1 ? 1 : 0

Return

GuiContextMenu:
Menu, TableCounter, Show
Return

ResetCounter:
TotalTabelsOpend:=0
GuiControl,, TotalTabelsOpend,0
Return

GuiClose:
ExitApp

Return
Table Counter AHK for PokerStars Quote
02-02-2012 , 11:08 AM
Quote:
Originally Posted by Deepak
ty,
u were right, needed a bunch of 0's for space and the 0.6 showed
but the 0's keep getting at the number on the end now its 0.6000000

code:
didnt add much anyways, and its probs ugly code
ill bold the parts i mess around
Code:
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#SingleInstance,Force

numtables:=0
TotalTabelsOpend:=0
cash:=0
/
Menu,TableCounter,Add,Minimize To Tray,Minimize
Menu,TableCounter,Add,Reset Counter, ResetCounter
Menu,Tablecounter,Add,Exit,GuiClose

Gui -MaximizeBox -MinimizeBox +AlwaysOnTop +Caption +LastFound ; Change +/- Caption To remove Or Add titlebar
Gui, Color, 000000
Gui, Font, s20 cWhite, Verdana

Gui,Margin,10,10
Gui, Add, Text, c00FFFF vMyControl Center,000000
Gui, Add, Text, y+ cGreen vTotalTabelsOpend Center,000000
Gui, Show, AutoSize , Tbls
TabelCounterHwnd:=winExist()

OnMessage(0x201, "WM_LBUTTONDOWN")
SetTimer,TableCounter,1000
REturn



; NumTables counts evry table ( also Non Seated tables and the Replayer )
; TotalTabelsOpend only Counts tables where you where Seated
; RightClick the window to Get a menu to Reset Or Close TableCounter | Minimize To Tray
; Hold Left button down to drag window
; Change -Caption To Remove Titlebar or +Caption To Add Titlebar



TableCounter:

numtables := 0

;snippet will find all pokerstars windows
WinGet, Id, list, ahk_class PokerStarsTableFrameClass,, Program Manager
Loop,%Id%
{
Hwnd:=id%A_index%


numtables += 1
IF Hwnd not in %TableHwndList%
{
WinGettitle,Title,ahk_id%hwnd%
IF Instr(Title," Logged In as ")
{


TableHwndList:= TableHwndList ? TableHwndList . "," . Hwnd : Hwnd
TotalTabelsOpend+=1
cash :==Round( (Cash+=0.6),2)
stringReplace,Cash,Cash,.00,,
}
}
}


if (numtables != lasttables) OR (SaveTotalTabelsOpend != TotalTabelsOpend)
{
IF TrayCounter
WinSetTitle,Ahk_id%TabelCounterHwnd%,,%numtables% / %TotalTabelsOpend%

GuiControl,, MyControl, %cash%
lasttables = %numtables%
SaveTotalTabelsOpend = %TotalTabelsOpend%
GuiControl,, TotalTabelsOpend,%TotalTabelsOpend%

}


return

Minimize:
Gui,Minimize
WinSetTitle,Ahk_id%TabelCounterHwnd%,,%cash% / %TotalTabelsOpend%
Return

GuiSize:
TrayCounter := A_EventInfo=1 ? 1 : 0

Return

GuiContextMenu:
Menu, TableCounter, Show
Return

ResetCounter:

GuiControl,, TotalTabelsOpend,% TotalTabelsOpend:=0
Return

GuiClose:
ExitApp

Return
Table Counter AHK for PokerStars Quote
02-02-2012 , 05:48 PM
that should do it
Table Counter AHK for PokerStars Quote
02-03-2012 , 11:58 AM
it doesnt show up anything just an empty space as soon as i open my 1st table
rest keeps working fine
Table Counter AHK for PokerStars Quote
02-03-2012 , 12:47 PM
Quote:
Originally Posted by Deepak
it doesnt show up anything just an empty space as soon as i open my 1st table
rest keeps working fine
Code:
#SingleInstance,force
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#SingleInstance,Force

numtables:=0
TotalTabelsOpend:=0
cash:=0

Menu,TableCounter,Add,Minimize To Tray,Minimize
Menu,TableCounter,Add,Reset Counter, ResetCounter
Menu,Tablecounter,Add,Exit,GuiClose

Gui -MaximizeBox -MinimizeBox +AlwaysOnTop +Caption +LastFound ; Change +/- Caption To remove Or Add titlebar
Gui, Color, 000000
Gui, Font, s20 cWhite, Verdana

Gui,Margin,10,10
Gui, Add, Text, c00FFFF vMyControl Center,000000
Gui, Add, Text, y+ cGreen vTotalTabelsOpend Center,000000
Gui, Show, AutoSize , Tbls
TabelCounterHwnd:=winExist()

OnMessage(0x201, "WM_LBUTTONDOWN")
SetTimer,TableCounter,1000
REturn



; NumTables counts evry table ( also Non Seated tables and the Replayer )
; TotalTabelsOpend only Counts tables where you where Seated
; RightClick the window to Get a menu to Reset Or Close TableCounter | Minimize To Tray
; Hold Left button down to drag window
; Change -Caption To Remove Titlebar or +Caption To Add Titlebar



TableCounter:

numtables := 0

;snippet will find all pokerstars windows
WinGet, Id, list, ahk_class PokerStarsTableFrameClass,, Program Manager
Loop,%Id%
{
Hwnd:=id%A_index%


numtables += 1
IF Hwnd not in %TableHwndList%
{
WinGettitle,Title,ahk_id%hwnd%
IF Instr(Title," Logged In as ")
{


TableHwndList:= TableHwndList ? TableHwndList . "," . Hwnd : Hwnd
TotalTabelsOpend+=1
cash:=Round((Cash+=0.6),2) 
stringReplace,Cash,Cash,.00,,

}
}
}


if (numtables != lasttables) OR (SaveTotalTabelsOpend != TotalTabelsOpend)
{
IF TrayCounter
WinSetTitle,Ahk_id%TabelCounterHwnd%,,%numtables% / %TotalTabelsOpend%

GuiControl,, MyControl, %cash%
lasttables = %numtables%
SaveTotalTabelsOpend = %TotalTabelsOpend%
GuiControl,, TotalTabelsOpend,%TotalTabelsOpend%

}


return

Minimize:
Gui,Minimize
WinSetTitle,Ahk_id%TabelCounterHwnd%,,%cash% / %TotalTabelsOpend%
Return

GuiSize:
TrayCounter := A_EventInfo=1 ? 1 : 0

Return

GuiContextMenu:
Menu, TableCounter, Show
Return

ResetCounter:

GuiControl,, TotalTabelsOpend,% TotalTabelsOpend:=0
Return

GuiClose:
ExitApp

Return

Typo cash:== to cash:=
Table Counter AHK for PokerStars Quote
02-03-2012 , 08:29 PM
(L)
tyty
working fine

i even changed Cash to cash cause i didnt know if this was case sensitive or not, but didnt notice that, tho it was a problem in strreplace method or something
Table Counter AHK for PokerStars Quote
09-26-2012 , 07:20 AM
Code:
    numtables := 0
    WinGet, id, count, ahk_class PokerStarsTableFrameClass,, Program Manager
    Loop, %id%
    {
        numtables += 1
    }
I want this to only count 3R 180's, but I fail to exclude the detached chat window from being counted. Why doesn't this work:

Code:
ExcludeTitle = ahk_class PokerStarsTableHelperFrameClass
WinGet, id, count, $3.50+R,, %ExcludeTitle%
Basic idea is to create multiple counters for different buy ins played at once (with detached & merged chat windows).
Table Counter AHK for PokerStars Quote
09-27-2012 , 11:57 AM
Figured it out. This one allows to define 3 different buyins and counts them separately (open/total):



Code:
#SingleInstance, force
#NoTrayIcon
DetectHiddenWindows, On

;=============EDIT BUYINS / COLORS / GUI COORDS HERE=============

BuyIn1 = $2.50
Color1 = FF66FF

BuyIn2 = $3.50+R
Color2 = 00AAFF

BuyIn3 = $8.00
Color3 = 9A2EFE

GuiShow = x1925 y64

;================================================================

Gui -MaximizeBox -Resize -MinimizeBox +AlwaysOnTop +ToolWindow 
Gui, Color, 000000
Gui, Margin, 45, 0
Gui, Font, s18 c%Color1%, Verdana
Gui, Add, Text, vMyControl1 Center, --- / ---
Gui, Margin, 55, -12
Gui, Font, s18 c%Color2%, Verdana
Gui, Add, Text, vMyControl2 Center, --- / ---
Gui, Margin, 55, -12
Gui, Font, s18 c%Color3%, Verdana
Gui, Add, Text, vMyControl3 Center, --- / ---
Gui, Show, %GuiShow%
Gui, Show, W180 H83, Buyin Counter

    num1 = 0
    num2 = 0
    num3 = 0

Loop
{
    v1 := 0
    v2 := 0
    v3 := 0

    c1 := 0
    c2 := 0
    c3 := 0

    WinGet, v1, count, %BuyIn1% ahk_class PokerStarsTableFrameClass
    WinGet, v2, count, %BuyIn2% ahk_class PokerStarsTableFrameClass
    WinGet, v3, count, %BuyIn3% ahk_class PokerStarsTableFrameClass

    Loop, %v1%
    {	
    c1 += 1
    }

    Loop, %v2%
    {	
    c2 += 1
    }

    Loop, %v3%
    {	
    c3 += 1
    }

if (c1 > num1)
    	{
	t1++
       	GuiControl,, MyControl1, %c1% / %t1%
       	num1 = %c1%
    	}
    	else, if (c1 < num1)
    	{
	GuiControl,, MyControl1, %c1% / %t1%
       	num1 = %c1%
    	}

if (c2 > num2)
    	{
	t2++
       	GuiControl,, MyControl2, %c2% / %t2%
       	num2 = %c2%
    	}
    	else, if (c2 < num2)
    	{
	GuiControl,, MyControl2, %c2% / %t2%
       	num2 = %c2%
    	}

if (c3 > num3)
    	{
	t3++
       	GuiControl,, MyControl3, %c3% / %t3%
       	num3 = %c3%
    	}
    	else, if (c3 < num3)
    	{
	GuiControl,, MyControl3, %c3% / %t3%
       	num3 = %c3%
    	}

   Sleep 500

}
return

^q::ExitApp

GuiClose:
ExitApp
Table Counter AHK for PokerStars Quote
09-29-2012 , 08:27 PM
Slightly enhanced version now also shows totals - well, not actually all tables, it only adds all the predefined stakes up. Good thing for SNG is, this way it doesn't count the replayer.

You can set limits for current and total games. If current limit reached it can change the totals counter's color, and it can play a sound when total limit is reached, eg. the PokerStars achievement sound (snd12.wav). It can also play a sound when a table busts/closes.

Works for both cashgames and tourneys, but in cashgames the replayer can't be excluded from being counted.



Code:
#SingleInstance, force
#NoTrayIcon
DetectHiddenWindows, On
SetTitleMatchMode, 2

;===============================CONFIG SECTION==============================

TotalLimit = 100						;desired table limit (total)
CurrentLimit = 16						;desired table limit (current)
CurrentColor1 = 0000FF						;current table limit not reached
CurrentColor2 = 33FF33						;current table limit reached

SoundBust = C:\Program Files (x86)\PokerStars\snd\bust.wav	;sound if table closes
SoundTotal = C:\Program Files (x86)\PokerStars\snd\snd12.wav	;sound if TotalLimit reached
SoundInterval = 10						;after N games the TotalLimit sound repeats

Stake1 = $2.50							;eg. $2.50 or $0.25/$0.50
Color1 = FF66FF							;color for above stake

Stake2 = $3.50+R						;eg. $3.50+R or $0.50/$1
Color2 = 00AAFF							;color for above stake

Stake3 = $8.00							;eg. $8.00 or $5/$10
Color3 = 9A2EFE							;color for above stake

GuiPos = x1925 y5						;position of GUI on screen

;===========================================================================

Gui -MaximizeBox -Resize -MinimizeBox +AlwaysOnTop +ToolWindow 
Gui, Show, %GuiPos%
Gui, Show, W180 H120, TableCount
Gui, Color, 000000
Gui, Margin, 35, 2
Gui, Font, s18 c%CurrentColor1%, Verdana
Gui, Add, Text, vMyControl0 Center, 000 / 000
Gui, Margin,, -4
Gui, Font, s18 c%Color1%, Verdana
Gui, Add, Text, vMyControl1 Center, ---- / ----
Gui, Margin,, -12
Gui, Font, s18 c%Color2%, Verdana
Gui, Add, Text, vMyControl2 Center, ---- / ----
Gui, Margin,, -12
Gui, Font, s18 c%Color3%, Verdana
Gui, Add, Text, vMyControl3 Center, ---- / ----

NewLimit = %TotalLimit%

r0 = 0
r1 = 0
r2 = 0
r3 = 0

t1 = 0
t2 = 0
t3 = 0

Loop
{
    v1 := 0
    v2 := 0
    v3 := 0

    c1 := 0
    c2 := 0
    c3 := 0

    WinGet, v1, count, %Stake1% ahk_class PokerStarsTableFrameClass
    WinGet, v2, count, %Stake2% ahk_class PokerStarsTableFrameClass
    WinGet, v3, count, %Stake3% ahk_class PokerStarsTableFrameClass

    Loop, %v1%
    {	
    c1 += 1
    }

    Loop, %v2%
    {	
    c2 += 1
    }

    Loop, %v3%
    {	
    c3 += 1
    }

    if (c1 > r1)
    		{
		t1++
    		GuiControl,, MyControl1, %c1% / %t1%
    	 	r1 = %c1%
    		}

	else, if (c1 < r1)
    		{
		GuiControl,, MyControl1, %c1% / %t1%
      		r1 = %c1%
    		}

    if (c2 > r2)
    		{
		t2++
       		GuiControl,, MyControl2, %c2% / %t2%
      		r2 = %c2%
    		}

	else, if (c2 < r2)
    		{
		GuiControl,, MyControl2, %c2% / %t2%
       		r2 = %c2%
    		}

    if (c3 > r3)
    		{
		t3++
      	 	GuiControl,, MyControl3, %c3% / %t3%
      	 	r3 = %c3%
    		}

	else, if (c3 < r3)
    		{
		GuiControl,, MyControl3, %c3% / %t3%
       		r3 = %c3%
    		}

    c0 := c3 + c1 + c2
    t0 := t1 + t2 + t3

    GuiControl,, MyControl0, %c0% / %t0%

    if (c0 < r0)
    		{
		GuiControl,, MyControl0, %c0% / %t0%
		SoundPlay, %SoundBust%
    		}
	
    r0 = %c0%

    if (c0 < CurrentLimit)
		{
		Gui, Font, s20 c%CurrentColor1%, Verdana
		GuiControl, Font, MyControl0
		}
	else, if (c0 >= CurrentLimit)
		{
		Gui, Font, s20 c%CurrentColor2%, Verdana
		GuiControl, Font, MyControl0
		}

    if (t0 = NewLimit)
    		{
		GuiControl,, MyControl0, %c0% / %t0%
		SoundPlay, %SoundTotal%
		NewLimit := t0 + SoundInterval
    		}

   Sleep 500

}
return

^q::ExitApp

GuiClose:
ExitApp
Table Counter AHK for PokerStars Quote
09-30-2012 , 12:17 PM
Above version had some bugs which I fixed:
- it displayed "---/---" instead of "0/0" on startup if no tables detected
- it didn't count existing tables correctly on startup
- totals would disappear when exceeding 99
- update interval was too slow

Code:
#SingleInstance, force
#NoTrayIcon
DetectHiddenWindows, On
SetTitleMatchMode, 2

;============================================= CONFIG SECTION ===============================================

GuiPos = x1925 y5						;position of GUI on screen

LoopInterval = 100						;GUI's update interval in msec (1000 = 1sec)

CurrentLimit = 16						;desired table limit (current)
TotalLimit = 100						;desired table limit (total)

SumColor1 = 0000FF						;current table limit not reached
SumColor2 = 33FF33						;current table limit reached

SoundBust = C:\Program Files (x86)\PokerStars\snd\bust.wav	;sound if table closes
SoundTotal = C:\Program Files (x86)\PokerStars\snd\snd12.wav	;sound if TotalLimit reached

SoundInterval = 10						;SoundTotal replays after N additional tables

Stake1 = $2.50							;eg. $2.50 or $0.25/$0.50
Color1 = FF66FF							;color for above stake

Stake2 = $3.50+R						;eg. $3.50+R or $0.50/$1
Color2 = 00AAFF							;color for above stake

Stake3 = $8.00							;eg. $8.00 or $5/$10
Color3 = 9A2EFE							;color for above stake

;============================================================================================================

Gui -MaximizeBox -Resize -MinimizeBox +AlwaysOnTop +ToolWindow 
Gui, Show, %GuiPos%
Gui, Show, W180 H120, TableCount
Gui, Color, 000000
Gui, Margin, 4, 2
Gui, Font, s18 c%SumColor1%, Verdana
Gui, Add, Text, vSum Center, 00000 / 00000
Gui, Margin,, -4
Gui, Font, s18 c%Color1%, Verdana
Gui, Add, Text, vStake1 Center, 00000 / 00000
Gui, Margin,, -12
Gui, Font, s18 c%Color2%, Verdana
Gui, Add, Text, vStake2 Center, 00000 / 00000
Gui, Margin,, -12
Gui, Font, s18 c%Color3%, Verdana
Gui, Add, Text, vStake3 Center, 00000 / 00000

r0 = 0
r1 = 0
r2 = 0
r3 = 0

t1 = 0
t2 = 0
t3 = 0

Loop
{
    v1 := 0
    v2 := 0
    v3 := 0

    c1 := 0
    c2 := 0
    c3 := 0

    WinGet, v1, count, %Stake1% ahk_class PokerStarsTableFrameClass
    WinGet, v2, count, %Stake2% ahk_class PokerStarsTableFrameClass
    WinGet, v3, count, %Stake3% ahk_class PokerStarsTableFrameClass

    Loop, %v1%
    	{	
    	c1 += 1
    	}

    Loop, %v2%
    	{	
    	c2 += 1
    	}

    Loop, %v3%
    	{	
    	c3 += 1
    	}

    if (t1 = 0)
	{
	GuiControl,, Stake1, 0 / 0
    	r1 = 0
	}

    if (t2 = 0)
	{
	GuiControl,, Stake2, 0 / 0
    	r2 = 0
	}

    if (t3 = 0)
	{
	GuiControl,, Stake3, 0 / 0
    	r3 = 0
	}

    if (t1 < c1)
	{
	t1 := c1 - 1
	}

    if (t2 < c2)
	{
	t2 := c2 - 1
	}

    if (t3 < c3)
	{
	t3 := c3 - 1
	}

    if (c1 > r1)
    		{
		t1++
    		GuiControl,, Stake1, %c1% / %t1%
    	 	r1 = %c1%
    		}

	else, if (c1 < r1)
    		{
		GuiControl,, Stake1, %c1% / %t1%
      		r1 = %c1%
    		}

    if (c2 > r2)
    		{
		t2++
       		GuiControl,, Stake2, %c2% / %t2%
      		r2 = %c2%
    		}

	else, if (c2 < r2)
    		{
		GuiControl,, Stake2, %c2% / %t2%
       		r2 = %c2%
    		}

    if (c3 > r3)
    		{
		t3++
      	 	GuiControl,, Stake3, %c3% / %t3%
      	 	r3 = %c3%
    		}

	else, if (c3 < r3)
    		{
		GuiControl,, Stake3, %c3% / %t3%
       		r3 = %c3%
    		}

    c0 := c1 + c2 + c3
    t0 := t1 + t2 + t3

    GuiControl,, Sum, %c0% / %t0%

    if (c0 < r0)
    		{
		GuiControl,, Sum, %c0% / %t0%
		SoundPlay, %SoundBust%
    		}
	
    r0 = %c0%

    if (c0 < CurrentLimit)
		{
		Gui, Font, s22 c%SumColor1%, Verdana
		GuiControl, Font, Sum
		}

	else, if (c0 >= CurrentLimit)
		{
		Gui, Font, s22 c%SumColor2%, Verdana
		GuiControl, Font, Sum
		}

    if (t0 = TotalLimit)
    		{
		GuiControl,, Sum, %c0% / %t0%
		SoundPlay, %SoundTotal%
		TotalLimit := t0 + SoundInterval
    		}

   Sleep %LoopInterval%

}
return

^Q::ExitApp

GuiClose:
ExitApp
Table Counter AHK for PokerStars Quote

      
m