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

09-12-2010 , 03:59 AM
I wrote a quick and dirty script because I couldn't find one elsewhere.

All it does is count your open tables and display them in a little window. It doesn't flicker, use a lot of CPU, or sell you Viagra. Script is provided as-is and I'll likely never work on it again.

Code:
#SingleInstance

Gui -MaximizeBox -Resize -MinimizeBox +AlwaysOnTop
Gui, Color, 000000
Gui, Font, s20 cWhite, Verdana
Gui, Add, Text, vMyControl Center, ---
Gui, Show, W90 H65, Tbls
lasttables = -1

Loop
{
    numtables := 0

    ;snippet will find all pokerstars windows
    WinGet, id, list, ahk_class PokerStarsTableFrameClass,, Program Manager
    Loop, %id%
    {
        numtables += 1
    }

    if (numtables != lasttables)
    {
        GuiControl,, MyControl, %numtables%
        lasttables = %numtables%
    }
    Sleep 1000

}

return

GuiClose:
ExitApp

Last edited by Daxonovitch; 09-12-2010 at 04:13 AM. Reason: Fixed code.
Table Counter AHK for PokerStars Quote
09-12-2010 , 06:17 AM
thanks, cool script
Table Counter AHK for PokerStars Quote
09-12-2010 , 09:00 AM
Oh snap

tyvm
Table Counter AHK for PokerStars Quote
09-12-2010 , 01:31 PM
I'll make use of this. Thank you.
Table Counter AHK for PokerStars Quote
09-17-2010 , 12:24 AM
Anyway I can make the box a little bigger then its default size?

I changed the numbers on "W" and "H" to double on both - still doesnt do what id like. Want the number small - able to show any amount of numbers, etc. Possibly? I changed the part that I assumed was size (s20) but that didnt work either... let me know if its possible. Thanks.

Last edited by 4entourage; 09-17-2010 at 12:42 AM.
Table Counter AHK for PokerStars Quote
09-17-2010 , 02:52 AM
Should be able to just change the numbers of W and H, just make sure there's no space:

Gui, Show, W180 H130, Tbls

Try that. "S20" refers to the size of the font face. It should be able to display up to 99 tables fine (are you playing more than 99? eep).. works fine for me up to 20. If you still have clipping, change the "---" to like.. "-----" - that's just in place to make the text label spacer.
Table Counter AHK for PokerStars Quote
10-13-2010 , 12:23 AM
Would it be easy to get this to work for FT?
Table Counter AHK for PokerStars Quote
10-13-2010 , 01:38 AM
I am fiercely biased against FTP and won't have anything to do with them, sorry.

Someone else may be willing to take up the project, it shouldn't be hard.
Table Counter AHK for PokerStars Quote
10-13-2010 , 06:21 AM
Daxonovitch,

Just wanted to say thanks!
Table Counter AHK for PokerStars Quote
12-01-2010 , 06:51 PM
Nice scrip mate, cheers. Been on at TN to add something like this for ages and with the free beta version of hjalper being pulled this is a very needed addition.
Table Counter AHK for PokerStars Quote
12-02-2010 , 01:20 AM
No sweat, wayne. Now as soon as Stars makes it so you can see which tournaments in the lobby you're registered for, I'll be happy.
Table Counter AHK for PokerStars Quote
12-02-2010 , 02:11 PM
awesome.. thanks!!!
Table Counter AHK for PokerStars Quote
12-02-2010 , 04:17 PM
Please anyone tweak this a little so it counts all tables opened since running the script. I'd like to see how many SNG I've fired up during long sessions of continuous play.

Last edited by Baobhan-Sith; 12-02-2010 at 04:37 PM.
Table Counter AHK for PokerStars Quote
12-02-2010 , 05:54 PM
wouldnt HEM tell you this??? or TN???
Table Counter AHK for PokerStars Quote
12-02-2010 , 06:13 PM
Quote:
Originally Posted by Baobhan-Sith
Please anyone tweak this a little so it counts all tables opened since running the script. I'd like to see how many SNG I've fired up during long sessions of continuous play.
Code:
#NoEnv
#SingleInstance force
#Include %a_scriptDir%
Process, priority, , High
SendMode Input
SetWorkingDir %a_scriptDir%

F8::
sngcount()
return

sngcount() {

; CurrentDate := ""
FileCount := 0

FormatTime, CurrentDate, A_Now, yyyyMMdd

;the trailing backslash MUST be included - since it's a folder
Folder1 := "C:\Users\Mike\AppData\Local\PokerStars\HandHistory\"
Folder2 := "C:\hhs\2010\"

Loop, 2
{
    ;the first value (0) means files only
    ;the second value (1) means include subfolders
    Loop, % Folder%A_Index% . "*", 0, 1
    {
        if inStr(A_LoopFileName, CurrentDate)
        {
            FileCount++
        }
    }
}


setTrayTip("" . FileCount . " played. ")
}

RemoveTrayTip:
SetTimer, RemoveTrayTip, Off
TrayTip
return

setTrayTip(text, seconds=5, options=1) {
    ms := seconds * 1000
    TrayTip, Daily Tournament Counter, %text%, , %options%
    SetTimer RemoveTrayTip, %ms%
    return
}
Primitive, but works. Something I pieced together for a friend this past February. You're going to want to edit the hand history folders and possibly the hotkey.

Feel free to take this code and make it sexier, or include it as a function in another script.
Table Counter AHK for PokerStars Quote
12-02-2010 , 07:07 PM
Quote:
Originally Posted by juandadi
wouldnt HEM tell you this??? or TN???
I don't have TN, starshotkeys here, and lately I'm getting heavy performance issues when playing >16 tables with HEM due to my slow, old comp, so basically I'm playing w/o any of these progs atm (at least until I get a new comp).

Gnumsploitz, thank you very much for this script. I've yet to test it but unfortunately I assume that's not what I'm looking for. I thought it'd be possible to apply some minor changes to OP's counting routine to have the script counting new tables continuously. The GUI window should be pretty much the same as OP uses (static, always on top), I'd just go ahead and change its font color.

Basically I need to permanently see both the number of running tables as well as the number of total SNG played (even if I had HEM running it'd just be comfortable to see the numbers at a glance). I wouldn't mind if both numbers would be displayed within a single GUI window (#running/#total), but one window for each # would be totally fine imo.

Last edited by Baobhan-Sith; 12-02-2010 at 07:13 PM. Reason: gonna test your script anyways, thx again
Table Counter AHK for PokerStars Quote
12-02-2010 , 07:39 PM
Nvm, guess I got it:
Code:
;-----------SessionCount.ahk----------------

#SingleInstance

Gui -MaximizeBox -Resize -MinimizeBox +AlwaysOnTop
Gui, Color, 000000
Gui, Font, s20 c00ff00, Verdana
Gui, Add, Text, vMyControl Center, -----
Gui, Show, W110 H65, Session
lasttables = 0

Loop
{
    numtables := 0
    WinGet, id, count, ahk_class PokerStarsTableFrameClass,, Program Manager
    Loop, %id%
    {
        numtables += 1
    }
    if (numtables > lasttables)
    {
        count++
        GuiControl,, MyControl, %count%
        lasttables = %numtables%
    }
	else, if (numtables < lasttables)
    {
        GuiControl,, MyControl, %count%
        lasttables = %numtables%
    }
    Sleep 1000
}
return

GuiClose:
ExitApp
This one works as expected; it counts all tables opened during a session. It has to be restarted in order to be reset.

Last edited by Baobhan-Sith; 12-02-2010 at 08:00 PM. Reason: description
Table Counter AHK for PokerStars Quote
12-03-2010 , 05:11 AM
Code:
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
#SingleInstance,Force

numtables:=0
TotalTabelsOpend:=0

Menu,TableCounter,Add,Reset Counter, ResetCounter
Menu,Tablecounter,Add,Exit,GuiClose
Gui -MaximizeBox  -MinimizeBox +AlwaysOnTop  +Caption   ;  Change +/- Caption To remove Or Add titlebar
Gui, Color, 000000
Gui, Font, s20 cWhite, Verdana

;Gui,Margin,10,10 					;change margin between controls and border
Gui, Add, Text, vMyControl Center,0000
Gui, Add, Text, y+ cGreen vTotalTabelsOpend Center,0000

Gui, Show,    AutoSize , Tbls

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

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



TableCounter:

    numtables := 0

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


    if (numtables != lasttables) OR  (SaveTotalTabelsOpend != TotalTabelsOpend)
    {
       
     GuiControl,, MyControl, %numtables%
        lasttables = %numtables%
        SaveTotalTabelsOpend = %TotalTabelsOpend%
        GuiControl,, TotalTabelsOpend,%TotalTabelsOpend%
    
    }


return

GuiContextMenu:
Menu, TableCounter, Show  
Return

ResetCounter:
GuiControl,, TotalTabelsOpend,0 
Return

GuiClose:
ExitApp

Return

;#######################################################################
WM_LBUTTONDOWN()
{
	PostMessage, 0xA1, 2
}
Table Counter AHK for PokerStars Quote
12-03-2010 , 02:23 PM
Wow that's great, ty very much.

However I had to add SetTitleMatchMode, 2 and had to remove " " in IF InStr to get the "total" counter to work (tested in cashgames; gonna test it with SNG tonite).

edit: still having some issues, gonna describe later

Last edited by Baobhan-Sith; 12-03-2010 at 02:37 PM.
Table Counter AHK for PokerStars Quote
12-03-2010 , 03:06 PM
Code:
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
#SingleInstance,Force

numtables:=0
TotalTabelsOpend:=0

Menu,TableCounter,Add,Reset Counter, ResetCounter
Menu,Tablecounter,Add,Exit,GuiClose
Gui -MaximizeBox  -MinimizeBox +AlwaysOnTop  +Caption   ;  Change +/- Caption To remove Or Add titlebar
Gui, Color, 000000
Gui, Font, s20 cWhite, Verdana

Gui,Margin,10,10
Gui, Add, Text, vMyControl Center,0000
Gui, Add, Text, y+ cGreen vTotalTabelsOpend Center,0000

Gui, Show,    AutoSize , Tbls

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

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


TableCounter:

    numtables := 0

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


    if (numtables != lasttables) OR  (SaveTotalTabelsOpend != TotalTabelsOpend)
    {
       
     GuiControl,, MyControl, %numtables%
        lasttables = %numtables%
        SaveTotalTabelsOpend = %TotalTabelsOpend%
        GuiControl,, TotalTabelsOpend,%TotalTabelsOpend%
    
    }


return

GuiContextMenu:
Menu, TableCounter, Show  
Return

ResetCounter:
GuiControl,, TotalTabelsOpend,0 
Return

GuiClose:
ExitApp

Return

;#######################################################################
WM_LBUTTONDOWN()
{
	PostMessage, 0xA1, 2
}

Did not Test the Code,Thoud that id Containd the Hwnd of the window.Made a Fix

Last edited by mister x; 12-03-2010 at 03:22 PM.
Table Counter AHK for PokerStars Quote
12-03-2010 , 03:20 PM
Very useful script, thanks. Is there an easy way to have the table number displayed as a tray icon instead of the small window? This would be a nice addition, IMO.
Table Counter AHK for PokerStars Quote
12-03-2010 , 04:24 PM
Code:
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
#SingleInstance,Force

numtables:=0
TotalTabelsOpend:=0


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

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

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

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

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


TableCounter:

    numtables := 0

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


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


return

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

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

Return

GuiContextMenu:
Menu, TableCounter, Show  
Return

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

GuiClose:
ExitApp

Return
Mimimize to tray funtion Added
Note To myzelf dont Program and do 6 miljoen things at the same time
bug fix Total Counter reset

Last edited by mister x; 12-03-2010 at 04:52 PM.
Table Counter AHK for PokerStars Quote
12-03-2010 , 04:42 PM
"Reset" does not work properly; although it seemingly resets to zero it won't restart counting from zero. Pretty much irrelevant tho since you can just restart the script. Anything else seems to work fine, good job, thx alot.
Table Counter AHK for PokerStars Quote
12-03-2010 , 05:49 PM
Quote:
Originally Posted by cygenius
Very useful script, thanks. Is there an easy way to have the table number displayed as a tray icon instead of the small window? This would be a nice addition, IMO.
Taskbar or tray? Taskbar should be easy, tray would be hard (you'd probably have to find icons for numbers up to the max). For windows7 people, it wouldn't help since the taskbar icons don't have the title text shown, anyway.
Table Counter AHK for PokerStars Quote
02-09-2011 , 03:11 AM
Thanks a lot for the AHK !
Table Counter AHK for PokerStars Quote

      
m