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

05-17-2013 , 07:48 PM
Quote:
Originally Posted by greg nice
seems like an easy enough request, that script seems to take a roundabout approach to it. if i have time tonight ill do it
Appreciate it. Cheers.
Table Counter AHK for PokerStars Quote
05-18-2013 , 08:29 AM
Quote:
Originally Posted by MeleaB
Hi. Is anyone able to help?

I'd like an AHK that simply displays the number of current Pokerstars cash games that the player is seated at.

The below post includes a counter that increments whenever a cash table is joined, but it doesn't decrease when a table is left. I've tried taking a look to see if I could figure it out but with no success!

I happily transfer the cost of a drink or two (or more if it's a time-consuming task.)
no idea what that top number was for that incremented by 0.60 with each table

i just kept it simple:

Code:
#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%
#SingleInstance,Force
SetTitleMatchMode, 2

   Menu,TableCounter,Add,Minimize To Tray,Minimize
   Menu,Tablecounter,Add,Exit,GuiClose

   Gui -MaximizeBox -MinimizeBox +AlwaysOnTop +Caption +LastFound
   Gui, Color, 000000
   Gui, Font, s20 cWhite, Verdana

   Gui, Margin,10,10
   Gui, Add, Text, cGreen vTotalTabelsOpend Center,000000
   Gui, Show, AutoSize , Tbls

   SetTimer,TableCounter,1000
   
return



TableCounter:
   WinGet, idcount, list, Logged In as ahk_class PokerStarsTableFrameClass,, Program Manager
   GuiControl,, TotalTabelsOpend, %idcount%
return


Minimize:
   Gui,Minimize
Return


GuiContextMenu:
   Menu, TableCounter, Show
Return


GuiClose:
   ExitApp
Return
Table Counter AHK for PokerStars Quote
05-18-2013 , 06:04 PM
^Cool.

Thanks for that. What's your SN? I'll ship you $20 for your help.
Table Counter AHK for PokerStars Quote
05-18-2013 , 08:55 PM
i'm from usa so not possible. if you wanna donate paypal thats cool

support (at) stackandtile (dot) com

but def not necessary. this is "free software" forum after all
Table Counter AHK for PokerStars Quote
05-19-2013 , 01:13 AM
^$20 sent via PayPal. Cheers.
Table Counter AHK for PokerStars Quote
05-19-2013 , 02:44 AM
appreciated
Table Counter AHK for PokerStars Quote
06-18-2013 , 08:53 PM
Posting customized version upon request (too many characters to PM):



Code:
#SingleInstance, force
;#NoTrayIcon
DetectHiddenWindows, On
SetTitleMatchMode, 2					;1=start 2=contain 3=exact match

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

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

GuiPos = x3636 y5						;position of GUI on screen 
										;move the window where you want it to be, then use WindowSpy to grab its coords
										
LoopInterval = 100						;counter update interval in msec (1000 = 1sec, default = 100)

Stake1 = $3.50 							;eg. "$3.50+R"
Stake2 = $7.00							;eg. "$8.00"
Stake3 = $3.50							;eg. "$15.00"
Stake4 = $7.00							;eg. "$35.00"
Stake5 = $2.50							
Stake6 = Gtd							;eg. "Gtd"

Players1 = 18 Players
Players2 = 18 Players
Players3 = 45 Players
Players4 = 45 Players
Players5 = 180 Players

Color1 = 00AAFF 						;color for table counter - stake1 
Color2 = 00AAFF							;color for table counter - stake2 
Color3 = ffff00							;color for table counter - stake3 
Color4 = ffff00 						;color for table counter - stake4 
Color5 = ff0000 						;color for table counter - stake5
Color6 = 00ff00 						;color for table counter - stake6

CurrentLimit = 14						;desired table limit (current)
TotalLimit = 100						;desired table limit (session)
SoundInterval = 25						;SoundAchieve replays after "TotalLimit" + N tables
SessionTimeLimit = 6:00					;desired session time limit (h:mm)
MaxABI = 25								;maximum desired ABI (current & session)
MaxInvest = 2000						;maximum desired investment (session)

LimitColor = 33FF33						;color of 'SessionTime' and 'TotalTables' counters after reaching their set limits 
ClockColorBreak = FF0000				;clock color indicating sync tourney break (CCCCCC to disable this option)

RebuyMulti = 3							;stake multiplier for rebuy tourneys (ABI/Stake) 
										;!!!EDIT LINE 436!!! 
										
;=========================================== CONFIG HOTKEYS AT BOTTOM OF THE SCRIPT =============================================

;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

;============================================================ GUI ===============================================================

Gui -MaximizeBox -Resize +AlwaysOnTop +ToolWindow -MinimizeBox
Gui, Show, W194 H408 %GuiPos%, SessionMan 2.2	
Gui, Color, 000000		
;___________________________________________________________ TOTALS _____________________________________________________________
						
Gui, Font, s22 cCCCCCC, Verdana					
Gui, Add, Text, x-8 y1 vTotalTables Center, 00000 / 00000	
								
Gui, Font, s18 c555555, Verdana					
Gui, Add, Text, x7 y14 Center, ____________				
;___________________________________________________________ STAKE 1 ____________________________________________________________
									
Gui, Font, s8 c%Color1%, Verdana				
Gui, Add, Text, x27 y45 vControl1 Center, 00000000000000000000
								
Gui, Font, s16 c%Color1%, Verdana				
Gui, Add, Text, x20 y57 vStake1 Center, 00000 / 00000		
;........................................................... STAKE 2 ............................................................
								
Gui, Font, s8 c%Color2%, Verdana				
Gui, Add, Text, x27 y89 vControl2 Center, 00000000000000000000
								
Gui, Font, s16 c%Color2%, Verdana				
Gui, Add, Text, x20 y101 vStake2 Center, 00000 / 00000		
;........................................................... STAKE 3 ............................................................
								
Gui, Font, s8 c%Color3%, Verdana				
Gui, Add, Text, x27 y133 vControl3 Center, 00000000000000000000
								
Gui, Font, s16 c%Color3%, Verdana				
Gui, Add, Text, x20 y145 vStake3 Center, 00000 / 00000		
;........................................................... STAKE 4 ............................................................
								
Gui, Font, s8 c%Color4%, Verdana				
Gui, Add, Text, x27 y177 vControl4 Center, 00000000000000000000
								
Gui, Font, s16 c%Color4%, Verdana			
Gui, Add, Text, x20 y189 vStake4 Center, 00000 / 00000			
;........................................................... STAKE 5 ............................................................
								
Gui, Font, s8 c%Color5%, Verdana				
Gui, Add, Text, x27 y221 vControl5 Center, 00000000000000000000
								
Gui, Font, s16 c%Color5%, Verdana			
Gui, Add, Text, x20 y233 vStake5 Center, 00000 / 00000			
;........................................................... STAKE 6 ............................................................
								
Gui, Font, s8 c%Color6%, Verdana				
Gui, Add, Text, x27 y265 vControl6 Center, 00000000000000000000
								
Gui, Font, s16 c%Color6%, Verdana			
Gui, Add, Text, x20 y277 vStake6 Center, 00000 / 00000	
;____________________________________________________________ BUYIN _____________________________________________________________
						
Gui, Font, s18 c555555, Verdana							
Gui, Add, Text, x7 y285 Center, ____________	

Gui, Font, s11 c999999, Verdana					
Gui, Add, Text, x12 y318 vTotalABI Center, $0000.00 / $0000.00	
;___________________________________________________________ CLOCK/TIME _________________________________________________________		
								
Gui, Font, s18 c555555, Verdana							
Gui, Add, Text, x7 y318 Center, ____________

Gui, Font, s20 cCCCCCC, Verdana					
Gui, Add, Text, x41 y349 vClock Center, 000:000			
								
Gui, Font, s12 c999999, Verdana					
Gui, Font, Bold						
Gui, Add, Text, x73 y382 vSessionTime Center, 00:00		
;================================================================================================================================	

GuiControl,, Control1, %Stake1% - %Players1%
GuiControl,, Control2, %Stake2% - %Players2%
GuiControl,, Control3, %Stake3% - %Players3%
GuiControl,, Control4, %Stake4% - %Players4%
GuiControl,, Control5, %Stake5% - %Players5%
GuiControl,, Control6, %Stake6% 
;--------------------------------------------------------------------------------------------------------------------------------

Buyin_Total := 0.00
Buyin_Total_TournamentCounter := 0

H = 0
M1 = 0
M2 = -1

r0 = 0
r1 = 0
r2 = 0
r3 = 0
r4 = 0
r5 = 0
r6 = 0

t1 = 0
t2 = 0
t3 = 0
t4 = 0
t5 = 0
t6 = 0

P = 0



;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::


Loop
{
;------------------------------------------------------------ STAKE 1 -----------------------------------------------------------
  
    v1 := 0
    c1 := 0

    WinGet, v1, count, %Stake1% NL Hold'em [%Players1% ahk_class PokerStarsTableFrameClass

    Loop, %v1%
    	{	
    	c1 += 1
    	}

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

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

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

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

    v2 := 0
    c2 := 0

    WinGet, v2, count, %Stake2% NL Hold'em [%Players2% ahk_class PokerStarsTableFrameClass

    Loop, %v2%
    	{	
    	c2 += 1
    	}

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

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

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

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

    v3 := 0
    c3 := 0

    WinGet, v3, count, %Stake3% NL Hold'em [%Players3% ahk_class PokerStarsTableFrameClass

    Loop, %v3%
    	{	
    	c3 += 1
    	}

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

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

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

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

    v4 := 0
    c4 := 0

    WinGet, v4,count, %Stake4% NL Hold'em [%Players4% ahk_class PokerStarsTableFrameClass 

    Loop, %v4%
    	{	
    	c4 += 1
    	}

    if (t4 = 0)
		{
		GuiControl,, Stake4, 0 / 0
    	r4 = 0
		}

    if (t4 < c4)
		{
		t4 := c4 - 1
		}

    if (c4 > r4)
    	{
		t4++
    	GuiControl,, Stake4, %c4% / %t4%
    	 r4 = %c4%
    	}

	else, if (c4 < r4)
    	{
		GuiControl,, Stake4, %c4% / %t4%
      	r4 = %c4%
    	}
;----------------------------------------------------------- STAKE 5 ------------------------------------------------------------

    v5 := 0
    c5 := 0

    WinGet, v5,count, %Stake5% NL Hold'em [%Players5% ahk_class PokerStarsTableFrameClass

    Loop, %v5%
    	{	
    	c5 += 1
    	}

    if (t5 = 0)
		{
		GuiControl,, Stake5, 0 / 0
    	r5 = 0
		}

    if (t5 < c5)
		{
		t5 := c5 - 1
		}

    if (c5 > r5)
    	{
		t5++
    	GuiControl,, Stake5, %c5% / %t5%
    	r5 = %c5%
    	}

	else, if (c5 < r5)
    	{
		GuiControl,, Stake5, %c5% / %t5%
      	r5 = %c5%
    	}
;----------------------------------------------------------- STAKE 6 ------------------------------------------------------------

    v6 := 0
    c6 := 0

    WinGet, v6,count, %Stake6% ahk_class PokerStarsTableFrameClass

    Loop, %v6%
    	{	
    	c6 += 1
    	}

    if (t6 = 0)
		{
		GuiControl,, Stake6, 0 / 0
    	r6 = 0
		}

    if (t6 < c6)
		{
		t6 := c6 - 1
		}

    if (c6 > r6)
    	{
		t6++
    	GuiControl,, Stake6, %c6% / %t6%
    	r6 = %c6%
    	}

	else, if (c6 < r6)
    	{
		GuiControl,, Stake6, %c6% / %t6%
      	r6 = %c6%
    	}
;----------------------------------------------------------- TOTALS -------------------------------------------------------------

    c0 := c1 + c2 + c3 + c4 + c5 + c6
    t0 := t1 + t2 + t3 + t4 + t5 + t6

    GuiControl,, TotalTables, %c0% / %t0%

    if (c0 < r0)
    	{
		SoundPlay, %SoundBust%
    	}
	
    r0 = %c0%

    if (c0 < CurrentLimit)
		{
		Gui, Font, s22 cCCCCCC, Verdana
		GuiControl, Font, TotalTables
		}

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

    if (t0 = TotalLimit)
    	{
		SoundPlay, %SoundAchieve%
		TotalLimit := t0 + SoundInterval
    	}
;----------------------------------------------------------- BUYIN --------------------------------------------------------------

Buyin_Dollars:=0.00
Buyin_Dollars_TournamentCounter:=0
Buyin_Euro:=0.00
Buyin_Euro_TournamentCounter:=0
Buyin_Session:=0.00	
Buyin_Session_TournamentCounter:=0
		
Winget,Ps_Hwnd_list,List,Ahk_Class PokerStarsTableFrameClass

Loop %Ps_Hwnd_List%
{
	Hwnd:=Ps_Hwnd_List%A_index%
	IF  !(Buyin_%hwnd%)
		{
		WingetTitle,Title,Ahk_id%Hwnd%
		IF Instr(Title,"Tournament")
			{
			IF Buyin_%Hwnd%:=GetBuyin(Title,Buyin_%Hwnd%_Currency)
				{
 				BuyIn_hwnd_list:=BuyIn_hwnd_list ? BuyIn_hwnd_list "," Hwnd : Hwnd
				Buyin_Total:=Round(Buyin_Total+Buyin_%Hwnd%,2)
			    	Buyin_Total_TournamentCounter+=1
				}
			}
		}			
}	

Loop,Parse,Buyin_Hwnd_List,`,,
{
        Hwnd:=A_LoopField      
	IF WinExist("ahk_id" Hwnd)
        	{
		Currency:=Buyin_%hwnd%_Currency	
		Buyin:=Round(Buyin_%hwnd%,2)
		IF (Currency="$")
			{	
			Buyin_Dollars:=Round(Buyin_Dollars+Buyin,2)
		        Buyin_Dollars_TournamentCounter+=1
			}
		Else  IF (Currency="€")
			{		
			Buyin_Euro:=Round(Buyin_Euro+Buyin,2)
			Buyin_Euro_TournamentCounter+=1
			}		
		Buyin_Session:=Round(Buyin_Session+Buyin,2)
		Buyin_Session_TournamentCounter+=1
		}
	Else
                { 
		Temp_list:="," Buyin_Hwnd_List "," 
		StringReplace,Temp_list,Temp_list,`,Hwnd`,,,    
	        StringTrimLeft,Temp_list,Temp_list,1
		StringTrimRight,Buyin_Hwnd_List,Temp_list,1       
		}
}	
	
IF (BuyIn_Dollars_Save != BuyIn_Dollars) Or (BuyIn_Euro_Save != BuyIn_Euro) 
{
	BuyIn_Euro_Save:=BuyIn_Euro	
	BuyIn_Euro_Avg:= Round(BuyIn_Euro/BuyIn_Euro_TournamentCounter,2)		
	BuyIn_Dollars_Save:=BuyIn_Dollars
	BuyIn_Dollars_Avg:=Round(BuyIn_Dollars/BuyIn_Dollars_TournamentCounter,2)
	BuyIn_Session_Avg:=Round(BuyIn_Session/BuyIn_Session_TournamentCounter,2)
	BuyIn_Total_Avg:=Round(BuyIn_Total/BuyIn_Total_TournamentCounter,2)
		GuiControl,,Dollars,% "$" Buyin_Dollars_Avg " / $" BuyIn_Dollars
		GuiControl,,TotalABI,% "$" BuyIn_Total_Avg " / $" BuyIn_Total
		TotalBI := Round(BuyIn_Total-BuyIn_Dollars,2)
		GuiControl,,TotalBI,% "$" TotalBI "" 
}

GetBuyin(Title,byref currency="",Byref BuyinText="")
	{
	Static CurrencyList:="$,€"
 	Haystack:=Substr(Title, Instr(Title,"Sat:")+1) ;This is for satiliets
    Loop,Parse,Currencylist,`,
    	{
        IF ((StartPosBuyin := Instr(Haystack,A_loopField)) And (EndPosBuyin := Instr(Haystack,A_space,"",StartPosBuyin)))
          	{          
           	BuyinText:=Substr(Haystack,StartPosBuyin ,(EndPosBuyin - StartPosBuyin))
         	Currency=%A_loopField%
          	Buyin:=BuyinText
	  		StringReplace,Buyin,Buyin,%Currency%,, 
			IfInString, Buyin, +R
				{	
          		StringReplace,Buyin,Buyin,+R,, 
				RebuyMulti = 3
				Buyin := Buyin * RebuyMulti					
				}
             
			IF Buyin is not number
				{ 
				Buyin:=0
				currency:=
				buyinText:=    
				}
			Break     
			}
		}
	Return Buyin 
	}
	
;----------------------------------------------------------- CLOCK --------------------------------------------------------------

FormatTime, Time, %A_Now%, H:mm
GuiControl,, Clock, %Time%
StringTrimLeft, TimeOnly, A_Now, 10
StringTrimRight, Minutes, TimeOnly, 2
IfGreaterOrEqual, Minutes, 55
	{
	Gui, Font, s20 c%ClockColorBreak%
	Gui, Font, Bold
	GuiControl, Font, Clock
	}
else
	{
	Gui, Font, s20 cCCCCCC
	Gui, Font, Bold
	GuiControl, Font, Clock
	}
;----------------------------------------------------------- TIME ---------------------------------------------------------------

If (Minutes != Var)
	{
	M2 += 1
	GuiControl,, SessionTime, %H%:%M1%%M2%
	Var := Minutes
	}

If (M2 > 9)
	{
	M1 += 1
	M2 = 0
	GuiControl,, SessionTime, %H%:%M1%%M2%
	}

If (M1 > 5)
	{
	H += 1
	M1 = 0
	M2 = 0
	GuiControl,, SessionTime, %H%:%M1%%M2%
	}
	
Limit = %H%:%M1%%M2%
If (Limit = SessionTimeLimit)
	{
	Gui, Font, s12 c%LimitColor%, Verdana
	GuiControl, Font, SessionTime
	}
;----------------------------------------------------------- LOOP ---------------------------------------------------------------

   Sleep %LoopInterval%

}
return
;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::: HOTKEYS :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

^F9::				;counter (SessionTime) reset
{
H = 0
M1 = 0
M2 = 0
Gui, Font, s12 c999999, Verdana
GuiControl, Font, SessionTime
GuiControl,, SessionTime, %H%:%M1%%M2%
}
return
;................................................................................................................................

^F10::				;counter (SessionTime) + 1
Var = -1
return
;................................................................................................................................

^Q::ExitApp
;................................................................................................................................

!Pause::Pause
;................................................................................................................................

GuiClose:
ExitApp
Table Counter AHK for PokerStars Quote
08-17-2013 , 12:17 PM
For Bao:

Code:
#SingleInstance, force
;#NoTrayIcon
DetectHiddenWindows, On
SetTitleMatchMode, 1					;1=start 2=contain 3=exact match

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

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

GuiPos = x1000 y5						;position of GUI on screen 
										;move the window where you want it to be, then use WindowSpy to grab its coords
										
LoopInterval = 100						;counter update interval in msec (1000 = 1sec, default = 100)

Stake1 = $15.00 							;eg. "$15.00"
Stake2 = $30.00							;eg. "$30.00"
Stake3 = $60.00							;eg. "$60.00"
Stake4 = $100.00							;eg. "$100.00"
Stake5 = $15.00							;eg. "$15.00"


Players1 = 18 Players
Players2 = 18 Players
Players3 = 18 Players
Players4 = 18 Players
Players5 = 45 Players



Color1 = 00AAFF 						;color for table counter - stake1 
Color2 = 00AAFF							;color for table counter - stake2 
Color3 = 00AAFF							;color for table counter - stake3 
Color4 = 00AAFF 						;color for table counter - stake4 
Color5 = ff0000 						;color for table counter - stake5


CurrentLimit = 400						;desired table limit (current)
TotalLimit = 3000						;desired table limit (session)
SoundInterval = 25						;SoundAchieve replays after "TotalLimit" + N tables
SessionTimeLimit = 60:00					;desired session time limit (h:mm)
MaxABI = 2000								;maximum desired ABI (current & session)
MaxInvest = 100000						;maximum desired investment (session)

LimitColor = 33FF33						;color of 'SessionTime' and 'TotalTables' counters after reaching their set limits 
ClockColorBreak = FF0000				;clock color indicating sync tourney break (CCCCCC to disable this option)

RebuyMulti = 3							;stake multiplier for rebuy tourneys (ABI/Stake) 
										;!!!EDIT LINE 436!!! 
										
;=========================================== CONFIG HOTKEYS AT BOTTOM OF THE SCRIPT =============================================

;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

;============================================================ GUI ===============================================================

Gui -MaximizeBox -Resize +AlwaysOnTop +ToolWindow -MinimizeBox
Gui, Show, W194 H408 %GuiPos%, SessionMan 2.2	
Gui, Color, 000000		
;___________________________________________________________ TOTALS _____________________________________________________________
						
Gui, Font, s22 cCCCCCC, Verdana					
Gui, Add, Text, x-8 y1 vTotalTables Center, 00000 / 00000	
								
Gui, Font, s18 c555555, Verdana					
Gui, Add, Text, x7 y14 Center, ____________				
;___________________________________________________________ STAKE 1 ____________________________________________________________
									
Gui, Font, s8 c%Color1%, Verdana				
Gui, Add, Text, x27 y45 vControl1 Center, 00000000000000000000
								
Gui, Font, s16 c%Color1%, Verdana				
Gui, Add, Text, x20 y57 vStake1 Center, 00000 / 00000		
;........................................................... STAKE 2 ............................................................
								
Gui, Font, s8 c%Color2%, Verdana				
Gui, Add, Text, x27 y89 vControl2 Center, 00000000000000000000
								
Gui, Font, s16 c%Color2%, Verdana				
Gui, Add, Text, x20 y101 vStake2 Center, 00000 / 00000		
;........................................................... STAKE 3 ............................................................
								
Gui, Font, s8 c%Color3%, Verdana				
Gui, Add, Text, x27 y133 vControl3 Center, 00000000000000000000
								
Gui, Font, s16 c%Color3%, Verdana				
Gui, Add, Text, x20 y145 vStake3 Center, 00000 / 00000		
;........................................................... STAKE 4 ............................................................
								
Gui, Font, s8 c%Color4%, Verdana				
Gui, Add, Text, x27 y177 vControl4 Center, 00000000000000000000
								
Gui, Font, s16 c%Color4%, Verdana			
Gui, Add, Text, x20 y189 vStake4 Center, 00000 / 00000			
;........................................................... STAKE 5 ............................................................
								
Gui, Font, s8 c%Color5%, Verdana				
Gui, Add, Text, x27 y221 vControl5 Center, 00000000000000000000
								
Gui, Font, s16 c%Color5%, Verdana			
Gui, Add, Text, x20 y233 vStake5 Center, 00000 / 00000			
;........................................................... STAKE 6 ............................................................
								
Gui, Font, s8 c%Color6%, Verdana				
Gui, Add, Text, x27 y265 vControl6 Center, 00000000000000000000
								
Gui, Font, s16 c%Color6%, Verdana			
Gui, Add, Text, x20 y277 vStake6 Center, 00000 / 00000	
;____________________________________________________________ BUYIN _____________________________________________________________
						
Gui, Font, s18 c555555, Verdana							
Gui, Add, Text, x7 y285 Center, ____________	

Gui, Font, s11 c999999, Verdana					
Gui, Add, Text, x12 y318 vTotalABI Center, $0000.00 / $0000.00	
;___________________________________________________________ CLOCK/TIME _________________________________________________________		
								
Gui, Font, s18 c555555, Verdana							
Gui, Add, Text, x7 y318 Center, ____________

Gui, Font, s20 cCCCCCC, Verdana					
Gui, Add, Text, x41 y349 vClock Center, 000:000			
								
Gui, Font, s12 c999999, Verdana					
Gui, Font, Bold						
Gui, Add, Text, x73 y382 vSessionTime Center, 00:00		
;================================================================================================================================	

GuiControl,, Control1, %Stake1% - %Players1%
GuiControl,, Control2, %Stake2% - %Players2%
GuiControl,, Control3, %Stake3% - %Players3%
GuiControl,, Control4, %Stake4% - %Players4%
GuiControl,, Control5, %Stake5% - %Players5%
GuiControl,, Control6, %Stake6% - %Players6%
;--------------------------------------------------------------------------------------------------------------------------------

Buyin_Total := 0.00
Buyin_Total_TournamentCounter := 0

H = 0
M1 = 0
M2 = -1

r0 = 0
r1 = 0
r2 = 0
r3 = 0
r4 = 0
r5 = 0
r6 = 0

t1 = 0
t2 = 0
t3 = 0
t4 = 0
t5 = 0
t6 = 0

P = 0



;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::


Loop
{
;------------------------------------------------------------ STAKE 1 -----------------------------------------------------------
  
    v1 := 0
    c1 := 0

    WinGet, v1, count, %Stake1% NL Hold'em [%Players1% ahk_class PokerStarsTableFrameClass

    Loop, %v1%
    	{	
    	c1 += 1
    	}

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

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

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

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

    v2 := 0
    c2 := 0

    WinGet, v2, count, %Stake2% NL Hold'em [%Players2% ahk_class PokerStarsTableFrameClass

    Loop, %v2%
    	{	
    	c2 += 1
    	}

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

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

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

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

    v3 := 0
    c3 := 0

    WinGet, v3, count, %Stake3% NL Hold'em [%Players3% ahk_class PokerStarsTableFrameClass

    Loop, %v3%
    	{	
    	c3 += 1
    	}

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

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

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

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

    v4 := 0
    c4 := 0

    WinGet, v4,count, %Stake4% NL Hold'em [%Players4% ahk_class PokerStarsTableFrameClass 

    Loop, %v4%
    	{	
    	c4 += 1
    	}

    if (t4 = 0)
		{
		GuiControl,, Stake4, 0 / 0
    	r4 = 0
		}

    if (t4 < c4)
		{
		t4 := c4 - 1
		}

    if (c4 > r4)
    	{
		t4++
    	GuiControl,, Stake4, %c4% / %t4%
    	 r4 = %c4%
    	}

	else, if (c4 < r4)
    	{
		GuiControl,, Stake4, %c4% / %t4%
      	r4 = %c4%
    	}
;----------------------------------------------------------- STAKE 5 ------------------------------------------------------------

    v5 := 0
    c5 := 0

    WinGet, v5,count, %Stake5% NL Hold'em [%Players5% ahk_class PokerStarsTableFrameClass

    Loop, %v5%
    	{	
    	c5 += 1
    	}

    if (t5 = 0)
		{
		GuiControl,, Stake5, 0 / 0
    	r5 = 0
		}

    if (t5 < c5)
		{
		t5 := c5 - 1
		}

    if (c5 > r5)
    	{
		t5++
    	GuiControl,, Stake5, %c5% / %t5%
    	r5 = %c5%
    	}

	else, if (c5 < r5)
    	{
		GuiControl,, Stake5, %c5% / %t5%
      	r5 = %c5%
    	}
;----------------------------------------------------------- STAKE 6 ------------------------------------------------------------

    v6 := 0
    c6 := 0

    WinGet, v6,count, %Stake6% ahk_class PokerStarsTableFrameClass

    Loop, %v6%
    	{	
    	c6 += 1
    	}

    if (t6 = 0)
		{
		GuiControl,, Stake6, 0 / 0
    	r6 = 0
		}

    if (t6 < c6)
		{
		t6 := c6 - 1
		}

    if (c6 > r6)
    	{
		t6++
    	GuiControl,, Stake6, %c6% / %t6%
    	r6 = %c6%
    	}

	else, if (c6 < r6)
    	{
		GuiControl,, Stake6, %c6% / %t6%
      	r6 = %c6%
    	}
;----------------------------------------------------------- TOTALS -------------------------------------------------------------

    c0 := c1 + c2 + c3 + c4 + c5 + c6
    t0 := t1 + t2 + t3 + t4 + t5 + t6

    GuiControl,, TotalTables, %c0% / %t0%

    if (c0 < r0)
    	{
		SoundPlay, %SoundBust%
    	}
	
    r0 = %c0%

    if (c0 < CurrentLimit)
		{
		Gui, Font, s22 cCCCCCC, Verdana
		GuiControl, Font, TotalTables
		}

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

    if (t0 = TotalLimit)
    	{
		SoundPlay, %SoundAchieve%
		TotalLimit := t0 + SoundInterval
    	}
;----------------------------------------------------------- BUYIN --------------------------------------------------------------

Buyin_Dollars:=0.00
Buyin_Dollars_TournamentCounter:=0
Buyin_Euro:=0.00
Buyin_Euro_TournamentCounter:=0
Buyin_Session:=0.00	
Buyin_Session_TournamentCounter:=0
		
Winget,Ps_Hwnd_list,List,Ahk_Class PokerStarsTableFrameClass

Loop %Ps_Hwnd_List%
{
	Hwnd:=Ps_Hwnd_List%A_index%
	IF  !(Buyin_%hwnd%)
		{
		WingetTitle,Title,Ahk_id%Hwnd%
		IF Instr(Title,"Tournament")
			{
			IF Buyin_%Hwnd%:=GetBuyin(Title,Buyin_%Hwnd%_Currency)
				{
 				BuyIn_hwnd_list:=BuyIn_hwnd_list ? BuyIn_hwnd_list "," Hwnd : Hwnd
				Buyin_Total:=Round(Buyin_Total+Buyin_%Hwnd%,2)
			    	Buyin_Total_TournamentCounter+=1
				}
			}
		}			
}	

Loop,Parse,Buyin_Hwnd_List,`,,
{
        Hwnd:=A_LoopField      
	IF WinExist("ahk_id" Hwnd)
        	{
		Currency:=Buyin_%hwnd%_Currency	
		Buyin:=Round(Buyin_%hwnd%,2)
		IF (Currency="$")
			{	
			Buyin_Dollars:=Round(Buyin_Dollars+Buyin,2)
		        Buyin_Dollars_TournamentCounter+=1
			}
		Else  IF (Currency="€")
			{		
			Buyin_Euro:=Round(Buyin_Euro+Buyin,2)
			Buyin_Euro_TournamentCounter+=1
			}		
		Buyin_Session:=Round(Buyin_Session+Buyin,2)
		Buyin_Session_TournamentCounter+=1
		}
	Else
                { 
		Temp_list:="," Buyin_Hwnd_List "," 
		StringReplace,Temp_list,Temp_list,`,Hwnd`,,,    
	        StringTrimLeft,Temp_list,Temp_list,1
		StringTrimRight,Buyin_Hwnd_List,Temp_list,1       
		}
}	
	
IF (BuyIn_Dollars_Save != BuyIn_Dollars) Or (BuyIn_Euro_Save != BuyIn_Euro) 
{
	BuyIn_Euro_Save:=BuyIn_Euro	
	BuyIn_Euro_Avg:= Round(BuyIn_Euro/BuyIn_Euro_TournamentCounter,2)		
	BuyIn_Dollars_Save:=BuyIn_Dollars
	BuyIn_Dollars_Avg:=Round(BuyIn_Dollars/BuyIn_Dollars_TournamentCounter,2)
	BuyIn_Session_Avg:=Round(BuyIn_Session/BuyIn_Session_TournamentCounter,2)
	BuyIn_Total_Avg:=Round(BuyIn_Total/BuyIn_Total_TournamentCounter,2)
		GuiControl,,Dollars,% "$" Buyin_Dollars_Avg " / $" BuyIn_Dollars
		GuiControl,,TotalABI,% "$" BuyIn_Total_Avg " / $" BuyIn_Total
		TotalBI := Round(BuyIn_Total-BuyIn_Dollars,2)
		GuiControl,,TotalBI,% "$" TotalBI "" 
}

GetBuyin(Title,byref currency="",Byref BuyinText="")
	{
	Static CurrencyList:="$,€"
 	Haystack:=Substr(Title, Instr(Title,"Sat:")+1) ;This is for satiliets
    Loop,Parse,Currencylist,`,
    	{
        IF ((StartPosBuyin := Instr(Haystack,A_loopField)) And (EndPosBuyin := Instr(Haystack,A_space,"",StartPosBuyin)))
          	{          
           	BuyinText:=Substr(Haystack,StartPosBuyin ,(EndPosBuyin - StartPosBuyin))
         	Currency=%A_loopField%
          	Buyin:=BuyinText
	  		StringReplace,Buyin,Buyin,%Currency%,, 
			IfInString, Buyin, +R
				{	
          		StringReplace,Buyin,Buyin,+R,, 
				RebuyMulti = 3
				Buyin := Buyin * RebuyMulti					
				}
             
			IF Buyin is not number
				{ 
				Buyin:=0
				currency:=
				buyinText:=    
				}
			Break     
			}
		}
	Return Buyin 
	}
	
;----------------------------------------------------------- CLOCK --------------------------------------------------------------

FormatTime, Time, %A_Now%, H:mm
GuiControl,, Clock, %Time%
StringTrimLeft, TimeOnly, A_Now, 10
StringTrimRight, Minutes, TimeOnly, 2
IfGreaterOrEqual, Minutes, 55
	{
	Gui, Font, s20 c%ClockColorBreak%
	Gui, Font, Bold
	GuiControl, Font, Clock
	}
else
	{
	Gui, Font, s20 cCCCCCC
	Gui, Font, Bold
	GuiControl, Font, Clock
	}
;----------------------------------------------------------- TIME ---------------------------------------------------------------

If (Minutes != Var)
	{
	M2 += 1
	GuiControl,, SessionTime, %H%:%M1%%M2%
	Var := Minutes
	}

If (M2 > 9)
	{
	M1 += 1
	M2 = 0
	GuiControl,, SessionTime, %H%:%M1%%M2%
	}

If (M1 > 5)
	{
	H += 1
	M1 = 0
	M2 = 0
	GuiControl,, SessionTime, %H%:%M1%%M2%
	}
	
Limit = %H%:%M1%%M2%
If (Limit = SessionTimeLimit)
	{
	Gui, Font, s12 c%LimitColor%, Verdana
	GuiControl, Font, SessionTime
	}
;----------------------------------------------------------- LOOP ---------------------------------------------------------------

   Sleep %LoopInterval%

}
return
;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::: HOTKEYS :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

^F9::				;counter (SessionTime) reset
{
H = 0
M1 = 0
M2 = 0
Gui, Font, s12 c999999, Verdana
GuiControl, Font, SessionTime
GuiControl,, SessionTime, %H%:%M1%%M2%
}
return
;................................................................................................................................

^F10::				;counter (SessionTime) + 1
Var = -1
return
;................................................................................................................................

^Q::ExitApp
;................................................................................................................................

!Pause::Pause
;................................................................................................................................

GuiClose:
ExitApp
Code:
#SingleInstance, force
;#NoTrayIcon
DetectHiddenWindows, On
SetTitleMatchMode, 1					;1=start 2=contain 3=exact match

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

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

GuiPos = x1000 y5						;position of GUI on screen 
										;move the window where you want it to be, then use WindowSpy to grab its coords
										
LoopInterval = 100						;counter update interval in msec (1000 = 1sec, default = 100)

Stake1 = $15.00 							;eg. "$15.00"
Stake2 = $30.00							;eg. "$30.00"
Stake3 = $60.00							;eg. "$60.00"
Stake4 = $100.00							;eg. "$100.00"
						
						

Players1 = [Turbo
Players2 = [Turbo
Players3 = [Turbo
Players4 = [Turbo



Color1 = ffff00	 						;color for table counter - stake1 
Color2 = ffff00								;color for table counter - stake2 
Color3 = ffff00							;color for table counter - stake3 
Color4 = ffff00 						;color for table counter - stake4 



CurrentLimit = 400						;desired table limit (current)
TotalLimit = 3000						;desired table limit (session)
SoundInterval = 25						;SoundAchieve replays after "TotalLimit" + N tables
SessionTimeLimit = 60:00					;desired session time limit (h:mm)
MaxABI = 20000								;maximum desired ABI (current & session)
MaxInvest = 100000						;maximum desired investment (session)

LimitColor = 33FF33						;color of 'SessionTime' and 'TotalTables' counters after reaching their set limits 
ClockColorBreak = FF0000				;clock color indicating sync tourney break (CCCCCC to disable this option)

RebuyMulti = 3							;stake multiplier for rebuy tourneys (ABI/Stake) 
										;!!!EDIT LINE 436!!! 
										
;=========================================== CONFIG HOTKEYS AT BOTTOM OF THE SCRIPT =============================================

;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

;============================================================ GUI ===============================================================

Gui -MaximizeBox -Resize +AlwaysOnTop +ToolWindow -MinimizeBox
Gui, Show, W194 H408 %GuiPos%, SessionMan 2.2	
Gui, Color, 000000		
;___________________________________________________________ TOTALS _____________________________________________________________
						
Gui, Font, s22 cCCCCCC, Verdana					
Gui, Add, Text, x-8 y1 vTotalTables Center, 00000 / 00000	
								
Gui, Font, s18 c555555, Verdana					
Gui, Add, Text, x7 y14 Center, ____________				
;___________________________________________________________ STAKE 1 ____________________________________________________________
									
Gui, Font, s8 c%Color1%, Verdana				
Gui, Add, Text, x27 y45 vControl1 Center, 00000000000000000000
								
Gui, Font, s16 c%Color1%, Verdana				
Gui, Add, Text, x20 y57 vStake1 Center, 00000 / 00000		
;........................................................... STAKE 2 ............................................................
								
Gui, Font, s8 c%Color2%, Verdana				
Gui, Add, Text, x27 y89 vControl2 Center, 00000000000000000000
								
Gui, Font, s16 c%Color2%, Verdana				
Gui, Add, Text, x20 y101 vStake2 Center, 00000 / 00000		
;........................................................... STAKE 3 ............................................................
								
Gui, Font, s8 c%Color3%, Verdana				
Gui, Add, Text, x27 y133 vControl3 Center, 00000000000000000000
								
Gui, Font, s16 c%Color3%, Verdana				
Gui, Add, Text, x20 y145 vStake3 Center, 00000 / 00000		
;........................................................... STAKE 4 ............................................................
								
Gui, Font, s8 c%Color4%, Verdana				
Gui, Add, Text, x27 y177 vControl4 Center, 00000000000000000000
								
Gui, Font, s16 c%Color4%, Verdana			
Gui, Add, Text, x20 y189 vStake4 Center, 00000 / 00000			
;........................................................... STAKE 5 ............................................................
								
Gui, Font, s8 c%Color5%, Verdana				
Gui, Add, Text, x27 y221 vControl5 Center, 00000000000000000000
								
Gui, Font, s16 c%Color5%, Verdana			
Gui, Add, Text, x20 y233 vStake5 Center, 00000 / 00000			
;........................................................... STAKE 6 ............................................................
								
Gui, Font, s8 c%Color6%, Verdana				
Gui, Add, Text, x27 y265 vControl6 Center, 00000000000000000000
								
Gui, Font, s16 c%Color6%, Verdana			
Gui, Add, Text, x20 y277 vStake6 Center, 00000 / 00000	
;____________________________________________________________ BUYIN _____________________________________________________________
						
Gui, Font, s18 c555555, Verdana							
Gui, Add, Text, x7 y285 Center, ____________	

Gui, Font, s11 c999999, Verdana					
Gui, Add, Text, x12 y318 vTotalABI Center, $0000.00 / $0000.00	
;___________________________________________________________ CLOCK/TIME _________________________________________________________		
								
Gui, Font, s18 c555555, Verdana							
Gui, Add, Text, x7 y318 Center, ____________

Gui, Font, s20 cCCCCCC, Verdana					
Gui, Add, Text, x41 y349 vClock Center, 000:000			
								
Gui, Font, s12 c999999, Verdana					
Gui, Font, Bold						
Gui, Add, Text, x73 y382 vSessionTime Center, 00:00		
;================================================================================================================================	

GuiControl,, Control1, %Stake1% - 9 Players
GuiControl,, Control2, %Stake2% - 9 Players
GuiControl,, Control3, %Stake3% - 9 Players
GuiControl,, Control4, %Stake4% - 9 Players

;--------------------------------------------------------------------------------------------------------------------------------

Buyin_Total := 0.00
Buyin_Total_TournamentCounter := 0

H = 0
M1 = 0
M2 = -1

r0 = 0
r1 = 0
r2 = 0
r3 = 0
r4 = 0
r5 = 0
r6 = 0

t1 = 0
t2 = 0
t3 = 0
t4 = 0
t5 = 0
t6 = 0

P = 0



;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::


Loop
{
;------------------------------------------------------------ STAKE 1 -----------------------------------------------------------
  
    v1 := 0
    c1 := 0

    WinGet, v1, count, %Stake1% NL Hold'em [%9players% ahk_class PokerStarsTableFrameClass

    Loop, %v1%
    	{	
    	c1 += 1
    	}

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

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

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

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

    v2 := 0
    c2 := 0

    WinGet, v2, count, %Stake2% NL Hold'em [%9players% ahk_class PokerStarsTableFrameClass

    Loop, %v2%
    	{	
    	c2 += 1
    	}

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

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

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

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

    v3 := 0
    c3 := 0

    WinGet, v3, count, %Stake3% NL Hold'em [%9players% ahk_class PokerStarsTableFrameClass

    Loop, %v3%
    	{	
    	c3 += 1
    	}

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

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

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

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

    v4 := 0
    c4 := 0

    WinGet, v4,count, %Stake4% NL Hold'em [%9players% ahk_class PokerStarsTableFrameClass 

    Loop, %v4%
    	{	
    	c4 += 1
    	}

    if (t4 = 0)
		{
		GuiControl,, Stake4, 0 / 0
    	r4 = 0
		}

    if (t4 < c4)
		{
		t4 := c4 - 1
		}

    if (c4 > r4)
    	{
		t4++
    	GuiControl,, Stake4, %c4% / %t4%
    	 r4 = %c4%
    	}

	else, if (c4 < r4)
    	{
		GuiControl,, Stake4, %c4% / %t4%
      	r4 = %c4%
    	}
;----------------------------------------------------------- STAKE 5 ------------------------------------------------------------

    v5 := 0
    c5 := 0

    WinGet, v5,count, %Stake5% NL Hold'em [%9players% ahk_class PokerStarsTableFrameClass

    Loop, %v5%
    	{	
    	c5 += 1
    	}

    if (t5 = 0)
		{
		GuiControl,, Stake5, 0 / 0
    	r5 = 0
		}

    if (t5 < c5)
		{
		t5 := c5 - 1
		}

    if (c5 > r5)
    	{
		t5++
    	GuiControl,, Stake5, %c5% / %t5%
    	r5 = %c5%
    	}

	else, if (c5 < r5)
    	{
		GuiControl,, Stake5, %c5% / %t5%
      	r5 = %c5%
    	}
;----------------------------------------------------------- STAKE 6 ------------------------------------------------------------

    v6 := 0
    c6 := 0

    WinGet, v6,count, %Stake6% ahk_class PokerStarsTableFrameClass

    Loop, %v6%
    	{	
    	c6 += 1
    	}

    if (t6 = 0)
		{
		GuiControl,, Stake6, 0 / 0
    	r6 = 0
		}

    if (t6 < c6)
		{
		t6 := c6 - 1
		}

    if (c6 > r6)
    	{
		t6++
    	GuiControl,, Stake6, %c6% / %t6%
    	r6 = %c6%
    	}

	else, if (c6 < r6)
    	{
		GuiControl,, Stake6, %c6% / %t6%
      	r6 = %c6%
    	}
;----------------------------------------------------------- TOTALS -------------------------------------------------------------

    c0 := c1 + c2 + c3 + c4 + c5 + c6
    t0 := t1 + t2 + t3 + t4 + t5 + t6

    GuiControl,, TotalTables, %c0% / %t0%

    if (c0 < r0)
    	{
		SoundPlay, %SoundBust%
    	}
	
    r0 = %c0%

    if (c0 < CurrentLimit)
		{
		Gui, Font, s22 cCCCCCC, Verdana
		GuiControl, Font, TotalTables
		}

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

    if (t0 = TotalLimit)
    	{
		SoundPlay, %SoundAchieve%
		TotalLimit := t0 + SoundInterval
    	}
;----------------------------------------------------------- BUYIN --------------------------------------------------------------

Buyin_Dollars:=0.00
Buyin_Dollars_TournamentCounter:=0
Buyin_Euro:=0.00
Buyin_Euro_TournamentCounter:=0
Buyin_Session:=0.00	
Buyin_Session_TournamentCounter:=0
		
Winget,Ps_Hwnd_list,List,Ahk_Class PokerStarsTableFrameClass

Loop %Ps_Hwnd_List%
{
	Hwnd:=Ps_Hwnd_List%A_index%
	IF  !(Buyin_%hwnd%)
		{
		WingetTitle,Title,Ahk_id%Hwnd%
		IF Instr(Title,"Tournament")
			{
			IF Buyin_%Hwnd%:=GetBuyin(Title,Buyin_%Hwnd%_Currency)
				{
 				BuyIn_hwnd_list:=BuyIn_hwnd_list ? BuyIn_hwnd_list "," Hwnd : Hwnd
				Buyin_Total:=Round(Buyin_Total+Buyin_%Hwnd%,2)
			    	Buyin_Total_TournamentCounter+=1
				}
			}
		}			
}	

Loop,Parse,Buyin_Hwnd_List,`,,
{
        Hwnd:=A_LoopField      
	IF WinExist("ahk_id" Hwnd)
        	{
		Currency:=Buyin_%hwnd%_Currency	
		Buyin:=Round(Buyin_%hwnd%,2)
		IF (Currency="$")
			{	
			Buyin_Dollars:=Round(Buyin_Dollars+Buyin,2)
		        Buyin_Dollars_TournamentCounter+=1
			}
		Else  IF (Currency="€")
			{		
			Buyin_Euro:=Round(Buyin_Euro+Buyin,2)
			Buyin_Euro_TournamentCounter+=1
			}		
		Buyin_Session:=Round(Buyin_Session+Buyin,2)
		Buyin_Session_TournamentCounter+=1
		}
	Else
                { 
		Temp_list:="," Buyin_Hwnd_List "," 
		StringReplace,Temp_list,Temp_list,`,Hwnd`,,,    
	        StringTrimLeft,Temp_list,Temp_list,1
		StringTrimRight,Buyin_Hwnd_List,Temp_list,1       
		}
}	
	
IF (BuyIn_Dollars_Save != BuyIn_Dollars) Or (BuyIn_Euro_Save != BuyIn_Euro) 
{
	BuyIn_Euro_Save:=BuyIn_Euro	
	BuyIn_Euro_Avg:= Round(BuyIn_Euro/BuyIn_Euro_TournamentCounter,2)		
	BuyIn_Dollars_Save:=BuyIn_Dollars
	BuyIn_Dollars_Avg:=Round(BuyIn_Dollars/BuyIn_Dollars_TournamentCounter,2)
	BuyIn_Session_Avg:=Round(BuyIn_Session/BuyIn_Session_TournamentCounter,2)
	BuyIn_Total_Avg:=Round(BuyIn_Total/BuyIn_Total_TournamentCounter,2)
		GuiControl,,Dollars,% "$" Buyin_Dollars_Avg " / $" BuyIn_Dollars
		GuiControl,,TotalABI,% "$" BuyIn_Total_Avg " / $" BuyIn_Total
		TotalBI := Round(BuyIn_Total-BuyIn_Dollars,2)
		GuiControl,,TotalBI,% "$" TotalBI "" 
}

GetBuyin(Title,byref currency="",Byref BuyinText="")
	{
	Static CurrencyList:="$,€"
 	Haystack:=Substr(Title, Instr(Title,"Sat:")+1) ;This is for satiliets
    Loop,Parse,Currencylist,`,
    	{
        IF ((StartPosBuyin := Instr(Haystack,A_loopField)) And (EndPosBuyin := Instr(Haystack,A_space,"",StartPosBuyin)))
          	{          
           	BuyinText:=Substr(Haystack,StartPosBuyin ,(EndPosBuyin - StartPosBuyin))
         	Currency=%A_loopField%
          	Buyin:=BuyinText
	  		StringReplace,Buyin,Buyin,%Currency%,, 
			IfInString, Buyin, +R
				{	
          		StringReplace,Buyin,Buyin,+R,, 
				RebuyMulti = 3
				Buyin := Buyin * RebuyMulti					
				}
             
			IF Buyin is not number
				{ 
				Buyin:=0
				currency:=
				buyinText:=    
				}
			Break     
			}
		}
	Return Buyin 
	}
	
;----------------------------------------------------------- CLOCK --------------------------------------------------------------

FormatTime, Time, %A_Now%, H:mm
GuiControl,, Clock, %Time%
StringTrimLeft, TimeOnly, A_Now, 10
StringTrimRight, Minutes, TimeOnly, 2
IfGreaterOrEqual, Minutes, 55
	{
	Gui, Font, s20 c%ClockColorBreak%
	Gui, Font, Bold
	GuiControl, Font, Clock
	}
else
	{
	Gui, Font, s20 cCCCCCC
	Gui, Font, Bold
	GuiControl, Font, Clock
	}
;----------------------------------------------------------- TIME ---------------------------------------------------------------

If (Minutes != Var)
	{
	M2 += 1
	GuiControl,, SessionTime, %H%:%M1%%M2%
	Var := Minutes
	}

If (M2 > 9)
	{
	M1 += 1
	M2 = 0
	GuiControl,, SessionTime, %H%:%M1%%M2%
	}

If (M1 > 5)
	{
	H += 1
	M1 = 0
	M2 = 0
	GuiControl,, SessionTime, %H%:%M1%%M2%
	}
	
Limit = %H%:%M1%%M2%
If (Limit = SessionTimeLimit)
	{
	Gui, Font, s12 c%LimitColor%, Verdana
	GuiControl, Font, SessionTime
	}
;----------------------------------------------------------- LOOP ---------------------------------------------------------------

   Sleep %LoopInterval%

}
return
;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::: HOTKEYS :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

^F9::				;counter (SessionTime) reset
{
H = 0
M1 = 0
M2 = 0
Gui, Font, s12 c999999, Verdana
GuiControl, Font, SessionTime
GuiControl,, SessionTime, %H%:%M1%%M2%
}
return
;................................................................................................................................

^F10::				;counter (SessionTime) + 1
Var = -1
return
;................................................................................................................................

^Q::ExitApp
;................................................................................................................................

!Pause::Pause
;................................................................................................................................

GuiClose:
ExitApp
Table Counter AHK for PokerStars Quote
08-17-2013 , 12:30 PM
^
Code:
WinGet, v1, count, %Stake1% NL Hold'em [%9players% ahk_class PokerStarsTableFrameClass
dafuq is this? Replace it with %Players1%




Also, remove the leading brackets here:
Code:
Players1 = [Turbo
Players2 = [Turbo
Players3 = [Turbo
Players4 = [Turbo
... as they're already here:
Code:
WinGet, v1, count, %Stake1% NL Hold'em [%Players1% ahk_class PokerStarsTableFrameClass
Table Counter AHK for PokerStars Quote
08-17-2013 , 12:40 PM
When I change it back it does not show a table for the 9mans however when I do change it to the code above it does add a table to the counter for 9 mans :/

Is this part correct what you told me to do in our first email?
Code:
Players1 = [Turbo]
Players2 = [Turbo]
Players3 = [Turbo]
Players4 = [Turbo]

Code:
#SingleInstance, force
;#NoTrayIcon
DetectHiddenWindows, On
SetTitleMatchMode, 1					;1=start 2=contain 3=exact match

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

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

GuiPos = x1000 y5						;position of GUI on screen 
										;move the window where you want it to be, then use WindowSpy to grab its coords
										
LoopInterval = 100						;counter update interval in msec (1000 = 1sec, default = 100)

Stake1 = $15.00 							;eg. "$15.00"
Stake2 = $30.00							;eg. "$30.00"
Stake3 = $60.00							;eg. "$60.00"
Stake4 = $100.00							;eg. "$100.00"
						
						

Players1 = [Turbo]
Players2 = [Turbo]
Players3 = [Turbo]
Players4 = [Turbo]



Color1 = ffff00	 						;color for table counter - stake1 
Color2 = ffff00								;color for table counter - stake2 
Color3 = ffff00							;color for table counter - stake3 
Color4 = ffff00 						;color for table counter - stake4 



CurrentLimit = 400						;desired table limit (current)
TotalLimit = 3000						;desired table limit (session)
SoundInterval = 25						;SoundAchieve replays after "TotalLimit" + N tables
SessionTimeLimit = 60:00					;desired session time limit (h:mm)
MaxABI = 20000								;maximum desired ABI (current & session)
MaxInvest = 100000						;maximum desired investment (session)

LimitColor = 33FF33						;color of 'SessionTime' and 'TotalTables' counters after reaching their set limits 
ClockColorBreak = FF0000				;clock color indicating sync tourney break (CCCCCC to disable this option)

RebuyMulti = 3							;stake multiplier for rebuy tourneys (ABI/Stake) 
										;!!!EDIT LINE 436!!! 
										
;=========================================== CONFIG HOTKEYS AT BOTTOM OF THE SCRIPT =============================================

;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

;============================================================ GUI ===============================================================

Gui -MaximizeBox -Resize +AlwaysOnTop +ToolWindow -MinimizeBox
Gui, Show, W194 H408 %GuiPos%, SessionMan 2.2	
Gui, Color, 000000		
;___________________________________________________________ TOTALS _____________________________________________________________
						
Gui, Font, s22 cCCCCCC, Verdana					
Gui, Add, Text, x-8 y1 vTotalTables Center, 00000 / 00000	
								
Gui, Font, s18 c555555, Verdana					
Gui, Add, Text, x7 y14 Center, ____________				
;___________________________________________________________ STAKE 1 ____________________________________________________________
									
Gui, Font, s8 c%Color1%, Verdana				
Gui, Add, Text, x27 y45 vControl1 Center, 00000000000000000000
								
Gui, Font, s16 c%Color1%, Verdana				
Gui, Add, Text, x20 y57 vStake1 Center, 00000 / 00000		
;........................................................... STAKE 2 ............................................................
								
Gui, Font, s8 c%Color2%, Verdana				
Gui, Add, Text, x27 y89 vControl2 Center, 00000000000000000000
								
Gui, Font, s16 c%Color2%, Verdana				
Gui, Add, Text, x20 y101 vStake2 Center, 00000 / 00000		
;........................................................... STAKE 3 ............................................................
								
Gui, Font, s8 c%Color3%, Verdana				
Gui, Add, Text, x27 y133 vControl3 Center, 00000000000000000000
								
Gui, Font, s16 c%Color3%, Verdana				
Gui, Add, Text, x20 y145 vStake3 Center, 00000 / 00000		
;........................................................... STAKE 4 ............................................................
								
Gui, Font, s8 c%Color4%, Verdana				
Gui, Add, Text, x27 y177 vControl4 Center, 00000000000000000000
								
Gui, Font, s16 c%Color4%, Verdana			
Gui, Add, Text, x20 y189 vStake4 Center, 00000 / 00000			
;........................................................... STAKE 5 ............................................................
								
Gui, Font, s8 c%Color5%, Verdana				
Gui, Add, Text, x27 y221 vControl5 Center, 00000000000000000000
								
Gui, Font, s16 c%Color5%, Verdana			
Gui, Add, Text, x20 y233 vStake5 Center, 00000 / 00000			
;........................................................... STAKE 6 ............................................................
								
Gui, Font, s8 c%Color6%, Verdana				
Gui, Add, Text, x27 y265 vControl6 Center, 00000000000000000000
								
Gui, Font, s16 c%Color6%, Verdana			
Gui, Add, Text, x20 y277 vStake6 Center, 00000 / 00000	
;____________________________________________________________ BUYIN _____________________________________________________________
						
Gui, Font, s18 c555555, Verdana							
Gui, Add, Text, x7 y285 Center, ____________	

Gui, Font, s11 c999999, Verdana					
Gui, Add, Text, x12 y318 vTotalABI Center, $0000.00 / $0000.00	
;___________________________________________________________ CLOCK/TIME _________________________________________________________		
								
Gui, Font, s18 c555555, Verdana							
Gui, Add, Text, x7 y318 Center, ____________

Gui, Font, s20 cCCCCCC, Verdana					
Gui, Add, Text, x41 y349 vClock Center, 000:000			
								
Gui, Font, s12 c999999, Verdana					
Gui, Font, Bold						
Gui, Add, Text, x73 y382 vSessionTime Center, 00:00		
;================================================================================================================================	

GuiControl,, Control1, %Stake1% - 9 Players
GuiControl,, Control2, %Stake2% - 9 Players
GuiControl,, Control3, %Stake3% - 9 Players
GuiControl,, Control4, %Stake4% - 9 Players

;--------------------------------------------------------------------------------------------------------------------------------

Buyin_Total := 0.00
Buyin_Total_TournamentCounter := 0

H = 0
M1 = 0
M2 = -1

r0 = 0
r1 = 0
r2 = 0
r3 = 0
r4 = 0
r5 = 0
r6 = 0

t1 = 0
t2 = 0
t3 = 0
t4 = 0
t5 = 0
t6 = 0

P = 0



;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::


Loop
{
;------------------------------------------------------------ STAKE 1 -----------------------------------------------------------
  
    v1 := 0
    c1 := 0

    WinGet, v1, count, %Stake1% NL Hold'em [%players1% ahk_class PokerStarsTableFrameClass

    Loop, %v1%
    	{	
    	c1 += 1
    	}

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

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

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

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

    v2 := 0
    c2 := 0

    WinGet, v2, count, %Stake2% NL Hold'em [%players2% ahk_class PokerStarsTableFrameClass

    Loop, %v2%
    	{	
    	c2 += 1
    	}

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

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

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

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

    v3 := 0
    c3 := 0

    WinGet, v3, count, %Stake3% NL Hold'em [%players3% ahk_class PokerStarsTableFrameClass

    Loop, %v3%
    	{	
    	c3 += 1
    	}

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

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

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

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

    v4 := 0
    c4 := 0

    WinGet, v4,count, %Stake4% NL Hold'em [%players4% ahk_class PokerStarsTableFrameClass 

    Loop, %v4%
    	{	
    	c4 += 1
    	}

    if (t4 = 0)
		{
		GuiControl,, Stake4, 0 / 0
    	r4 = 0
		}

    if (t4 < c4)
		{
		t4 := c4 - 1
		}

    if (c4 > r4)
    	{
		t4++
    	GuiControl,, Stake4, %c4% / %t4%
    	 r4 = %c4%
    	}

	else, if (c4 < r4)
    	{
		GuiControl,, Stake4, %c4% / %t4%
      	r4 = %c4%
    	}
;----------------------------------------------------------- STAKE 5 ------------------------------------------------------------

    v5 := 0
    c5 := 0

    WinGet, v5,count, %Stake5% NL Hold'em [%players5% ahk_class PokerStarsTableFrameClass

    Loop, %v5%
    	{	
    	c5 += 1
    	}

    if (t5 = 0)
		{
		GuiControl,, Stake5, 0 / 0
    	r5 = 0
		}

    if (t5 < c5)
		{
		t5 := c5 - 1
		}

    if (c5 > r5)
    	{
		t5++
    	GuiControl,, Stake5, %c5% / %t5%
    	r5 = %c5%
    	}

	else, if (c5 < r5)
    	{
		GuiControl,, Stake5, %c5% / %t5%
      	r5 = %c5%
    	}
;----------------------------------------------------------- STAKE 6 ------------------------------------------------------------

    v6 := 0
    c6 := 0

    WinGet, v6,count, %Stake6% ahk_class PokerStarsTableFrameClass

    Loop, %v6%
    	{	
    	c6 += 1
    	}

    if (t6 = 0)
		{
		GuiControl,, Stake6, 0 / 0
    	r6 = 0
		}

    if (t6 < c6)
		{
		t6 := c6 - 1
		}

    if (c6 > r6)
    	{
		t6++
    	GuiControl,, Stake6, %c6% / %t6%
    	r6 = %c6%
    	}

	else, if (c6 < r6)
    	{
		GuiControl,, Stake6, %c6% / %t6%
      	r6 = %c6%
    	}
;----------------------------------------------------------- TOTALS -------------------------------------------------------------

    c0 := c1 + c2 + c3 + c4 + c5 + c6
    t0 := t1 + t2 + t3 + t4 + t5 + t6

    GuiControl,, TotalTables, %c0% / %t0%

    if (c0 < r0)
    	{
		SoundPlay, %SoundBust%
    	}
	
    r0 = %c0%

    if (c0 < CurrentLimit)
		{
		Gui, Font, s22 cCCCCCC, Verdana
		GuiControl, Font, TotalTables
		}

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

    if (t0 = TotalLimit)
    	{
		SoundPlay, %SoundAchieve%
		TotalLimit := t0 + SoundInterval
    	}
;----------------------------------------------------------- BUYIN --------------------------------------------------------------

Buyin_Dollars:=0.00
Buyin_Dollars_TournamentCounter:=0
Buyin_Euro:=0.00
Buyin_Euro_TournamentCounter:=0
Buyin_Session:=0.00	
Buyin_Session_TournamentCounter:=0
		
Winget,Ps_Hwnd_list,List,Ahk_Class PokerStarsTableFrameClass

Loop %Ps_Hwnd_List%
{
	Hwnd:=Ps_Hwnd_List%A_index%
	IF  !(Buyin_%hwnd%)
		{
		WingetTitle,Title,Ahk_id%Hwnd%
		IF Instr(Title,"Tournament")
			{
			IF Buyin_%Hwnd%:=GetBuyin(Title,Buyin_%Hwnd%_Currency)
				{
 				BuyIn_hwnd_list:=BuyIn_hwnd_list ? BuyIn_hwnd_list "," Hwnd : Hwnd
				Buyin_Total:=Round(Buyin_Total+Buyin_%Hwnd%,2)
			    	Buyin_Total_TournamentCounter+=1
				}
			}
		}			
}	

Loop,Parse,Buyin_Hwnd_List,`,,
{
        Hwnd:=A_LoopField      
	IF WinExist("ahk_id" Hwnd)
        	{
		Currency:=Buyin_%hwnd%_Currency	
		Buyin:=Round(Buyin_%hwnd%,2)
		IF (Currency="$")
			{	
			Buyin_Dollars:=Round(Buyin_Dollars+Buyin,2)
		        Buyin_Dollars_TournamentCounter+=1
			}
		Else  IF (Currency="€")
			{		
			Buyin_Euro:=Round(Buyin_Euro+Buyin,2)
			Buyin_Euro_TournamentCounter+=1
			}		
		Buyin_Session:=Round(Buyin_Session+Buyin,2)
		Buyin_Session_TournamentCounter+=1
		}
	Else
                { 
		Temp_list:="," Buyin_Hwnd_List "," 
		StringReplace,Temp_list,Temp_list,`,Hwnd`,,,    
	        StringTrimLeft,Temp_list,Temp_list,1
		StringTrimRight,Buyin_Hwnd_List,Temp_list,1       
		}
}	
	
IF (BuyIn_Dollars_Save != BuyIn_Dollars) Or (BuyIn_Euro_Save != BuyIn_Euro) 
{
	BuyIn_Euro_Save:=BuyIn_Euro	
	BuyIn_Euro_Avg:= Round(BuyIn_Euro/BuyIn_Euro_TournamentCounter,2)		
	BuyIn_Dollars_Save:=BuyIn_Dollars
	BuyIn_Dollars_Avg:=Round(BuyIn_Dollars/BuyIn_Dollars_TournamentCounter,2)
	BuyIn_Session_Avg:=Round(BuyIn_Session/BuyIn_Session_TournamentCounter,2)
	BuyIn_Total_Avg:=Round(BuyIn_Total/BuyIn_Total_TournamentCounter,2)
		GuiControl,,Dollars,% "$" Buyin_Dollars_Avg " / $" BuyIn_Dollars
		GuiControl,,TotalABI,% "$" BuyIn_Total_Avg " / $" BuyIn_Total
		TotalBI := Round(BuyIn_Total-BuyIn_Dollars,2)
		GuiControl,,TotalBI,% "$" TotalBI "" 
}

GetBuyin(Title,byref currency="",Byref BuyinText="")
	{
	Static CurrencyList:="$,€"
 	Haystack:=Substr(Title, Instr(Title,"Sat:")+1) ;This is for satiliets
    Loop,Parse,Currencylist,`,
    	{
        IF ((StartPosBuyin := Instr(Haystack,A_loopField)) And (EndPosBuyin := Instr(Haystack,A_space,"",StartPosBuyin)))
          	{          
           	BuyinText:=Substr(Haystack,StartPosBuyin ,(EndPosBuyin - StartPosBuyin))
         	Currency=%A_loopField%
          	Buyin:=BuyinText
	  		StringReplace,Buyin,Buyin,%Currency%,, 
			IfInString, Buyin, +R
				{	
          		StringReplace,Buyin,Buyin,+R,, 
				RebuyMulti = 3
				Buyin := Buyin * RebuyMulti					
				}
             
			IF Buyin is not number
				{ 
				Buyin:=0
				currency:=
				buyinText:=    
				}
			Break     
			}
		}
	Return Buyin 
	}
	
;----------------------------------------------------------- CLOCK --------------------------------------------------------------

FormatTime, Time, %A_Now%, H:mm
GuiControl,, Clock, %Time%
StringTrimLeft, TimeOnly, A_Now, 10
StringTrimRight, Minutes, TimeOnly, 2
IfGreaterOrEqual, Minutes, 55
	{
	Gui, Font, s20 c%ClockColorBreak%
	Gui, Font, Bold
	GuiControl, Font, Clock
	}
else
	{
	Gui, Font, s20 cCCCCCC
	Gui, Font, Bold
	GuiControl, Font, Clock
	}
;----------------------------------------------------------- TIME ---------------------------------------------------------------

If (Minutes != Var)
	{
	M2 += 1
	GuiControl,, SessionTime, %H%:%M1%%M2%
	Var := Minutes
	}

If (M2 > 9)
	{
	M1 += 1
	M2 = 0
	GuiControl,, SessionTime, %H%:%M1%%M2%
	}

If (M1 > 5)
	{
	H += 1
	M1 = 0
	M2 = 0
	GuiControl,, SessionTime, %H%:%M1%%M2%
	}
	
Limit = %H%:%M1%%M2%
If (Limit = SessionTimeLimit)
	{
	Gui, Font, s12 c%LimitColor%, Verdana
	GuiControl, Font, SessionTime
	}
;----------------------------------------------------------- LOOP ---------------------------------------------------------------

   Sleep %LoopInterval%

}
return
;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::: HOTKEYS :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

^F9::				;counter (SessionTime) reset
{
H = 0
M1 = 0
M2 = 0
Gui, Font, s12 c999999, Verdana
GuiControl, Font, SessionTime
GuiControl,, SessionTime, %H%:%M1%%M2%
}
return
;................................................................................................................................

^F10::				;counter (SessionTime) + 1
Var = -1
return
;................................................................................................................................

^Q::ExitApp
;................................................................................................................................

!Pause::Pause
;................................................................................................................................

GuiClose:
ExitApp
Table Counter AHK for PokerStars Quote
08-17-2013 , 12:54 PM
Note that the Players1 variable is case sensitive, plus, as said above, the bracket is already taken care of within the WinGet command. Either remove the bracket in WinGet, ..., or just define Players1 = Turbo (without brackets).

Also, you have to remove the red parts here if you don't want to count more than 4 stakes, otherwise the totals counter will be off:
Code:
;----------------------------------------------------------- TOTALS -------------------------------------------------------------

    c0 := c1 + c2 + c3 + c4 + c5 + c6
    t0 := t1 + t2 + t3 + t4 + t5 + t6
Table Counter AHK for PokerStars Quote
08-17-2013 , 12:55 PM
Thanks Ill try this
Table Counter AHK for PokerStars Quote
08-17-2013 , 12:58 PM
there you go (for 9man Turbo SNG):
Code:
#SingleInstance, force
;#NoTrayIcon
DetectHiddenWindows, On
SetTitleMatchMode, 2					;1=start 2=contain 3=exact match

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

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

GuiPos = x1000 y5						;position of GUI on screen 
										;move the window where you want it to be, then use WindowSpy to grab its coords
										
LoopInterval = 100						;counter update interval in msec (1000 = 1sec, default = 100)

Stake1 = $15.00 							;eg. "$15.00"
Stake2 = $30.00							;eg. "$30.00"
Stake3 = $60.00							;eg. "$60.00"
Stake4 = $100.00							;eg. "$100.00"
						
						

Players1 = [Turbo]
Players2 = [Turbo]
Players3 = [Turbo]
Players4 = [Turbo]



Color1 = ffff00	 						;color for table counter - stake1 
Color2 = ffff00								;color for table counter - stake2 
Color3 = ffff00							;color for table counter - stake3 
Color4 = ffff00 						;color for table counter - stake4 



CurrentLimit = 400						;desired table limit (current)
TotalLimit = 3000						;desired table limit (session)
SoundInterval = 25						;SoundAchieve replays after "TotalLimit" + N tables
SessionTimeLimit = 60:00					;desired session time limit (h:mm)
MaxABI = 20000								;maximum desired ABI (current & session)
MaxInvest = 100000						;maximum desired investment (session)

LimitColor = 33FF33						;color of 'SessionTime' and 'TotalTables' counters after reaching their set limits 
ClockColorBreak = FF0000				;clock color indicating sync tourney break (CCCCCC to disable this option)

RebuyMulti = 3							;stake multiplier for rebuy tourneys (ABI/Stake) 
										;!!!EDIT LINE 436!!! 
										
;=========================================== CONFIG HOTKEYS AT BOTTOM OF THE SCRIPT =============================================

;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

;============================================================ GUI ===============================================================

Gui -MaximizeBox -Resize +AlwaysOnTop +ToolWindow -MinimizeBox
Gui, Show, W194 H408 %GuiPos%, SessionMan 2.2	
Gui, Color, 000000		
;___________________________________________________________ TOTALS _____________________________________________________________
						
Gui, Font, s22 cCCCCCC, Verdana					
Gui, Add, Text, x-8 y1 vTotalTables Center, 00000 / 00000	
								
Gui, Font, s18 c555555, Verdana					
Gui, Add, Text, x7 y14 Center, ____________				
;___________________________________________________________ STAKE 1 ____________________________________________________________
									
Gui, Font, s8 c%Color1%, Verdana				
Gui, Add, Text, x27 y45 vControl1 Center, 00000000000000000000
								
Gui, Font, s16 c%Color1%, Verdana				
Gui, Add, Text, x20 y57 vStake1 Center, 00000 / 00000		
;........................................................... STAKE 2 ............................................................
								
Gui, Font, s8 c%Color2%, Verdana				
Gui, Add, Text, x27 y89 vControl2 Center, 00000000000000000000
								
Gui, Font, s16 c%Color2%, Verdana				
Gui, Add, Text, x20 y101 vStake2 Center, 00000 / 00000		
;........................................................... STAKE 3 ............................................................
								
Gui, Font, s8 c%Color3%, Verdana				
Gui, Add, Text, x27 y133 vControl3 Center, 00000000000000000000
								
Gui, Font, s16 c%Color3%, Verdana				
Gui, Add, Text, x20 y145 vStake3 Center, 00000 / 00000		
;........................................................... STAKE 4 ............................................................
								
Gui, Font, s8 c%Color4%, Verdana				
Gui, Add, Text, x27 y177 vControl4 Center, 00000000000000000000
								
Gui, Font, s16 c%Color4%, Verdana			
Gui, Add, Text, x20 y189 vStake4 Center, 00000 / 00000			
;........................................................... STAKE 5 ............................................................
								
Gui, Font, s8 c%Color5%, Verdana				
Gui, Add, Text, x27 y221 vControl5 Center, 00000000000000000000
								
Gui, Font, s16 c%Color5%, Verdana			
Gui, Add, Text, x20 y233 vStake5 Center, 00000 / 00000			
;........................................................... STAKE 6 ............................................................
								
Gui, Font, s8 c%Color6%, Verdana				
Gui, Add, Text, x27 y265 vControl6 Center, 00000000000000000000
								
Gui, Font, s16 c%Color6%, Verdana			
Gui, Add, Text, x20 y277 vStake6 Center, 00000 / 00000	
;____________________________________________________________ BUYIN _____________________________________________________________
						
Gui, Font, s18 c555555, Verdana							
Gui, Add, Text, x7 y285 Center, ____________	

Gui, Font, s11 c999999, Verdana					
Gui, Add, Text, x12 y318 vTotalABI Center, $0000.00 / $0000.00	
;___________________________________________________________ CLOCK/TIME _________________________________________________________		
								
Gui, Font, s18 c555555, Verdana							
Gui, Add, Text, x7 y318 Center, ____________

Gui, Font, s20 cCCCCCC, Verdana					
Gui, Add, Text, x41 y349 vClock Center, 000:000			
								
Gui, Font, s12 c999999, Verdana					
Gui, Font, Bold						
Gui, Add, Text, x73 y382 vSessionTime Center, 00:00		
;================================================================================================================================	

GuiControl,, Control1, %Stake1% - 9 Players
GuiControl,, Control2, %Stake2% - 9 Players
GuiControl,, Control3, %Stake3% - 9 Players
GuiControl,, Control4, %Stake4% - 9 Players

;--------------------------------------------------------------------------------------------------------------------------------

Buyin_Total := 0.00
Buyin_Total_TournamentCounter := 0

H = 0
M1 = 0
M2 = -1

r0 = 0
r1 = 0
r2 = 0
r3 = 0
r4 = 0
r5 = 0
r6 = 0

t1 = 0
t2 = 0
t3 = 0
t4 = 0
t5 = 0
t6 = 0

P = 0



;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::


Loop
{
;------------------------------------------------------------ STAKE 1 -----------------------------------------------------------
  
    v1 := 0
    c1 := 0

    WinGet, v1, count, %Stake1% NL Hold'em %Players1% ahk_class PokerStarsTableFrameClass

    Loop, %v1%
    	{	
    	c1 += 1
    	}

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

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

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

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

    v2 := 0
    c2 := 0

    WinGet, v2, count, %Stake2% NL Hold'em %Players2% ahk_class PokerStarsTableFrameClass

    Loop, %v2%
    	{	
    	c2 += 1
    	}

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

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

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

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

    v3 := 0
    c3 := 0

    WinGet, v3, count, %Stake3% NL Hold'em %Players3% ahk_class PokerStarsTableFrameClass

    Loop, %v3%
    	{	
    	c3 += 1
    	}

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

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

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

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

    v4 := 0
    c4 := 0

    WinGet, v4,count, %Stake4% NL Hold'em %Players4% ahk_class PokerStarsTableFrameClass 

    Loop, %v4%
    	{	
    	c4 += 1
    	}

    if (t4 = 0)
		{
		GuiControl,, Stake4, 0 / 0
    	r4 = 0
		}

    if (t4 < c4)
		{
		t4 := c4 - 1
		}

    if (c4 > r4)
    	{
		t4++
    	GuiControl,, Stake4, %c4% / %t4%
    	 r4 = %c4%
    	}

	else, if (c4 < r4)
    	{
		GuiControl,, Stake4, %c4% / %t4%
      	r4 = %c4%
    	}
;----------------------------------------------------------- STAKE 5 ------------------------------------------------------------

    v5 := 0
    c5 := 0

    WinGet, v5,count, %Stake5% NL Hold'em %Players5% ahk_class PokerStarsTableFrameClass

    Loop, %v5%
    	{	
    	c5 += 1
    	}

    if (t5 = 0)
		{
		GuiControl,, Stake5, 0 / 0
    	r5 = 0
		}

    if (t5 < c5)
		{
		t5 := c5 - 1
		}

    if (c5 > r5)
    	{
		t5++
    	GuiControl,, Stake5, %c5% / %t5%
    	r5 = %c5%
    	}

	else, if (c5 < r5)
    	{
		GuiControl,, Stake5, %c5% / %t5%
      	r5 = %c5%
    	}
;----------------------------------------------------------- STAKE 6 ------------------------------------------------------------

    v6 := 0
    c6 := 0

    WinGet, v6,count, %Stake6% ahk_class PokerStarsTableFrameClass

    Loop, %v6%
    	{	
    	c6 += 1
    	}

    if (t6 = 0)
		{
		GuiControl,, Stake6, 0 / 0
    	r6 = 0
		}

    if (t6 < c6)
		{
		t6 := c6 - 1
		}

    if (c6 > r6)
    	{
		t6++
    	GuiControl,, Stake6, %c6% / %t6%
    	r6 = %c6%
    	}

	else, if (c6 < r6)
    	{
		GuiControl,, Stake6, %c6% / %t6%
      	r6 = %c6%
    	}
;----------------------------------------------------------- TOTALS -------------------------------------------------------------

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

    GuiControl,, TotalTables, %c0% / %t0%

    if (c0 < r0)
    	{
		SoundPlay, %SoundBust%
    	}
	
    r0 = %c0%

    if (c0 < CurrentLimit)
		{
		Gui, Font, s22 cCCCCCC, Verdana
		GuiControl, Font, TotalTables
		}

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

    if (t0 = TotalLimit)
    	{
		SoundPlay, %SoundAchieve%
		TotalLimit := t0 + SoundInterval
    	}
;----------------------------------------------------------- BUYIN --------------------------------------------------------------

Buyin_Dollars:=0.00
Buyin_Dollars_TournamentCounter:=0
Buyin_Euro:=0.00
Buyin_Euro_TournamentCounter:=0
Buyin_Session:=0.00	
Buyin_Session_TournamentCounter:=0
		
Winget,Ps_Hwnd_list,List,Ahk_Class PokerStarsTableFrameClass

Loop %Ps_Hwnd_List%
{
	Hwnd:=Ps_Hwnd_List%A_index%
	IF  !(Buyin_%hwnd%)
		{
		WingetTitle,Title,Ahk_id%Hwnd%
		IF Instr(Title,"Tournament")
			{
			IF Buyin_%Hwnd%:=GetBuyin(Title,Buyin_%Hwnd%_Currency)
				{
 				BuyIn_hwnd_list:=BuyIn_hwnd_list ? BuyIn_hwnd_list "," Hwnd : Hwnd
				Buyin_Total:=Round(Buyin_Total+Buyin_%Hwnd%,2)
			    	Buyin_Total_TournamentCounter+=1
				}
			}
		}			
}	

Loop,Parse,Buyin_Hwnd_List,`,,
{
        Hwnd:=A_LoopField      
	IF WinExist("ahk_id" Hwnd)
        	{
		Currency:=Buyin_%hwnd%_Currency	
		Buyin:=Round(Buyin_%hwnd%,2)
		IF (Currency="$")
			{	
			Buyin_Dollars:=Round(Buyin_Dollars+Buyin,2)
		        Buyin_Dollars_TournamentCounter+=1
			}
		Else  IF (Currency="€")
			{		
			Buyin_Euro:=Round(Buyin_Euro+Buyin,2)
			Buyin_Euro_TournamentCounter+=1
			}		
		Buyin_Session:=Round(Buyin_Session+Buyin,2)
		Buyin_Session_TournamentCounter+=1
		}
	Else
                { 
		Temp_list:="," Buyin_Hwnd_List "," 
		StringReplace,Temp_list,Temp_list,`,Hwnd`,,,    
	        StringTrimLeft,Temp_list,Temp_list,1
		StringTrimRight,Buyin_Hwnd_List,Temp_list,1       
		}
}	
	
IF (BuyIn_Dollars_Save != BuyIn_Dollars) Or (BuyIn_Euro_Save != BuyIn_Euro) 
{
	BuyIn_Euro_Save:=BuyIn_Euro	
	BuyIn_Euro_Avg:= Round(BuyIn_Euro/BuyIn_Euro_TournamentCounter,2)		
	BuyIn_Dollars_Save:=BuyIn_Dollars
	BuyIn_Dollars_Avg:=Round(BuyIn_Dollars/BuyIn_Dollars_TournamentCounter,2)
	BuyIn_Session_Avg:=Round(BuyIn_Session/BuyIn_Session_TournamentCounter,2)
	BuyIn_Total_Avg:=Round(BuyIn_Total/BuyIn_Total_TournamentCounter,2)
		GuiControl,,Dollars,% "$" Buyin_Dollars_Avg " / $" BuyIn_Dollars
		GuiControl,,TotalABI,% "$" BuyIn_Total_Avg " / $" BuyIn_Total
		TotalBI := Round(BuyIn_Total-BuyIn_Dollars,2)
		GuiControl,,TotalBI,% "$" TotalBI "" 
}

GetBuyin(Title,byref currency="",Byref BuyinText="")
	{
	Static CurrencyList:="$,€"
 	Haystack:=Substr(Title, Instr(Title,"Sat:")+1) ;This is for satiliets
    Loop,Parse,Currencylist,`,
    	{
        IF ((StartPosBuyin := Instr(Haystack,A_loopField)) And (EndPosBuyin := Instr(Haystack,A_space,"",StartPosBuyin)))
          	{          
           	BuyinText:=Substr(Haystack,StartPosBuyin ,(EndPosBuyin - StartPosBuyin))
         	Currency=%A_loopField%
          	Buyin:=BuyinText
	  		StringReplace,Buyin,Buyin,%Currency%,, 
			IfInString, Buyin, +R
				{	
          		StringReplace,Buyin,Buyin,+R,, 
				RebuyMulti = 3
				Buyin := Buyin * RebuyMulti					
				}
             
			IF Buyin is not number
				{ 
				Buyin:=0
				currency:=
				buyinText:=    
				}
			Break     
			}
		}
	Return Buyin 
	}
	
;----------------------------------------------------------- CLOCK --------------------------------------------------------------

FormatTime, Time, %A_Now%, H:mm
GuiControl,, Clock, %Time%
StringTrimLeft, TimeOnly, A_Now, 10
StringTrimRight, Minutes, TimeOnly, 2
IfGreaterOrEqual, Minutes, 55
	{
	Gui, Font, s20 c%ClockColorBreak%
	Gui, Font, Bold
	GuiControl, Font, Clock
	}
else
	{
	Gui, Font, s20 cCCCCCC
	Gui, Font, Bold
	GuiControl, Font, Clock
	}
;----------------------------------------------------------- TIME ---------------------------------------------------------------

If (Minutes != Var)
	{
	M2 += 1
	GuiControl,, SessionTime, %H%:%M1%%M2%
	Var := Minutes
	}

If (M2 > 9)
	{
	M1 += 1
	M2 = 0
	GuiControl,, SessionTime, %H%:%M1%%M2%
	}

If (M1 > 5)
	{
	H += 1
	M1 = 0
	M2 = 0
	GuiControl,, SessionTime, %H%:%M1%%M2%
	}
	
Limit = %H%:%M1%%M2%
If (Limit = SessionTimeLimit)
	{
	Gui, Font, s12 c%LimitColor%, Verdana
	GuiControl, Font, SessionTime
	}
;----------------------------------------------------------- LOOP ---------------------------------------------------------------

   Sleep %LoopInterval%

}
return
;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::: HOTKEYS :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

^F9::				;counter (SessionTime) reset
{
H = 0
M1 = 0
M2 = 0
Gui, Font, s12 c999999, Verdana
GuiControl, Font, SessionTime
GuiControl,, SessionTime, %H%:%M1%%M2%
}
return
;................................................................................................................................

^F10::				;counter (SessionTime) + 1
Var = -1
return
;................................................................................................................................

^Q::ExitApp
;................................................................................................................................

!Pause::Pause
;................................................................................................................................

GuiClose:
ExitApp

Last edited by Baobhan-Sith; 08-17-2013 at 01:21 PM. Reason: (for 9man Turbo SNG)
Table Counter AHK for PokerStars Quote
08-17-2013 , 01:05 PM
Table Counter AHK for PokerStars Quote
08-26-2013 , 10:57 AM
Someone just asked me to help fixing the weird appearance of my script GUI on his machine but I'm clueless, is this a DPI setting issue, or is he using the wrong AHK version? Any hint appreciated.



FWIW I'm guessing the script won't find a match using the definition "6 Players", as that term doesn't appear in the tables' window titles. Try using "6-Max" instead.

Last edited by Baobhan-Sith; 08-26-2013 at 11:14 AM.
Table Counter AHK for PokerStars Quote
08-26-2013 , 05:08 PM
hi im the guy that contacted bao with the problem in the previous post...
i uninstalled autohotkey and downloaded the old basic version btw...the 0.8.45 or so...that u suggested using...and the problem persists...
fwiw i modified the script from post 107 of bao and basically only changed the stakes and the location of the gui...so idk whats wrong with it

here it is:



Code:
#SingleInstance, force
;#NoTrayIcon
DetectHiddenWindows, On
SetTitleMatchMode, 2					;1=start 2=contain 3=exact match

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

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

GuiPos = x1700 y600						;position of GUI on screen 
								;move the window where you want it to be, then use WindowSpy to grab its coords
										
LoopInterval = 100						;counter update interval in msec (1000 = 1sec, default = 100)

Stake1 = $7.00 							;eg. "$3.50+R"
Stake2 = $15.00							;eg. "$8.00"
Stake3 = $30.00							;eg. "$15.00"
Stake4 = $60.00							;eg. "$35.00"
Stake5 = $100.00							
Stake6 = Gtd							;eg. "Gtd"

Players1 = 6-Max
Players2 = 6-Max
Players3 = 6-Max
Players4 = 6-Max
Players5 = 6-Max

Color1 = 00AAFF 						;color for table counter - stake1 
Color2 = 00AAFF							;color for table counter - stake2 
Color3 = ffff00							;color for table counter - stake3 
Color4 = ffff00 						;color for table counter - stake4 
Color5 = ff0000 						;color for table counter - stake5
Color6 = 00ff00 						;color for table counter - stake6

CurrentLimit = 14						;desired table limit (current)
TotalLimit = 100						;desired table limit (session)
SoundInterval = 25						;SoundAchieve replays after "TotalLimit" + N tables
SessionTimeLimit = 6:00					;desired session time limit (h:mm)
MaxABI = 25								;maximum desired ABI (current & session)
MaxInvest = 2000						;maximum desired investment (session)

LimitColor = 33FF33						;color of 'SessionTime' and 'TotalTables' counters after reaching their set limits 
ClockColorBreak = FF0000				;clock color indicating sync tourney break (CCCCCC to disable this option)

RebuyMulti = 3							;stake multiplier for rebuy tourneys (ABI/Stake) 
										;!!!EDIT LINE 436!!! 
										
;=========================================== CONFIG HOTKEYS AT BOTTOM OF THE SCRIPT =============================================

;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

;============================================================ GUI ===============================================================

Gui -MaximizeBox -Resize +AlwaysOnTop +ToolWindow -MinimizeBox
Gui, Show, W194 H408 %GuiPos%, SessionMan	
Gui, Color, 000000		
;___________________________________________________________ TOTALS _____________________________________________________________
						
Gui, Font, s22 cCCCCCC, Verdana					
Gui, Add, Text, x-8 y1 vTotalTables Center, 00000 / 00000	
								
Gui, Font, s18 c555555, Verdana					
Gui, Add, Text, x7 y14 Center, ____________				
;___________________________________________________________ STAKE 1 ____________________________________________________________
									
Gui, Font, s8 c%Color1%, Verdana				
Gui, Add, Text, x27 y45 vControl1 Center, 00000000000000000000
								
Gui, Font, s16 c%Color1%, Verdana				
Gui, Add, Text, x20 y57 vStake1 Center, 00000 / 00000		
;........................................................... STAKE 2 ............................................................
								
Gui, Font, s8 c%Color2%, Verdana				
Gui, Add, Text, x27 y89 vControl2 Center, 00000000000000000000
								
Gui, Font, s16 c%Color2%, Verdana				
Gui, Add, Text, x20 y101 vStake2 Center, 00000 / 00000		
;........................................................... STAKE 3 ............................................................
								
Gui, Font, s8 c%Color3%, Verdana				
Gui, Add, Text, x27 y133 vControl3 Center, 00000000000000000000
								
Gui, Font, s16 c%Color3%, Verdana				
Gui, Add, Text, x20 y145 vStake3 Center, 00000 / 00000		
;........................................................... STAKE 4 ............................................................
								
Gui, Font, s8 c%Color4%, Verdana				
Gui, Add, Text, x27 y177 vControl4 Center, 00000000000000000000
								
Gui, Font, s16 c%Color4%, Verdana			
Gui, Add, Text, x20 y189 vStake4 Center, 00000 / 00000			
;........................................................... STAKE 5 ............................................................
								
Gui, Font, s8 c%Color5%, Verdana				
Gui, Add, Text, x27 y221 vControl5 Center, 00000000000000000000
								
Gui, Font, s16 c%Color5%, Verdana			
Gui, Add, Text, x20 y233 vStake5 Center, 00000 / 00000			
;........................................................... STAKE 6 ............................................................
								
Gui, Font, s8 c%Color6%, Verdana				
Gui, Add, Text, x27 y265 vControl6 Center, 00000000000000000000
								
Gui, Font, s16 c%Color6%, Verdana			
Gui, Add, Text, x20 y277 vStake6 Center, 00000 / 00000	
;____________________________________________________________ BUYIN _____________________________________________________________
						
Gui, Font, s18 c555555, Verdana							
Gui, Add, Text, x7 y285 Center, ____________	

Gui, Font, s11 c999999, Verdana					
Gui, Add, Text, x12 y318 vTotalABI Center, $0000.00 / $0000.00	
;___________________________________________________________ CLOCK/TIME _________________________________________________________		
								
Gui, Font, s18 c555555, Verdana							
Gui, Add, Text, x7 y318 Center, ____________

Gui, Font, s20 cCCCCCC, Verdana					
Gui, Add, Text, x41 y349 vClock Center, 000:000			
								
Gui, Font, s12 c999999, Verdana					
Gui, Font, Bold						
Gui, Add, Text, x73 y382 vSessionTime Center, 00:00		
;================================================================================================================================	

GuiControl,, Control1, %Stake1% - %Players1%
GuiControl,, Control2, %Stake2% - %Players2%
GuiControl,, Control3, %Stake3% - %Players3%
GuiControl,, Control4, %Stake4% - %Players4%
GuiControl,, Control5, %Stake5% - %Players5%
GuiControl,, Control6, %Stake6% 
;--------------------------------------------------------------------------------------------------------------------------------

Buyin_Total := 0.00
Buyin_Total_TournamentCounter := 0

H = 0
M1 = 0
M2 = -1

r0 = 0
r1 = 0
r2 = 0
r3 = 0
r4 = 0
r5 = 0
r6 = 0

t1 = 0
t2 = 0
t3 = 0
t4 = 0
t5 = 0
t6 = 0

P = 0



;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::


Loop
{
;------------------------------------------------------------ STAKE 1 -----------------------------------------------------------
  
    v1 := 0
    c1 := 0

    WinGet, v1, count, %Stake1% NL Hold'em [%Players1% ahk_class PokerStarsTableFrameClass

    Loop, %v1%
    	{	
    	c1 += 1
    	}

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

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

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

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

    v2 := 0
    c2 := 0

    WinGet, v2, count, %Stake2% NL Hold'em [%Players2% ahk_class PokerStarsTableFrameClass

    Loop, %v2%
    	{	
    	c2 += 1
    	}

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

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

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

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

    v3 := 0
    c3 := 0

    WinGet, v3, count, %Stake3% NL Hold'em [%Players3% ahk_class PokerStarsTableFrameClass

    Loop, %v3%
    	{	
    	c3 += 1
    	}

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

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

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

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

    v4 := 0
    c4 := 0

    WinGet, v4,count, %Stake4% ahk_class PokerStarsTableFrameClass 

    Loop, %v4%
    	{	
    	c4 += 1
    	}

    if (t4 = 0)
		{
		GuiControl,, Stake4, 0 / 0
    	r4 = 0
		}

    if (t4 < c4)
		{
		t4 := c4 - 1
		}

    if (c4 > r4)
    	{
		t4++
    	GuiControl,, Stake4, %c4% / %t4%
    	 r4 = %c4%
    	}

	else, if (c4 < r4)
    	{
		GuiControl,, Stake4, %c4% / %t4%
      	r4 = %c4%
    	}
;----------------------------------------------------------- STAKE 5 ------------------------------------------------------------

    v5 := 0
    c5 := 0

    WinGet, v5,count, %Stake5% NL Hold'em [%Players5% ahk_class PokerStarsTableFrameClass

    Loop, %v5%
    	{	
    	c5 += 1
    	}

    if (t5 = 0)
		{
		GuiControl,, Stake5, 0 / 0
    	r5 = 0
		}

    if (t5 < c5)
		{
		t5 := c5 - 1
		}

    if (c5 > r5)
    	{
		t5++
    	GuiControl,, Stake5, %c5% / %t5%
    	r5 = %c5%
    	}

	else, if (c5 < r5)
    	{
		GuiControl,, Stake5, %c5% / %t5%
      	r5 = %c5%
    	}
;----------------------------------------------------------- STAKE 6 ------------------------------------------------------------

    v6 := 0
    c6 := 0

    WinGet, v6,count, %Stake6% ahk_class PokerStarsTableFrameClass

    Loop, %v6%
    	{	
    	c6 += 1
    	}

    if (t6 = 0)
		{
		GuiControl,, Stake6, 0 / 0
    	r6 = 0
		}

    if (t6 < c6)
		{
		t6 := c6 - 1
		}

    if (c6 > r6)
    	{
		t6++
    	GuiControl,, Stake6, %c6% / %t6%
    	r6 = %c6%
    	}

	else, if (c6 < r6)
    	{
		GuiControl,, Stake6, %c6% / %t6%
      	r6 = %c6%
    	}
;----------------------------------------------------------- TOTALS -------------------------------------------------------------

    c0 := c1 + c2 + c3 + c4 + c5 + c6
    t0 := t1 + t2 + t3 + t4 + t5 + t6

    GuiControl,, TotalTables, %c0% / %t0%

    if (c0 < r0)
    	{
		SoundPlay, %SoundBust%
    	}
	
    r0 = %c0%

    if (c0 < CurrentLimit)
		{
		Gui, Font, s22 cCCCCCC, Verdana
		GuiControl, Font, TotalTables
		}

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

    if (t0 = TotalLimit)
    	{
		SoundPlay, %SoundAchieve%
		TotalLimit := t0 + SoundInterval
    	}
;----------------------------------------------------------- BUYIN --------------------------------------------------------------

Buyin_Dollars:=0.00
Buyin_Dollars_TournamentCounter:=0
Buyin_Euro:=0.00
Buyin_Euro_TournamentCounter:=0
Buyin_Session:=0.00	
Buyin_Session_TournamentCounter:=0
		
Winget,Ps_Hwnd_list,List,Ahk_Class PokerStarsTableFrameClass

Loop %Ps_Hwnd_List%
{
	Hwnd:=Ps_Hwnd_List%A_index%
	IF  !(Buyin_%hwnd%)
		{
		WingetTitle,Title,Ahk_id%Hwnd%
		IF Instr(Title,"Tournament")
			{
			IF Buyin_%Hwnd%:=GetBuyin(Title,Buyin_%Hwnd%_Currency)
				{
 				BuyIn_hwnd_list:=BuyIn_hwnd_list ? BuyIn_hwnd_list "," Hwnd : Hwnd
				Buyin_Total:=Round(Buyin_Total+Buyin_%Hwnd%,2)
			    	Buyin_Total_TournamentCounter+=1
				}
			}
		}			
}	

Loop,Parse,Buyin_Hwnd_List,`,,
{
        Hwnd:=A_LoopField      
	IF WinExist("ahk_id" Hwnd)
        	{
		Currency:=Buyin_%hwnd%_Currency	
		Buyin:=Round(Buyin_%hwnd%,2)
		IF (Currency="$")
			{	
			Buyin_Dollars:=Round(Buyin_Dollars+Buyin,2)
		        Buyin_Dollars_TournamentCounter+=1
			}
		Else  IF (Currency="€")
			{		
			Buyin_Euro:=Round(Buyin_Euro+Buyin,2)
			Buyin_Euro_TournamentCounter+=1
			}		
		Buyin_Session:=Round(Buyin_Session+Buyin,2)
		Buyin_Session_TournamentCounter+=1
		}
	Else
                { 
		Temp_list:="," Buyin_Hwnd_List "," 
		StringReplace,Temp_list,Temp_list,`,Hwnd`,,,    
	        StringTrimLeft,Temp_list,Temp_list,1
		StringTrimRight,Buyin_Hwnd_List,Temp_list,1       
		}
}	
	
IF (BuyIn_Dollars_Save != BuyIn_Dollars) Or (BuyIn_Euro_Save != BuyIn_Euro) 
{
	BuyIn_Euro_Save:=BuyIn_Euro	
	BuyIn_Euro_Avg:= Round(BuyIn_Euro/BuyIn_Euro_TournamentCounter,2)		
	BuyIn_Dollars_Save:=BuyIn_Dollars
	BuyIn_Dollars_Avg:=Round(BuyIn_Dollars/BuyIn_Dollars_TournamentCounter,2)
	BuyIn_Session_Avg:=Round(BuyIn_Session/BuyIn_Session_TournamentCounter,2)
	BuyIn_Total_Avg:=Round(BuyIn_Total/BuyIn_Total_TournamentCounter,2)
		GuiControl,,Dollars,% "$" Buyin_Dollars_Avg " / $" BuyIn_Dollars
		GuiControl,,TotalABI,% "$" BuyIn_Total_Avg " / $" BuyIn_Total
		TotalBI := Round(BuyIn_Total-BuyIn_Dollars,2)
		GuiControl,,TotalBI,% "$" TotalBI "" 
}

GetBuyin(Title,byref currency="",Byref BuyinText="")
	{
	Static CurrencyList:="$,€"
 	Haystack:=Substr(Title, Instr(Title,"Sat:")+1) ;This is for satiliets
    Loop,Parse,Currencylist,`,
    	{
        IF ((StartPosBuyin := Instr(Haystack,A_loopField)) And (EndPosBuyin := Instr(Haystack,A_space,"",StartPosBuyin)))
          	{          
           	BuyinText:=Substr(Haystack,StartPosBuyin ,(EndPosBuyin - StartPosBuyin))
         	Currency=%A_loopField%
          	Buyin:=BuyinText
	  		StringReplace,Buyin,Buyin,%Currency%,, 
			IfInString, Buyin, +R
				{	
          		StringReplace,Buyin,Buyin,+R,, 
				RebuyMulti = 3
				Buyin := Buyin * RebuyMulti					
				}
             
			IF Buyin is not number
				{ 
				Buyin:=0
				currency:=
				buyinText:=    
				}
			Break     
			}
		}
	Return Buyin 
	}
	
;----------------------------------------------------------- CLOCK --------------------------------------------------------------

FormatTime, Time, %A_Now%, H:mm
GuiControl,, Clock, %Time%
StringTrimLeft, TimeOnly, A_Now, 10
StringTrimRight, Minutes, TimeOnly, 2
IfGreaterOrEqual, Minutes, 55
	{
	Gui, Font, s20 c%ClockColorBreak%
	Gui, Font, Bold
	GuiControl, Font, Clock
	}
else
	{
	Gui, Font, s20 cCCCCCC
	Gui, Font, Bold
	GuiControl, Font, Clock
	}
;----------------------------------------------------------- TIME ---------------------------------------------------------------

If (Minutes != Var)
	{
	M2 += 1
	GuiControl,, SessionTime, %H%:%M1%%M2%
	Var := Minutes
	}

If (M2 > 9)
	{
	M1 += 1
	M2 = 0
	GuiControl,, SessionTime, %H%:%M1%%M2%
	}

If (M1 > 5)
	{
	H += 1
	M1 = 0
	M2 = 0
	GuiControl,, SessionTime, %H%:%M1%%M2%
	}
	
Limit = %H%:%M1%%M2%
If (Limit = SessionTimeLimit)
	{
	Gui, Font, s12 c%LimitColor%, Verdana
	GuiControl, Font, SessionTime
	}
;----------------------------------------------------------- LOOP ---------------------------------------------------------------

   Sleep %LoopInterval%

}
return
;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::: HOTKEYS :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

^F9::				;counter (SessionTime) reset
{
H = 0
M1 = 0
M2 = 0
Gui, Font, s12 c999999, Verdana
GuiControl, Font, SessionTime
GuiControl,, SessionTime, %H%:%M1%%M2%
}
return
;................................................................................................................................

^F10::				;counter (SessionTime) + 1
Var = -1
return
;................................................................................................................................

^Q::ExitApp
;................................................................................................................................

!Pause::Pause
;................................................................................................................................

GuiClose:
ExitApp
Table Counter AHK for PokerStars Quote
08-26-2013 , 08:54 PM
i tried the ahk file compiled it run it as admin on win8...and the basically the only things being tracked are the clocks at the bottom and the abi/total buyins
the rest of the numbers are 0
i m using pokerstars.eu client btw dunno if thats relevant
Table Counter AHK for PokerStars Quote
08-26-2013 , 09:30 PM
What games are you intending to play? Make sure each of those commands can find a match in a continuous string within the windows' titles:

Code:
WinGet, v1, count, %Stake1% NL Hold'em [%Players1% ahk_class PokerStarsTableFrameClass
Example:
Code:
$60.00 NL Hold'em [6-Max, Hyper-Turbo]    - Blinds $30/$60 Ante $6 - Tournament 779689624 Table 1 ahk_class PokerStarsTableFrameClass
=> a match is found if
Stake1 = $60.00
Players1 = 6-Max
ahk_class = PokerStarsTableFrameClass

Also note the SetTitleMatchMode command/value at the top of the script.

Last edited by Baobhan-Sith; 08-26-2013 at 09:40 PM.
Table Counter AHK for PokerStars Quote
08-27-2013 , 01:37 AM
those were correct... anyway i fixed it
the problem was the SetTitleMatchMode command as u said
I changed the value to 1 and now it works fine...
the gui is now the only problem but whatever as long as its working I dont rlly mind
Table Counter AHK for PokerStars Quote
08-27-2013 , 10:25 AM
Figured it out. It has in fact to do with you using a different dpi setting than me (than the default, that is). If you don't want to change your settings to 96dpi I will have to customize some coords for you. Just lmk.

http://www.sevenforums.com/tutorials...gs-change.html
Table Counter AHK for PokerStars Quote
08-27-2013 , 08:07 PM
hey bao yea u were right i was using 125% dpi instead of 100% that is 96... with 100% it appears ok... however the rest of the text on my screen is too small now
could u please spare a moment to help me configure it for 125% dpi? also i removed the sound alarm options since i dont rlly use them and the limits for the session... and i use only 5 stakes so there is a gap at the bottom between that last stake and the clock... if u could help me fix those here is the code i wanna use:

Code:
#SingleInstance, force
;#NoTrayIcon
DetectHiddenWindows, On
SetTitleMatchMode, 1					;1=start 2=contain 3=exact match

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

GuiPos = x1700 y600						;position of GUI on screen 
								;move the window where you want it to be, then use WindowSpy to grab its coords
										
LoopInterval = 100						;counter update interval in msec (1000 = 1sec, default = 100)

Stake1 = $7.00 							;eg. "$3.50+R"
Stake2 = $15.00							;eg. "$8.00"
Stake3 = $30.00							;eg. "$15.00"
Stake4 = $38.00							;eg. "$35.00"
Stake5 = $74.00							

Players1 = 6-Max
Players2 = 6-Max
Players3 = 6-Max
Players4 = 6-Max
Players5 = 6-Max

Color1 = 00AAFF 						;color for table counter - stake1 
Color2 = 00AAFF							;color for table counter - stake2 
Color3 = ffff00							;color for table counter - stake3 
Color4 = ffff00 						;color for table counter - stake4 
Color5 = ff0000 						;color for table counter - stake5
Color6 = 00ff00 						;color for table counter - stake6

ClockColorBreak = FF0000				;clock color indicating sync tourney break (CCCCCC to disable this option)

;=========================================== CONFIG HOTKEYS AT BOTTOM OF THE SCRIPT =============================================

;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

;============================================================ GUI ===============================================================

Gui -MaximizeBox -Resize +AlwaysOnTop +ToolWindow -MinimizeBox
Gui, Show, W194 H408 %GuiPos%, SessionMan	
Gui, Color, 000000		
;___________________________________________________________ TOTALS _____________________________________________________________
						
Gui, Font, s22 cCCCCCC, Verdana					
Gui, Add, Text, x-8 y1 vTotalTables Center, 00000 / 00000	
								
Gui, Font, s18 c555555, Verdana					
Gui, Add, Text, x7 y14 Center, ____________				
;___________________________________________________________ STAKE 1 ____________________________________________________________
									
Gui, Font, s8 c%Color1%, Verdana				
Gui, Add, Text, x27 y45 vControl1 Center, 00000000000000000000
								
Gui, Font, s16 c%Color1%, Verdana				
Gui, Add, Text, x20 y57 vStake1 Center, 00000 / 00000		
;........................................................... STAKE 2 ............................................................
								
Gui, Font, s8 c%Color2%, Verdana				
Gui, Add, Text, x27 y89 vControl2 Center, 00000000000000000000
								
Gui, Font, s16 c%Color2%, Verdana				
Gui, Add, Text, x20 y101 vStake2 Center, 00000 / 00000		
;........................................................... STAKE 3 ............................................................
								
Gui, Font, s8 c%Color3%, Verdana				
Gui, Add, Text, x27 y133 vControl3 Center, 00000000000000000000
								
Gui, Font, s16 c%Color3%, Verdana				
Gui, Add, Text, x20 y145 vStake3 Center, 00000 / 00000		
;........................................................... STAKE 4 ............................................................
								
Gui, Font, s8 c%Color4%, Verdana				
Gui, Add, Text, x27 y177 vControl4 Center, 00000000000000000000
								
Gui, Font, s16 c%Color4%, Verdana			
Gui, Add, Text, x20 y189 vStake4 Center, 00000 / 00000			
;........................................................... STAKE 5 ............................................................
								
Gui, Font, s8 c%Color5%, Verdana				
Gui, Add, Text, x27 y221 vControl5 Center, 00000000000000000000
								
Gui, Font, s16 c%Color5%, Verdana			
Gui, Add, Text, x20 y233 vStake5 Center, 00000 / 00000	
;____________________________________________________________ BUYIN _____________________________________________________________
						
Gui, Font, s18 c555555, Verdana							
Gui, Add, Text, x7 y285 Center, ____________	

Gui, Font, s11 c999999, Verdana					
Gui, Add, Text, x12 y318 vTotalABI Center, $0000.00 / $0000.00	
;___________________________________________________________ CLOCK/TIME _________________________________________________________		
								
Gui, Font, s18 c555555, Verdana							
Gui, Add, Text, x7 y318 Center, ____________

Gui, Font, s20 cCCCCCC, Verdana					
Gui, Add, Text, x41 y349 vClock Center, 000:000			
								
Gui, Font, s12 c999999, Verdana					
Gui, Font, Bold						
Gui, Add, Text, x73 y382 vSessionTime Center, 00:00		
;================================================================================================================================	

GuiControl,, Control1, %Stake1% - %Players1%
GuiControl,, Control2, %Stake2% - %Players2%
GuiControl,, Control3, %Stake3% - %Players3%
GuiControl,, Control4, %Stake4% - %Players4%
GuiControl,, Control5, %Stake5% - %Players5%
GuiControl,, Control6, %Stake6% 
;--------------------------------------------------------------------------------------------------------------------------------

Buyin_Total := 0.00
Buyin_Total_TournamentCounter := 0

H = 0
M1 = 0
M2 = -1

r0 = 0
r1 = 0
r2 = 0
r3 = 0
r4 = 0
r5 = 0

t1 = 0
t2 = 0
t3 = 0
t4 = 0
t5 = 0

P = 0



;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::


Loop
{
;------------------------------------------------------------ STAKE 1 -----------------------------------------------------------
  
    v1 := 0
    c1 := 0

    WinGet, v1, count, %Stake1% NL Hold'em [%Players1% ahk_class PokerStarsTableFrameClass

    Loop, %v1%
    	{	
    	c1 += 1
    	}

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

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

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

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

    v2 := 0
    c2 := 0

    WinGet, v2, count, %Stake2% NL Hold'em [%Players2% ahk_class PokerStarsTableFrameClass

    Loop, %v2%
    	{	
    	c2 += 1
    	}

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

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

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

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

    v3 := 0
    c3 := 0

    WinGet, v3, count, %Stake3% NL Hold'em [%Players3% ahk_class PokerStarsTableFrameClass

    Loop, %v3%
    	{	
    	c3 += 1
    	}

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

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

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

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

    v4 := 0
    c4 := 0

    WinGet, v4,count, %Stake4% ahk_class PokerStarsTableFrameClass 

    Loop, %v4%
    	{	
    	c4 += 1
    	}

    if (t4 = 0)
		{
		GuiControl,, Stake4, 0 / 0
    	r4 = 0
		}

    if (t4 < c4)
		{
		t4 := c4 - 1
		}

    if (c4 > r4)
    	{
		t4++
    	GuiControl,, Stake4, %c4% / %t4%
    	 r4 = %c4%
    	}

	else, if (c4 < r4)
    	{
		GuiControl,, Stake4, %c4% / %t4%
      	r4 = %c4%
    	}
;----------------------------------------------------------- STAKE 5 ------------------------------------------------------------

    v5 := 0
    c5 := 0

    WinGet, v5,count, %Stake5% NL Hold'em [%Players5% ahk_class PokerStarsTableFrameClass

    Loop, %v5%
    	{	
    	c5 += 1
    	}

    if (t5 = 0)
		{
		GuiControl,, Stake5, 0 / 0
    	r5 = 0
		}

    if (t5 < c5)
		{
		t5 := c5 - 1
		}

    if (c5 > r5)
    	{
		t5++
    	GuiControl,, Stake5, %c5% / %t5%
    	r5 = %c5%
    	}

	else, if (c5 < r5)
    	{
		GuiControl,, Stake5, %c5% / %t5%
      	r5 = %c5%
    	}
;----------------------------------------------------------- TOTALS -------------------------------------------------------------

    c0 := c1 + c2 + c3 + c4 + c5
    t0 := t1 + t2 + t3 + t4 + t5

    GuiControl,, TotalTables, %c0% / %t0%
;----------------------------------------------------------- BUYIN --------------------------------------------------------------

Buyin_Dollars:=0.00
Buyin_Dollars_TournamentCounter:=0
Buyin_Euro:=0.00
Buyin_Euro_TournamentCounter:=0
Buyin_Session:=0.00	
Buyin_Session_TournamentCounter:=0
		
Winget,Ps_Hwnd_list,List,Ahk_Class PokerStarsTableFrameClass

Loop %Ps_Hwnd_List%
{
	Hwnd:=Ps_Hwnd_List%A_index%
	IF  !(Buyin_%hwnd%)
		{
		WingetTitle,Title,Ahk_id%Hwnd%
		IF Instr(Title,"Tournament")
			{
			IF Buyin_%Hwnd%:=GetBuyin(Title,Buyin_%Hwnd%_Currency)
				{
 				BuyIn_hwnd_list:=BuyIn_hwnd_list ? BuyIn_hwnd_list "," Hwnd : Hwnd
				Buyin_Total:=Round(Buyin_Total+Buyin_%Hwnd%,2)
			    	Buyin_Total_TournamentCounter+=1
				}
			}
		}			
}	

Loop,Parse,Buyin_Hwnd_List,`,,
{
        Hwnd:=A_LoopField      
	IF WinExist("ahk_id" Hwnd)
        	{
		Currency:=Buyin_%hwnd%_Currency	
		Buyin:=Round(Buyin_%hwnd%,2)
		IF (Currency="$")
			{	
			Buyin_Dollars:=Round(Buyin_Dollars+Buyin,2)
		        Buyin_Dollars_TournamentCounter+=1
			}
		Else  IF (Currency="€")
			{		
			Buyin_Euro:=Round(Buyin_Euro+Buyin,2)
			Buyin_Euro_TournamentCounter+=1
			}		
		Buyin_Session:=Round(Buyin_Session+Buyin,2)
		Buyin_Session_TournamentCounter+=1
		}
	Else
                { 
		Temp_list:="," Buyin_Hwnd_List "," 
		StringReplace,Temp_list,Temp_list,`,Hwnd`,,,    
	        StringTrimLeft,Temp_list,Temp_list,1
		StringTrimRight,Buyin_Hwnd_List,Temp_list,1       
		}
}	
	
IF (BuyIn_Dollars_Save != BuyIn_Dollars) Or (BuyIn_Euro_Save != BuyIn_Euro) 
{
	BuyIn_Euro_Save:=BuyIn_Euro	
	BuyIn_Euro_Avg:= Round(BuyIn_Euro/BuyIn_Euro_TournamentCounter,2)		
	BuyIn_Dollars_Save:=BuyIn_Dollars
	BuyIn_Dollars_Avg:=Round(BuyIn_Dollars/BuyIn_Dollars_TournamentCounter,2)
	BuyIn_Session_Avg:=Round(BuyIn_Session/BuyIn_Session_TournamentCounter,2)
	BuyIn_Total_Avg:=Round(BuyIn_Total/BuyIn_Total_TournamentCounter,2)
		GuiControl,,Dollars,% "$" Buyin_Dollars_Avg " / $" BuyIn_Dollars
		GuiControl,,TotalABI,% "$" BuyIn_Total_Avg " / $" BuyIn_Total
		TotalBI := Round(BuyIn_Total-BuyIn_Dollars,2)
		GuiControl,,TotalBI,% "$" TotalBI "" 
}

GetBuyin(Title,byref currency="",Byref BuyinText="")
	{
	Static CurrencyList:="$,€"
 	Haystack:=Substr(Title, Instr(Title,"Sat:")+1) ;This is for satiliets
    Loop,Parse,Currencylist,`,
    	{
        IF ((StartPosBuyin := Instr(Haystack,A_loopField)) And (EndPosBuyin := Instr(Haystack,A_space,"",StartPosBuyin)))
          	{          
           	BuyinText:=Substr(Haystack,StartPosBuyin ,(EndPosBuyin - StartPosBuyin))
         	Currency=%A_loopField%
          	Buyin:=BuyinText
	  		StringReplace,Buyin,Buyin,%Currency%,, 

			IF Buyin is not number
				{ 
				Buyin:=0
				currency:=
				buyinText:=    
				}
			Break     
			}
		}
	Return Buyin 
	}
	
;----------------------------------------------------------- CLOCK --------------------------------------------------------------

FormatTime, Time, %A_Now%, H:mm
GuiControl,, Clock, %Time%
StringTrimLeft, TimeOnly, A_Now, 10
StringTrimRight, Minutes, TimeOnly, 2
IfGreaterOrEqual, Minutes, 55
	{
	Gui, Font, s20 c%ClockColorBreak%
	Gui, Font, Bold
	GuiControl, Font, Clock
	}
else
	{
	Gui, Font, s20 cCCCCCC
	Gui, Font, Bold
	GuiControl, Font, Clock
	}
;----------------------------------------------------------- TIME ---------------------------------------------------------------

If (Minutes != Var)
	{
	M2 += 1
	GuiControl,, SessionTime, %H%:%M1%%M2%
	Var := Minutes
	}

If (M2 > 9)
	{
	M1 += 1
	M2 = 0
	GuiControl,, SessionTime, %H%:%M1%%M2%
	}

If (M1 > 5)
	{
	H += 1
	M1 = 0
	M2 = 0
	GuiControl,, SessionTime, %H%:%M1%%M2%
	}
	
;----------------------------------------------------------- LOOP ---------------------------------------------------------------

   Sleep %LoopInterval%

}
return
Table Counter AHK for PokerStars Quote
08-28-2013 , 11:17 AM
Here you go:

Code:
#SingleInstance, force
;#NoTrayIcon
DetectHiddenWindows, On
SetTitleMatchMode, 2					;1=start 2=contain 3=exact match

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

GuiPos = x1700 y600						;position of GUI on screen 
								;move the window where you want it to be, then use WindowSpy to grab its coords
										
LoopInterval = 100						;counter update interval in msec (1000 = 1sec, default = 100)

Stake1 = $7.00 							;eg. "$3.50+R"
Stake2 = $15.00							;eg. "$8.00"
Stake3 = $30.00							;eg. "$15.00"
Stake4 = $38							;eg. "$35.00"
Stake5 = $74							

Players1 = 6-Max
Players2 = 6-Max
Players3 = 6-Max
Players4 = Sat
Players5 = Sat

Color1 = ff0000 						;color for table counter - stake1 
Color2 = ff0000							;color for table counter - stake2 
Color3 = ff0000							;color for table counter - stake3 
Color4 = ff8800 						;color for table counter - stake4 
Color5 = 00aaff 						;color for table counter - stake5


ClockColorBreak = FF0000				;clock color indicating sync tourney break (CCCCCC to disable this option)

;=========================================== CONFIG HOTKEYS AT BOTTOM OF THE SCRIPT =============================================

;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

;============================================================ GUI ===============================================================

Gui -MaximizeBox -Resize +AlwaysOnTop +ToolWindow -MinimizeBox
Gui, Show, W194 H350 %GuiPos%, SessionMan	
Gui, Color, 000000		
;___________________________________________________________ TOTALS _____________________________________________________________
						
Gui, Font, s18 cCCCCCC, Verdana					
Gui, Add, Text, x-12 y1 vTotalTables Center, 00000 / 00000	
								
Gui, Font, s16 c555555, Verdana					
Gui, Add, Text, x7 y14 Center, ____________				
;___________________________________________________________ STAKE 1 ____________________________________________________________
									
Gui, Font, s6 c%Color1%, Verdana				
Gui, Add, Text, x30 y45 vControl1 Center, 00000000000000000000
								
Gui, Font, s14 c%Color1%, Verdana				
Gui, Add, Text, x13 y57 vStake1 Center, 00000 / 00000		
;........................................................... STAKE 2 ............................................................
								
Gui, Font, s6 c%Color2%, Verdana				
Gui, Add, Text, x30 y89 vControl2 Center, 00000000000000000000
								
Gui, Font, s14 c%Color2%, Verdana				
Gui, Add, Text, x13 y101 vStake2 Center, 00000 / 00000		
;........................................................... STAKE 3 ............................................................
								
Gui, Font, s6 c%Color3%, Verdana				
Gui, Add, Text, x30 y133 vControl3 Center, 00000000000000000000
								
Gui, Font, s14 c%Color3%, Verdana				
Gui, Add, Text, x13 y145 vStake3 Center, 00000 / 00000		
;........................................................... STAKE 4 ............................................................
								
Gui, Font, s6 c%Color4%, Verdana				
Gui, Add, Text, x30 y177 vControl4 Center, 00000000000000000000
								
Gui, Font, s14 c%Color4%, Verdana			
Gui, Add, Text, x13 y189 vStake4 Center, 00000 / 00000			
;........................................................... STAKE 5 ............................................................
								
Gui, Font, s6 c%Color5%, Verdana				
Gui, Add, Text, x30 y221 vControl5 Center, 00000000000000000000
								
Gui, Font, s14 c%Color5%, Verdana			
Gui, Add, Text, x13 y233 vStake5 Center, 00000 / 00000	
;____________________________________________________________ BUYIN _____________________________________________________________
						
Gui, Font, s16 c555555, Verdana							
Gui, Add, Text, x7 y235 Center, ____________	

Gui, Font, s9 c999999, Verdana					
Gui, Add, Text, x16 y269 vTotalABI Center, $0000.00 / $0000.00	
;___________________________________________________________ CLOCK/TIME _________________________________________________________		
								
Gui, Font, s16 c555555, Verdana							
Gui, Add, Text, x7 y265 Center, ____________

Gui, Font, s16 cCCCCCC, Verdana					
Gui, Add, Text, x42 y296 vClock Center, 000:000		
								
Gui, Font, s10 c999999, Verdana					
Gui, Font, Bold						
Gui, Add, Text, x73 y326 vSessionTime Center, 00:00		
;================================================================================================================================	

GuiControl,, Control1, %Stake1% - %Players1%
GuiControl,, Control2, %Stake2% - %Players2%
GuiControl,, Control3, %Stake3% - %Players3%
GuiControl,, Control4, %Stake4% - %Players4%
GuiControl,, Control5, %Stake5% - %Players5%
;--------------------------------------------------------------------------------------------------------------------------------

Buyin_Total := 0.00
Buyin_Total_TournamentCounter := 0

H = 0
M1 = 0
M2 = -1

r0 = 0
r1 = 0
r2 = 0
r3 = 0
r4 = 0
r5 = 0

t1 = 0
t2 = 0
t3 = 0
t4 = 0
t5 = 0

P = 0



;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::


Loop
{
;------------------------------------------------------------ STAKE 1 -----------------------------------------------------------
  
    v1 := 0
    c1 := 0

    WinGet, v1, count, %Stake1% NL Hold'em [%Players1% ahk_class PokerStarsTableFrameClass

    Loop, %v1%
    	{	
    	c1 += 1
    	}

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

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

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

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

    v2 := 0
    c2 := 0

    WinGet, v2, count, %Stake2% NL Hold'em [%Players2% ahk_class PokerStarsTableFrameClass

    Loop, %v2%
    	{	
    	c2 += 1
    	}

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

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

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

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

    v3 := 0
    c3 := 0

    WinGet, v3, count, %Stake3% NL Hold'em [%Players3% ahk_class PokerStarsTableFrameClass

    Loop, %v3%
    	{	
    	c3 += 1
    	}

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

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

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

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

    v4 := 0
    c4 := 0

    WinGet, v4,count, %Players4%: %Stake4% ahk_class PokerStarsTableFrameClass 

    Loop, %v4%
    	{	
    	c4 += 1
    	}

    if (t4 = 0)
		{
		GuiControl,, Stake4, 0 / 0
    	r4 = 0
		}

    if (t4 < c4)
		{
		t4 := c4 - 1
		}

    if (c4 > r4)
    	{
		t4++
    	GuiControl,, Stake4, %c4% / %t4%
    	 r4 = %c4%
    	}

	else, if (c4 < r4)
    	{
		GuiControl,, Stake4, %c4% / %t4%
      	r4 = %c4%
    	}
;----------------------------------------------------------- STAKE 5 ------------------------------------------------------------

    v5 := 0
    c5 := 0

    WinGet, v5,count, %Players5%: %Stake5% ahk_class PokerStarsTableFrameClass

    Loop, %v5%
    	{	
    	c5 += 1
    	}

    if (t5 = 0)
		{
		GuiControl,, Stake5, 0 / 0
    	r5 = 0
		}

    if (t5 < c5)
		{
		t5 := c5 - 1
		}

    if (c5 > r5)
    	{
		t5++
    	GuiControl,, Stake5, %c5% / %t5%
    	r5 = %c5%
    	}

	else, if (c5 < r5)
    	{
		GuiControl,, Stake5, %c5% / %t5%
      	r5 = %c5%
    	}
;----------------------------------------------------------- TOTALS -------------------------------------------------------------

    c0 := c1 + c2 + c3 + c4 + c5
    t0 := t1 + t2 + t3 + t4 + t5

    GuiControl,, TotalTables, %c0% / %t0%
;----------------------------------------------------------- BUYIN --------------------------------------------------------------

Buyin_Dollars:=0.00
Buyin_Dollars_TournamentCounter:=0
Buyin_Euro:=0.00
Buyin_Euro_TournamentCounter:=0
Buyin_Session:=0.00	
Buyin_Session_TournamentCounter:=0
		
Winget,Ps_Hwnd_list,List,Ahk_Class PokerStarsTableFrameClass

Loop %Ps_Hwnd_List%
{
	Hwnd:=Ps_Hwnd_List%A_index%
	IF  !(Buyin_%hwnd%)
		{
		WingetTitle,Title,Ahk_id%Hwnd%
		IF Instr(Title,"Tournament")
			{
			IF Buyin_%Hwnd%:=GetBuyin(Title,Buyin_%Hwnd%_Currency)
				{
 				BuyIn_hwnd_list:=BuyIn_hwnd_list ? BuyIn_hwnd_list "," Hwnd : Hwnd
				Buyin_Total:=Round(Buyin_Total+Buyin_%Hwnd%,2)
			    	Buyin_Total_TournamentCounter+=1
				}
			}
		}			
}	

Loop,Parse,Buyin_Hwnd_List,`,,
{
        Hwnd:=A_LoopField      
	IF WinExist("ahk_id" Hwnd)
        	{
		Currency:=Buyin_%hwnd%_Currency	
		Buyin:=Round(Buyin_%hwnd%,2)
		IF (Currency="$")
			{	
			Buyin_Dollars:=Round(Buyin_Dollars+Buyin,2)
		        Buyin_Dollars_TournamentCounter+=1
			}
		Else  IF (Currency="€")
			{		
			Buyin_Euro:=Round(Buyin_Euro+Buyin,2)
			Buyin_Euro_TournamentCounter+=1
			}		
		Buyin_Session:=Round(Buyin_Session+Buyin,2)
		Buyin_Session_TournamentCounter+=1
		}
	Else
                { 
		Temp_list:="," Buyin_Hwnd_List "," 
		StringReplace,Temp_list,Temp_list,`,Hwnd`,,,    
	        StringTrimLeft,Temp_list,Temp_list,1
		StringTrimRight,Buyin_Hwnd_List,Temp_list,1       
		}
}	
	
IF (BuyIn_Dollars_Save != BuyIn_Dollars) Or (BuyIn_Euro_Save != BuyIn_Euro) 
{
	BuyIn_Euro_Save:=BuyIn_Euro	
	BuyIn_Euro_Avg:= Round(BuyIn_Euro/BuyIn_Euro_TournamentCounter,2)		
	BuyIn_Dollars_Save:=BuyIn_Dollars
	BuyIn_Dollars_Avg:=Round(BuyIn_Dollars/BuyIn_Dollars_TournamentCounter,2)
	BuyIn_Session_Avg:=Round(BuyIn_Session/BuyIn_Session_TournamentCounter,2)
	BuyIn_Total_Avg:=Round(BuyIn_Total/BuyIn_Total_TournamentCounter,2)
		GuiControl,,Dollars,% "$" Buyin_Dollars_Avg " / $" BuyIn_Dollars
		GuiControl,,TotalABI,% "$" BuyIn_Total_Avg " / $" BuyIn_Total
		TotalBI := Round(BuyIn_Total-BuyIn_Dollars,2)
		GuiControl,,TotalBI,% "$" TotalBI "" 
}

GetBuyin(Title,byref currency="",Byref BuyinText="")
	{
	Static CurrencyList:="$,€"
 	Haystack:=Substr(Title, Instr(Title,"Sat:")+1) ;This is for satiliets
    Loop,Parse,Currencylist,`,
    	{
        IF ((StartPosBuyin := Instr(Haystack,A_loopField)) And (EndPosBuyin := Instr(Haystack,A_space,"",StartPosBuyin)))
          	{          
           	BuyinText:=Substr(Haystack,StartPosBuyin ,(EndPosBuyin - StartPosBuyin))
         	Currency=%A_loopField%
          	Buyin:=BuyinText
	  		StringReplace,Buyin,Buyin,%Currency%,, 

			IF Buyin is not number
				{ 
				Buyin:=0
				currency:=
				buyinText:=    
				}
			Break     
			}
		}
	Return Buyin 
	}
	
;----------------------------------------------------------- CLOCK --------------------------------------------------------------

FormatTime, Time, %A_Now%, H:mm
GuiControl,, Clock, %Time%
StringTrimLeft, TimeOnly, A_Now, 10
StringTrimRight, Minutes, TimeOnly, 2
IfGreaterOrEqual, Minutes, 55
	{
	Gui, Font, s16 c%ClockColorBreak%
	;Gui, Font, Bold
	GuiControl, Font, Clock
	}
else
	{
	Gui, Font, s16 cCCCCCC
	;Gui, Font, Bold
	GuiControl, Font, Clock
	}
;----------------------------------------------------------- TIME ---------------------------------------------------------------

If (Minutes != Var)
	{
	M2 += 1
	GuiControl,, SessionTime, %H%:%M1%%M2%
	Var := Minutes
	}

If (M2 > 9)
	{
	M1 += 1
	M2 = 0
	GuiControl,, SessionTime, %H%:%M1%%M2%
	}

If (M1 > 5)
	{
	H += 1
	M1 = 0
	M2 = 0
	GuiControl,, SessionTime, %H%:%M1%%M2%
	}
	
;----------------------------------------------------------- LOOP ---------------------------------------------------------------

   Sleep %LoopInterval%

}
return


- fixed appearance for 120DPI (125%)
- fixed Stake4 & Stake5 to count sattys

HTH GL HF

Last edited by Baobhan-Sith; 08-28-2013 at 11:22 AM.
Table Counter AHK for PokerStars Quote
08-29-2013 , 09:33 AM
<3 tyty
Table Counter AHK for PokerStars Quote
09-06-2013 , 07:52 PM
Quote:
Originally Posted by Baobhan-Sith
NP, this should do it, lmk if it doesn't:

Code:
#SingleInstance, force
#NoTrayIcon
DetectHiddenWindows, On
SetTitleMatchMode, 2					;1=start 2=contain 3=exact match

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

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

GuiPos = x5 y5						;position of GUI on screen 
										;move the window where you want it to be, then use WindowSpy to grab its coords
										
LoopInterval = 100						;counter update interval in msec (1000 = 1sec, default = 100)

Stake1 = $3.50+R						;eg. "$3.50+R"
Stake2 = $8.00							;eg. "$8.00"
Stake3 = $15.00							;eg. "$15.00"
Stake4 = Gtd							;eg. "Gtd"

Color1 = 00AAFF 						;color for table counter - stake1 
Color2 = FF66FF							;color for table counter - stake2 
Color3 = 58FAAC							;color for table counter - stake3 
Color4 = ffff00 						;color for table counter - stake4 

CurrentLimit = 14						;desired table limit (current)
TotalLimit = 100						;desired table limit (session)
SoundInterval = 25						;SoundAchieve replays after "TotalLimit" + N tables
SessionTimeLimit = 6:00					;desired session time limit (h:mm)
MaxABI = 25								;maximum desired ABI (session)

LimitColor = 33FF33						;color of 'SessionTime' and 'TotalTables' counters after reaching their set limits 
ClockColorBreak = FF0000				;clock color indicating sync tourney break (CCCCCC to disable this option)

RebuyMulti = 3						;stake multiplier for rebuy tourneys (ABI/Stake) 
										;!!!EDIT LINE 392!!! 


;=========================================== CONFIG HOTKEYS AT BOTTOM OF THE SCRIPT =============================================

;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

;============================================================ GUI ===============================================================

Gui -MaximizeBox -Resize +AlwaysOnTop +ToolWindow -MinimizeBox
Gui, Show, %GuiPos%
Gui, Show, W194 H316, SessionMan 2.1.1				
Gui, Color, 000000		
;___________________________________________________________ TOTALS _____________________________________________________________
						
Gui, Font, s22 cCCCCCC, Verdana					
Gui, Add, Text, x-8 y1 vTotalTables Center, 00000 / 00000	
								
Gui, Font, s18 c555555, Verdana					
Gui, Add, Text, x7 y14 Center, ____________				
;___________________________________________________________ STAKE 1 ____________________________________________________________
									
Gui, Font, s8 c%Color1%, Verdana				
Gui, Add, Text, x27 y45 vControl1 Center, 00000000000000000000
								
Gui, Font, s16 c%Color1%, Verdana				
Gui, Add, Text, x20 y57 vStake1 Center, 00000 / 00000		
;........................................................... STAKE 2 ............................................................
								
Gui, Font, s8 c%Color2%, Verdana				
Gui, Add, Text, x27 y89 vControl2 Center, 00000000000000000000
								
Gui, Font, s16 c%Color2%, Verdana				
Gui, Add, Text, x20 y101 vStake2 Center, 00000 / 00000		
;........................................................... STAKE 3 ............................................................
								
Gui, Font, s8 c%Color3%, Verdana				
Gui, Add, Text, x27 y133 vControl3 Center, 00000000000000000000
								
Gui, Font, s16 c%Color3%, Verdana				
Gui, Add, Text, x20 y145 vStake3 Center, 00000 / 00000		
;........................................................... STAKE 4 ............................................................
								
Gui, Font, s8 c%Color4%, Verdana				
Gui, Add, Text, x27 y177 vControl4 Center, 00000000000000000000
								
Gui, Font, s16 c%Color4%, Verdana			
Gui, Add, Text, x20 y189 vStake4 Center, 00000 / 00000	
;____________________________________________________________ BUYIN _____________________________________________________________
								
Gui, Font, s18 c555555, Verdana					
Gui, Add, Text, x7 y194 Center, ____________			
								
;Gui, Font, s14 cCCCCCC, Verdana					
;Gui, Add, Text, x-6 y272 vDollars Center, $0000.00 / $0000.00	
								
Gui, Font, s14 c999999, Verdana					
Gui, Add, Text, x51 y225 vTotalABI Center, $0000.00 
;___________________________________________________________ CLOCK/TIME _________________________________________________________
								
Gui, Font, s18 c555555, Verdana					
Gui, Add, Text, x7 y229 Center, ____________			
								
Gui, Font, s20 cCCCCCC, Verdana					
Gui, Add, Text, x41 y257 vClock Center, 000:000			
								
Gui, Font, s12 c999999, Verdana					
Gui, Font, Bold						
Gui, Add, Text, x73 y292 vSessionTime Center, 00:00		
;================================================================================================================================	

GuiControl,, Control1, %Stake1%
GuiControl,, Control2, %Stake2%
GuiControl,, Control3, %Stake3%
GuiControl,, Control4, %Stake4%
;--------------------------------------------------------------------------------------------------------------------------------

Buyin_Total := 0.00
Buyin_Total_TournamentCounter := 0

H = 0
M1 = 0
M2 = -1

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

t1 = 0
t2 = 0
t3 = 0
t4 = 0
;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::


Loop
{
;------------------------------------------------------------ STAKE 1 -----------------------------------------------------------
  
    v1 := 0
    c1 := 0

    WinGet, v1, count, %Stake1% ahk_class PokerStarsTableFrameClass

    Loop, %v1%
    	{	
    	c1 += 1
    	}

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

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

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

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

    v2 := 0
    c2 := 0

    WinGet, v2, count, %Stake2% ahk_class PokerStarsTableFrameClass

    Loop, %v2%
    	{	
    	c2 += 1
    	}

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

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

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

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

    v3 := 0
    c3 := 0

    WinGet, v3, count, %Stake3% ahk_class PokerStarsTableFrameClass

    Loop, %v3%
    	{	
    	c3 += 1
    	}

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

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

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

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

    v4 := 0
    c4 := 0

    WinGet, v4,count, %Stake4% ahk_class PokerStarsTableFrameClass 

    Loop, %v4%
    	{	
    	c4 += 1
    	}

    if (t4 = 0)
		{
		GuiControl,, Stake4, 0 / 0
    	r4 = 0
		}

    if (t4 < c4)
		{
		t4 := c4 - 1
		}

    if (c4 > r4)
    	{
		t4++
    	GuiControl,, Stake4, %c4% / %t4%
    	 r4 = %c4%
    	}

	else, if (c4 < r4)
    	{
		GuiControl,, Stake4, %c4% / %t4%
      	r4 = %c4%
    	}

;----------------------------------------------------------- TOTALS -------------------------------------------------------------

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

    GuiControl,, TotalTables, %c0% / %t0%

    if (c0 < r0)
    	{
		SoundPlay, %SoundBust%
    	}
	
    r0 = %c0%

    if (c0 < CurrentLimit)
		{
		Gui, Font, s22 cCCCCCC, Verdana
		GuiControl, Font, TotalTables
		}

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

    if (t0 = TotalLimit)
    	{
		SoundPlay, %SoundAchieve%
		TotalLimit := t0 + SoundInterval
    	}
;----------------------------------------------------------- BUYIN --------------------------------------------------------------

Buyin_Dollars:=0.00
Buyin_Dollars_TournamentCounter:=0
Buyin_Euro:=0.00
Buyin_Euro_TournamentCounter:=0
Buyin_Session:=0.00	
Buyin_Session_TournamentCounter:=0
		
Winget,Ps_Hwnd_list,List,Ahk_Class PokerStarsTableFrameClass

Loop %Ps_Hwnd_List%
{
	Hwnd:=Ps_Hwnd_List%A_index%
	IF  !(Buyin_%hwnd%)
		{
		WingetTitle,Title,Ahk_id%Hwnd%
		IF Instr(Title,"Tournament")
			{
			IF Buyin_%Hwnd%:=GetBuyin(Title,Buyin_%Hwnd%_Currency)
				{
 				BuyIn_hwnd_list:=BuyIn_hwnd_list ? BuyIn_hwnd_list "," Hwnd : Hwnd
				Buyin_Total:=Round(Buyin_Total+Buyin_%Hwnd%,2)
			    	Buyin_Total_TournamentCounter+=1
				}
			}
		}			
}	

Loop,Parse,Buyin_Hwnd_List,`,,
{
        Hwnd:=A_LoopField      
	IF WinExist("ahk_id" Hwnd)
        	{
		Currency:=Buyin_%hwnd%_Currency	
		Buyin:=Round(Buyin_%hwnd%,2)
		IF (Currency="$")
			{	
			Buyin_Dollars:=Round(Buyin_Dollars+Buyin,2)
		        Buyin_Dollars_TournamentCounter+=1
			}
		Else  IF (Currency="€")
			{		
			Buyin_Euro:=Round(Buyin_Euro+Buyin,2)
			Buyin_Euro_TournamentCounter+=1
			}		
		Buyin_Session:=Round(Buyin_Session+Buyin,2)
		Buyin_Session_TournamentCounter+=1
		}
	Else
                { 
		Temp_list:="," Buyin_Hwnd_List "," 
		StringReplace,Temp_list,Temp_list,`,Hwnd`,,,    
	        StringTrimLeft,Temp_list,Temp_list,1
		StringTrimRight,Buyin_Hwnd_List,Temp_list,1       
		}
}	
	
IF (BuyIn_Dollars_Save != BuyIn_Dollars) Or (BuyIn_Euro_Save != BuyIn_Euro) 
{
	BuyIn_Euro_Save:=BuyIn_Euro	
	BuyIn_Euro_Avg:= Round(BuyIn_Euro/BuyIn_Euro_TournamentCounter,2)		
	BuyIn_Dollars_Save:=BuyIn_Dollars
	BuyIn_Dollars_Avg:=Round(BuyIn_Dollars/BuyIn_Dollars_TournamentCounter,2)
	BuyIn_Session_Avg:=Round(BuyIn_Session/BuyIn_Session_TournamentCounter,2)
	BuyIn_Total_Avg:=Round(BuyIn_Total/BuyIn_Total_TournamentCounter,2)
		;GuiControl,,Dollars,% "$" Buyin_Dollars_Avg " / $" BuyIn_Dollars
		GuiControl,,TotalABI,% "$" BuyIn_Total_Avg "" ;/ $" BuyIn_Total
}

GetBuyin(Title,byref currency="",Byref BuyinText="")
	{
	Static CurrencyList:="$,€"
 	Haystack:=Substr(Title, Instr(Title,"Sat:")+1) ;This is for satiliets
    Loop,Parse,Currencylist,`,
    	{
        IF ((StartPosBuyin := Instr(Haystack,A_loopField)) And (EndPosBuyin := Instr(Haystack,A_space,"",StartPosBuyin)))
          	{          
           	BuyinText:=Substr(Haystack,StartPosBuyin ,(EndPosBuyin - StartPosBuyin))
         	Currency=%A_loopField%
          	Buyin:=BuyinText
	  		StringReplace,Buyin,Buyin,%Currency%,, 
			IfInString, Buyin, +R
				{	
          		StringReplace,Buyin,Buyin,+R,, 
				RebuyMulti = 3
				Buyin := Buyin * RebuyMulti					
				}
             
			IF Buyin is not number
				{ 
				Buyin:=0
				currency:=
				buyinText:=    
				}
			Break     
			}
		}
	Return Buyin 
	}
;----------------------------------------------------------- CLOCK --------------------------------------------------------------

FormatTime, Time, %A_Now%, H:mm
GuiControl,, Clock, %Time%
StringTrimLeft, TimeOnly, A_Now, 10
StringTrimRight, Minutes, TimeOnly, 2
IfGreaterOrEqual, Minutes, 55
	{
	Gui, Font, s20 c%ClockColorBreak%
	Gui, Font, Bold
	GuiControl, Font, Clock
	}
else
	{
	Gui, Font, s20 cCCCCCC
	Gui, Font, Bold
	GuiControl, Font, Clock
	}
;----------------------------------------------------------- TIME ---------------------------------------------------------------

If (Minutes != Var)
	{
	M2 += 1
	GuiControl,, SessionTime, %H%:%M1%%M2%
	Var := Minutes
	}

If (M2 > 9)
	{
	M1 += 1
	M2 = 0
	GuiControl,, SessionTime, %H%:%M1%%M2%
	}

If (M1 > 5)
	{
	H += 1
	M1 = 0
	M2 = 0
	GuiControl,, SessionTime, %H%:%M1%%M2%
	}
	
Limit = %H%:%M1%%M2%
If (Limit = SessionTimeLimit)
	{
	Gui, Font, s12 c%LimitColor%, Verdana
	GuiControl, Font, SessionTime
	}
;----------------------------------------------------------- LOOP ---------------------------------------------------------------

   Sleep %LoopInterval%

}
return
;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::: HOTKEYS :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

^F9::				;counter (SessionTime) reset
{
H = 0
M1 = 0
M2 = 0
Gui, Font, s12 c999999, Verdana
GuiControl, Font, SessionTime
GuiControl,, SessionTime, %H%:%M1%%M2%
}
return
;................................................................................................................................

^F10::				;counter (SessionTime) + 1
Var = -1
return
;................................................................................................................................

^Q::ExitApp
;................................................................................................................................

GuiClose:
ExitApp


gl hf
hello, not good at this stuff and couldn`t figure it out.
can you please replace 8$ 180s with 15$ 45s ? now when i open 15$ 45s they just count towards 15$ 180s
Table Counter AHK for PokerStars Quote
09-08-2013 , 07:44 AM
never mind got it figured out myself.
Table Counter AHK for PokerStars Quote

      
m