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

09-12-2016 , 05:26 PM
Quote:
Originally Posted by Baobhan-Sith
Time for another useless update, even if it's only to show how pompous and self-important a person I just became.

Changes:
- added a progress window
- added a context menu upon right-clicking the main window
- pause function will now only pause the counters, but not the clock and other functions
- both main window and progress window visually indicate the pause state
- re-implemented the pause hotkey
- added a color code generator (source: http://ahkscript.org/boards/viewtopic.php?f=6&t=65)
- you can now save and restore the positions of main~, progress~, and settings window via the context menu (all at once obv)
- some minor things and fixes






Download SessionMan2.6.3.ahk (ul.to)
I download it the SessionMan2.6.3 version but is just an ahk file, how can i open both the Progress and settings windows?
Table Counter AHK for PokerStars Quote
09-12-2016 , 05:53 PM
Quote:
Originally Posted by Baobhan-Sith
Made a settings GUI window and added some more options, including ability to log your sessions. Just rightclick the tray icon to see the magic.

You can now easily create game type definitions yourself (limited to SNG and tourneys for now). I included a brief description under the "Types" tab.

Note: The script will now create an ini file in its root folder (the logfile will go there as well). On first startup, the edit boxes will auto-populate with default values, and the same will happen if you delete the ini file or if you save your settings while leaving a box empty. Also note that saving settings will force the script to restart, so don't change the settings during a sessions.

Known bug: For now it's not possible to change hotkeys via the settings GUI. You still have to go through the last code section to edit these. The hotkey edit boxes for now just function as a reminder; you can change these but it will have no effect.


Spoiler:
Code:
#SingleInstance, force
#NoEnv
;#NoTrayIcon
DetectHiddenWindows, On
SetTitleMatchMode, 1					;1=begin with 2=contain 3=exact match

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

Build = 2.3.6

LoopInterval = 100					;counter update interval in msec (1000 = 1sec, default = 100)

;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! EDIT REBUY MULTIPLICATOR AT LINE 846 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

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

;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! EDIT CONTROL COORDS IN THE GUI SECTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

;====================================================== SECTION END =============================================================
;================================================================================================================================

Menu Tray, NoStandard
Menu Tray, Add, Bring To Front, TrayMenuHdlr_Bring
Menu Tray, Add
Menu Tray, Add, Save Position, TrayMenuHdlr_Position
Menu Tray, Add, Reload Script, TrayMenuHdlr_Reload
Menu Tray, Add
Menu Tray, Add, Enable Logging, TrayMenuHdlr_Log
Menu Tray, Add, Open Logfile, TrayMenuHdlr_Logfile
Menu Tray, Add, Clear Logfile, TrayMenuHdlr_ClrLog
Menu Tray, Add
Menu Tray, Add, Settings, TrayMenuHdlr_Config
Menu Tray, Add
Menu Tray, Add, Pause/Continue, TrayMenuHdlr_Pause
Menu Tray, Add, Exit, TrayMenuHdlr_Exit

FormatTime, Start, %A_Now%, ddd d.M.yyyy H:mm:ss
GoSub CheckIni
GoSub ReadIni
Gosub CheckLogging

If (ColorsBox = 0)
Loop, 9
	{
	C += 1
	Color%C% := NumColor
	}
	
IniRead, xpos, %A_ScriptDir%\SessionMan.ini, GuiPos, x
IniRead, ypos, %A_ScriptDir%\SessionMan.ini, GuiPos, y

ABI := "  ABI  "
Invest := "  Invest  "
Gamesh := "  Games/h  "
Clock := "  Clock  "
Time := "  Time "
 
;================================================================================================================================
;====================================================== GUI SECTION =============================================================

Gui -MaximizeBox -Resize +AlwaysOnTop ;+ToolWindow -MinimizeBox
Gui, Show, W376 H305 x%xpos% y%ypos%, SessionMan %Build%	
Gui, Color, %GUIColor%		

;................................................................................................................................
;...................................................... VPP/FPP/TOTALS ...........................................................

Gui, Font, s10 c%TextColor%, Verdana					
Gui, Add, Text, x38 y6 Center, VPP
Gui, Font, s11 c%NumColor%, Verdana					
Gui, Add, Text, x18 y24 vVPP Center, 0000.00 
						
Gui, Font, s8 c%TextColor%, Verdana					
Gui, Add, Text, x152 y0 Center, Total Tables
Gui, Font, s22 c%NumColor%, Verdana					
Gui, Add, Text, x109 y13 vTotalTables Center, 000 / 0000	

Gui, Font, s10 c%TextColor%, Verdana					
Gui, Add, Text, x311 y6 Center, FPP
Gui, Font, s11 c%NumColor%, Verdana					
Gui, Add, Text, x285 y24 vFPP Center, 00000.00	

;................................................................................................................................
;....................................................... SEPARATOR1 .............................................................	
							
Gui, Font, s10 c%TextColor%, Verdana					
Gui, Add, Text, x37 y50 vControlL Center, 000000
							
Gui, Font, s10 c%TextColor%, Verdana					
Gui, Add, Text, x164 y50 vControlM Center, 000000				
							
Gui, Font, s10 c%TextColor%, Verdana					
Gui, Add, Text, x292 y50 vControlR Center, 000000
							
Gui, Font, s10 c%SeparatorColor%, Verdana					
Gui, Add, Text, x4 y45 Center, ____
					
Gui, Font, s10 c%SeparatorColor%, Verdana					
Gui, Add, Text, x86 y45 Center, __________

Gui, Font, s10 c%SeparatorColor%, Verdana					
Gui, Add, Text, x212 y45 Center, __________
				
Gui, Font, s10 c%SeparatorColor%, Verdana					
Gui, Add, Text, x338 y45 Center, ____
;................................................................................................................................
;..................................................... TABLE COUNTERS ...........................................................		
;......................................................... STAKE 1 ..............................................................
						
Gui, Font, s8 c%Color1%, Verdana				
Gui, Add, Text, x37 y70 vControl1 Center, $000.00
								
Gui, Font, s16 c%Color1%, Verdana				
Gui, Add, Text, x3 y82 vStake1 Center, 000 / 0000	
	
;......................................................... STAKE 2 ..............................................................
								
Gui, Font, s8 c%Color2%, Verdana				
Gui, Add, Text, x37 y114 vControl2 Center, $000.00
								
Gui, Font, s16 c%Color2%, Verdana				
Gui, Add, Text, x3 y126 vStake2 Center, 000 / 0000	
	
;......................................................... STAKE 3 ..............................................................
								
Gui, Font, s8 c%Color3%, Verdana				
Gui, Add, Text, x37 y158 vControl3 Center, $000.00
								
Gui, Font, s16 c%Color3%, Verdana				
Gui, Add, Text, x3 y170 vStake3 Center, 000 / 0000	
	
;................................................................................................................................		
;......................................................... STAKE 4 ..............................................................
								
Gui, Font, s8 c%Color4%, Verdana				
Gui, Add, Text, x165 y70 vControl4 Center, $000.00
								
Gui, Font, s16 c%Color4%, Verdana			
Gui, Add, Text, x131 y82 vStake4 Center, 000 / 0000		
	
;......................................................... STAKE 5 ..............................................................
								
Gui, Font, s8 c%Color5%, Verdana				
Gui, Add, Text, x165 y114 vControl5 Center, $000.00
								
Gui, Font, s16 c%Color5%, Verdana			
Gui, Add, Text, x131 y126 vStake5 Center, 000 / 0000	
	
;......................................................... STAKE 6 ..............................................................
								
Gui, Font, s8 c%Color6%, Verdana				
Gui, Add, Text, x165 y158 vControl6 Center, $000.00
								
Gui, Font, s16 c%Color6%, Verdana				
Gui, Add, Text, x131 y170 vStake6 Center, 000 / 0000	
	
;................................................................................................................................				
;......................................................... STAKE 7 ..............................................................
								
Gui, Font, s8 c%Color7%, Verdana				
Gui, Add, Text, x293 y70 vControl7 Center, $000.00
								
Gui, Font, s16 c%Color7%, Verdana				
Gui, Add, Text, x259 y82 vStake7 Center, 000 / 0000		

;......................................................... STAKE 8 ..............................................................
								
Gui, Font, s8 c%Color8%, Verdana				
Gui, Add, Text, x293 y114 vControl8 Center, $000.00
								
Gui, Font, s16 c%Color8%, Verdana			
Gui, Add, Text, x259 y126 vStake8 Center, 000 / 0000		
	
;......................................................... STAKE 9 ..............................................................
								
Gui, Font, s8 c%Color9%, Verdana				
Gui, Add, Text, x293 y158 vControl9 Center, $000.00
								
Gui, Font, s16 c%Color9%, Verdana			
Gui, Add, Text, x259 y170 vStake9 Center, 000 / 0000	

;................................................................................................................................
;....................................................... SEPARATOR2 .............................................................	

Gui, Font, s10 c%TextColor%, Verdana					
Gui, Add, Text, x66 y203 Center, %ABI%
	
Gui, Font, s10 c%TextColor%, Verdana					
Gui, Add, Text, x247 y203 Center, %Invest%

Gui, Font, s10 c%SeparatorColor%, Verdana					
Gui, Add, Text, x4 y197 Center, ________

Gui, Font, s10 c%SeparatorColor%, Verdana					
Gui, Add, Text, x108 y197 Center, _________________

Gui, Font, s10 c%SeparatorColor%, Verdana					
Gui, Add, Text, x314 y197 Center, _______
;................................................................................................................................
;....................................................... ABI/INVEST .............................................................

Gui, Font, s11 c%NumColor%, Verdana					
Gui, Add, Text, x4 y224 vDollars Center, $0000.00 ($0000.00)	
								
Gui, Font, s11 c%NumColor%, Verdana					
Gui, Add, Text, x184 y224 vTotalABI Center, $00000.00 ($00000.00) 

;................................................................................................................................
;....................................................... SEPARATOR3 .............................................................	

Gui, Font, s10 c%TextColor%, Verdana					
Gui, Add, Text, x25 y252 Center, %Gamesh%
	
Gui, Font, s10 c%TextColor%, Verdana					
Gui, Add, Text, x160 y252 Center, %Clock%

Gui, Font, s10 c%TextColor%, Verdana					
Gui, Add, Text, x288 y252 Center, %Time%

Gui, Font, s10 c%SeparatorColor%, Verdana					
Gui, Add, Text, x4 y247 Center, ___

Gui, Font, s10 c%SeparatorColor%, Verdana					
Gui, Add, Text, x104 y247 Center, _______

Gui, Font, s10 c%SeparatorColor%, Verdana					
Gui, Add, Text, x216 y247 Center, _________

Gui, Font, s10 c%SeparatorColor%, Verdana					
Gui, Add, Text, x338 y247 Center, ____

;................................................................................................................................
;..................................................... GAMES/H / TIME ...........................................................	

Gui, Font, s14 c%NumColor%, Verdana					
Gui, Add, Text, x33 y271 vGames Center, 0000.0	

Gui, Font, s20 c%NumColor%, Verdana					
Gui, Add, Text, x147 y268 vClock Center, 00000	

Gui, Font, s14 c%NumColor%, Verdana					
Gui, Add, Text, x287 y271 vSessionTime Center, 00:00	

;====================================================== SECTION END =============================================================
;================================================================================================================================
;====================================================== MAIN SCRIPT =============================================================	

Loop, 9
	{
	N += 1
	IfInString, Stake%N%, .00
		StringReplace, Stake%N%b, Stake%N%, .00,
	else, Stake%N%b := Stake%N%	
	IfInString, Stake%N%b, +R
		StringReplace, Stake%N%b, Stake%N%b, +,
	}
	
N = 0

GuiControl,, ControlL, %ColumnL%
GuiControl,, ControlM, %ColumnM%
GuiControl,, ControlR, %ColumnR%
GuiControl,, Control1, %Stake1b%
GuiControl,, Control2, %Stake2b%
GuiControl,, Control3, %Stake3b%
GuiControl,, Control4, %Stake4b%
GuiControl,, Control5, %Stake5b%
GuiControl,, Control6, %Stake6b%
GuiControl,, Control7, %Stake7b%
GuiControl,, Control8, %Stake8b%
GuiControl,, Control9, %Stake9b%

Buyin_Total := 0.00
Buyin_Total_TournamentCounter := 0

H1 = 0
H2 = 0
M1 = 0
M2 = -1
S = 0

r0 = 0
r1 = 0
r2 = 0
r3 = 0
r4 = 0
r5 = 0
r6 = 0
r7 = 0
r8 = 0
r9 = 0

t1 = 0
t2 = 0
t3 = 0
t4 = 0
t5 = 0
t6 = 0
t7 = 0
t8 = 0
t9 = 0

VPP1 = 0
VPP2 = 0
VPP3 = 0
VPP4 = 0
VPP5 = 0
VPP6 = 0
VPP7 = 0
VPP8 = 0
VPP9 = 0

FPP = 0

P = 0

Loop
{
;--------------------------------------------------------- STAKE 1 -----------------------------------------------------------
  
    v1 := 0
    v11 := 0
    v12 := 0
    v13 := 0
    v14 := 0
    v15 := 0
	v16 := 0
    c1 := 0
	
	If Type1 = 18
		{
		WinGet, v11,count, %Stake1% NL Hold'em [18 Players`, Turbo] ahk_class PokerStarsTableFrameClass
		WinGet, v12,count, %Stake1% NL Hold'em [18 Players] ahk_class PokerStarsTableFrameClass
		}
	else, if Type1 = HUSTT
		{
		WinGet, v11,count, %Stake1% NL Hold'em [HU`, 2 Players] ahk_class PokerStarsTableFrameClass
		WinGet, v12,count, %Stake1% NL Hold'em [HU`, Turbo`, 2 Players] ahk_class PokerStarsTableFrameClass
		WinGet, v13,count, %Stake1% NL Hold'em [HU`, Hyper-Turbo`, 2 Players] ahk_class PokerStarsTableFrameClass
		WinGet, v14,count, %Stake1% NL Hold'em [HU`, Deep`, No Blind Increases] ahk_class PokerStarsTableFrameClass
		}
	else, if InStr(Type1, "9-Max, Turbo",0)
		{
		WinGet, v11,count, %Stake1% NL Hold'em [Turbo] ahk_class PokerStarsTableFrameClass
		WinGet, v12,count, %Stake1% NL Hold'em [Turbo`, Knockout] ahk_class PokerStarsTableFrameClass
		}
	else, if InStr(Type1, "9-Max",0)
		{
		WinGet, v11,count, %Stake1% NL Hold'em - Blinds ahk_class PokerStarsTableFrameClass
		WinGet, v12,count, %Stake1% NL Hold'em  - Blinds ahk_class PokerStarsTableFrameClass
		WinGet, v13,count, %Stake1% NL Hold'em   - Blinds ahk_class PokerStarsTableFrameClass
		WinGet, v14,count, %Stake1% NL Hold'em    - Blinds ahk_class PokerStarsTableFrameClass
		WinGet, v15,count, %Stake1% NL Hold'em     - Blinds ahk_class PokerStarsTableFrameClass
		WinGet, v16,count, %Stake1% NL Hold'em      - Blinds ahk_class PokerStarsTableFrameClass
		}
	else
		{
		WinGet, v11, count, %Stake1% NL Hold'em [%Type1% ahk_class PokerStarsTableFrameClass
		}
	
	v1 := v11 + v12 + v13 + v14 + v15 + v16

    Loop, %v1%
    	{	
    	c1 += 1
    	}

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

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

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

	else, if (c1 < r1)
    	{
		GuiControl,, Stake1, %c1% / %t1%
      	r1 = %c1%
    	}
;--------------------------------------------------------- STAKE 2 ------------------------------------------------------------
    
    v2 := 0
    v21 := 0
    v22 := 0
    v23 := 0
    v24 := 0
    v25 := 0
	v26 := 0
    c2 := 0
	
	If Type2 = 18
		{
		WinGet, v21,count, %Stake2% NL Hold'em [18 Players`, Turbo] ahk_class PokerStarsTableFrameClass
		WinGet, v22,count, %Stake2% NL Hold'em [18 Players] ahk_class PokerStarsTableFrameClass
		}
	else, if Type2 = HUSTT
		{
		WinGet, v21,count, %Stake2% NL Hold'em [HU`, 2 Players] ahk_class PokerStarsTableFrameClass
		WinGet, v22,count, %Stake2% NL Hold'em [HU`, Turbo`, 2 Players] ahk_class PokerStarsTableFrameClass
		WinGet, v23,count, %Stake2% NL Hold'em [HU`, Hyper-Turbo`, 2 Players] ahk_class PokerStarsTableFrameClass
		WinGet, v24,count, %Stake2% NL Hold'em [HU`, Deep`, No Blind Increases] ahk_class PokerStarsTableFrameClass
		}
	else, if InStr(Type2, "9-Max, Turbo",0)
		{
		WinGet, v21,count, %Stake2% NL Hold'em [Turbo] ahk_class PokerStarsTableFrameClass
		WinGet, v22,count, %Stake2% NL Hold'em [Turbo`, Knockout] ahk_class PokerStarsTableFrameClass
		}
	else, if InStr(Type2, "9-Max",0)
		{
		WinGet, v21,count, %Stake2% NL Hold'em - Blinds ahk_class PokerStarsTableFrameClass
		WinGet, v22,count, %Stake2% NL Hold'em  - Blinds ahk_class PokerStarsTableFrameClass
		WinGet, v23,count, %Stake2% NL Hold'em   - Blinds ahk_class PokerStarsTableFrameClass
		WinGet, v24,count, %Stake2% NL Hold'em    - Blinds ahk_class PokerStarsTableFrameClass
		WinGet, v25,count, %Stake2% NL Hold'em     - Blinds ahk_class PokerStarsTableFrameClass
		WinGet, v26,count, %Stake2% NL Hold'em      - Blinds ahk_class PokerStarsTableFrameClass
		}
	else
		{
		WinGet, v21, count, %Stake2% NL Hold'em [%Type2% ahk_class PokerStarsTableFrameClass
		}
	
	v2 := v21 + v22 + v23 + v24 + v25 + v26

    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
    v31 := 0
    v32 := 0
    v33 := 0
    v34 := 0
    v35 := 0
	v36 := 0
    c3 := 0
	
	If Type3 = 18
		{
		WinGet, v31,count, %Stake3% NL Hold'em [18 Players`, Turbo] ahk_class PokerStarsTableFrameClass
		WinGet, v32,count, %Stake3% NL Hold'em [18 Players] ahk_class PokerStarsTableFrameClass
		}
	else, if Type3 = HUSTT
		{
		WinGet, v31,count, %Stake3% NL Hold'em [HU`, 2 Players] ahk_class PokerStarsTableFrameClass
		WinGet, v32,count, %Stake3% NL Hold'em [HU`, Turbo`, 2 Players] ahk_class PokerStarsTableFrameClass
		WinGet, v33,count, %Stake3% NL Hold'em [HU`, Hyper-Turbo`, 2 Players] ahk_class PokerStarsTableFrameClass
		WinGet, v34,count, %Stake3% NL Hold'em [HU`, Deep`, No Blind Increases] ahk_class PokerStarsTableFrameClass
		}
	else, if InStr(Type3, "9-Max, Turbo",0)
		{
		WinGet, v31,count, %Stake3% NL Hold'em [Turbo] ahk_class PokerStarsTableFrameClass
		WinGet, v32,count, %Stake3% NL Hold'em [Turbo`, Knockout] ahk_class PokerStarsTableFrameClass
		}
	else, if InStr(Type3, "9-Max",0)
		{
		WinGet, v31,count, %Stake3% NL Hold'em - Blinds ahk_class PokerStarsTableFrameClass
		WinGet, v32,count, %Stake3% NL Hold'em  - Blinds ahk_class PokerStarsTableFrameClass
		WinGet, v33,count, %Stake3% NL Hold'em   - Blinds ahk_class PokerStarsTableFrameClass
		WinGet, v34,count, %Stake3% NL Hold'em    - Blinds ahk_class PokerStarsTableFrameClass
		WinGet, v35,count, %Stake3% NL Hold'em     - Blinds ahk_class PokerStarsTableFrameClass
		WinGet, v36,count, %Stake3% NL Hold'em      - Blinds ahk_class PokerStarsTableFrameClass
		}
	else
		{
		WinGet, v31, count, %Stake3% NL Hold'em [%Type3% ahk_class PokerStarsTableFrameClass
		}
	
	v3 := v31 + v32 + v33 + v34 + v35 + v36
	
    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
    v41 := 0
    v42 := 0
    v43 := 0
    v44 := 0
    v45 := 0
	v46 := 0
    c4 := 0
		
	If Type4 = 18
		{
		WinGet, v41,count, %Stake4% NL Hold'em [18 Players`, Turbo] ahk_class PokerStarsTableFrameClass
		WinGet, v42,count, %Stake4% NL Hold'em [18 Players] ahk_class PokerStarsTableFrameClass
		}
	else, if Type4 = HUSTT
		{
		WinGet, v41,count, %Stake4% NL Hold'em [HU`, 2 Players] ahk_class PokerStarsTableFrameClass
		WinGet, v42,count, %Stake4% NL Hold'em [HU`, Turbo`, 2 Players] ahk_class PokerStarsTableFrameClass
		WinGet, v43,count, %Stake4% NL Hold'em [HU`, Hyper-Turbo`, 2 Players] ahk_class PokerStarsTableFrameClass
		WinGet, v44,count, %Stake4% NL Hold'em [HU`, Deep`, No Blind Increases] ahk_class PokerStarsTableFrameClass
		}
	else, if InStr(Type4, "9-Max, Turbo",0)
		{
		WinGet, v41,count, %Stake4% NL Hold'em [Turbo] ahk_class PokerStarsTableFrameClass
		WinGet, v42,count, %Stake4% NL Hold'em [Turbo`, Knockout] ahk_class PokerStarsTableFrameClass
		}
	else, if InStr(Type4, "9-Max",0)
		{
		WinGet, v41,count, %Stake4% NL Hold'em - Blinds ahk_class PokerStarsTableFrameClass
		WinGet, v42,count, %Stake4% NL Hold'em  - Blinds ahk_class PokerStarsTableFrameClass
		WinGet, v43,count, %Stake4% NL Hold'em   - Blinds ahk_class PokerStarsTableFrameClass
		WinGet, v44,count, %Stake4% NL Hold'em    - Blinds ahk_class PokerStarsTableFrameClass
		WinGet, v45,count, %Stake4% NL Hold'em     - Blinds ahk_class PokerStarsTableFrameClass
		WinGet, v46,count, %Stake4% NL Hold'em      - Blinds ahk_class PokerStarsTableFrameClass
		}
	else
		{
		WinGet, v41, count, %Stake4% NL Hold'em [%Type4% ahk_class PokerStarsTableFrameClass
		}
	
	v4 := v41 + v42 + v43 + v44 + v45 + v46

    Loop, %v4%
    	{	
    	c4 += 1
    	}

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

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

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

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

    v5 := 0
    v51 := 0
    v52 := 0
    v53 := 0
    v54 := 0
    v55 := 0
	v56 := 0
    c5 := 0
	
	If Type5 = 18
		{
		WinGet, v51,count, %Stake5% NL Hold'em [18 Players`, Turbo] ahk_class PokerStarsTableFrameClass
		WinGet, v52,count, %Stake5% NL Hold'em [18 Players] ahk_class PokerStarsTableFrameClass
		}
	else, if Type5 = HUSTT
		{
		WinGet, v51,count, %Stake5% NL Hold'em [HU`, 2 Players] ahk_class PokerStarsTableFrameClass
		WinGet, v52,count, %Stake5% NL Hold'em [HU`, Turbo`, 2 Players] ahk_class PokerStarsTableFrameClass
		WinGet, v53,count, %Stake5% NL Hold'em [HU`, Hyper-Turbo`, 2 Players] ahk_class PokerStarsTableFrameClass
		WinGet, v54,count, %Stake5% NL Hold'em [HU`, Deep`, No Blind Increases] ahk_class PokerStarsTableFrameClass
		}
	else, if InStr(Type5, "9-Max, Turbo",0)
		{
		WinGet, v51,count, %Stake5% NL Hold'em [Turbo] ahk_class PokerStarsTableFrameClass
		WinGet, v52,count, %Stake5% NL Hold'em [Turbo`, Knockout] ahk_class PokerStarsTableFrameClass
		}
	else, if InStr(Type5, "9-Max",0)
		{
		WinGet, v51,count, %Stake5% NL Hold'em - Blinds ahk_class PokerStarsTableFrameClass
		WinGet, v52,count, %Stake5% NL Hold'em  - Blinds ahk_class PokerStarsTableFrameClass
		WinGet, v53,count, %Stake5% NL Hold'em   - Blinds ahk_class PokerStarsTableFrameClass
		WinGet, v54,count, %Stake5% NL Hold'em    - Blinds ahk_class PokerStarsTableFrameClass
		WinGet, v55,count, %Stake5% NL Hold'em     - Blinds ahk_class PokerStarsTableFrameClass
		WinGet, v56,count, %Stake5% NL Hold'em      - Blinds ahk_class PokerStarsTableFrameClass
		}
	else
		{
		WinGet, v51, count, %Stake5% NL Hold'em [%Type5% ahk_class PokerStarsTableFrameClass
		}
	
	v5 := v51 + v52 + v53 + v54 + v55 + v56

    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
    v61 := 0
    v62 := 0
    v63 := 0
    v64 := 0
    v65 := 0
	v66 := 0
    c6 := 0
	
	If Type6 = 18
		{
		WinGet, v61,count, %Stake6% NL Hold'em [18 Players`, Turbo] ahk_class PokerStarsTableFrameClass
		WinGet, v62,count, %Stake6% NL Hold'em [18 Players] ahk_class PokerStarsTableFrameClass
		}
	else, if Type6 = HUSTT
		{
		WinGet, v61,count, %Stake6% NL Hold'em [HU`, 2 Players] ahk_class PokerStarsTableFrameClass
		WinGet, v62,count, %Stake6% NL Hold'em [HU`, Turbo`, 2 Players] ahk_class PokerStarsTableFrameClass
		WinGet, v63,count, %Stake6% NL Hold'em [HU`, Hyper-Turbo`, 2 Players] ahk_class PokerStarsTableFrameClass
		WinGet, v64,count, %Stake6% NL Hold'em [HU`, Deep`, No Blind Increases] ahk_class PokerStarsTableFrameClass
		}
	else, if InStr(Type6, "9-Max, Turbo",0)
		{
		WinGet, v61,count, %Stake6% NL Hold'em [Turbo] ahk_class PokerStarsTableFrameClass
		WinGet, v62,count, %Stake6% NL Hold'em [Turbo`, Knockout] ahk_class PokerStarsTableFrameClass
		}
	else, if InStr(Type6, "9-Max",0)
		{
		WinGet, v61,count, %Stake6% NL Hold'em - Blinds ahk_class PokerStarsTableFrameClass
		WinGet, v62,count, %Stake6% NL Hold'em  - Blinds ahk_class PokerStarsTableFrameClass
		WinGet, v63,count, %Stake6% NL Hold'em   - Blinds ahk_class PokerStarsTableFrameClass
		WinGet, v64,count, %Stake6% NL Hold'em    - Blinds ahk_class PokerStarsTableFrameClass
		WinGet, v65,count, %Stake6% NL Hold'em     - Blinds ahk_class PokerStarsTableFrameClass
		WinGet, v66,count, %Stake6% NL Hold'em      - Blinds ahk_class PokerStarsTableFrameClass
		}
	else
		{
		WinGet, v61, count, %Stake6% NL Hold'em [%Type6% ahk_class PokerStarsTableFrameClass
		}
	
	v6 := v61 + v62 + v63 + v64 + v65 + v66

    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%
    	}
;--------------------------------------------------------- STAKE 7 ------------------------------------------------------------

    v7 := 0
    v71 := 0
    v72 := 0
    v73 := 0
    v74 := 0
    v75 := 0
	v76 := 0
    c7 := 0
	
	If Type7 = 18
		{
		WinGet, v71,count, %Stake7% NL Hold'em [18 Players`, Turbo] ahk_class PokerStarsTableFrameClass
		WinGet, v72,count, %Stake7% NL Hold'em [18 Players] ahk_class PokerStarsTableFrameClass
		}
	else, if Type7 = HUSTT
		{
		WinGet, v71,count, %Stake7% NL Hold'em [HU`, 2 Players] ahk_class PokerStarsTableFrameClass
		WinGet, v72,count, %Stake7% NL Hold'em [HU`, Turbo`, 2 Players] ahk_class PokerStarsTableFrameClass
		WinGet, v73,count, %Stake7% NL Hold'em [HU`, Hyper-Turbo`, 2 Players] ahk_class PokerStarsTableFrameClass
		WinGet, v74,count, %Stake7% NL Hold'em [HU`, Deep`, No Blind Increases] ahk_class PokerStarsTableFrameClass
		}
	else, if InStr(Type7, "9-Max, Turbo",0)
		{
		WinGet, v71,count, %Stake7% NL Hold'em [Turbo] ahk_class PokerStarsTableFrameClass
		WinGet, v72,count, %Stake7% NL Hold'em [Turbo`, Knockout] ahk_class PokerStarsTableFrameClass
		}
	else, if InStr(Type7, "9-Max",0)
		{
		WinGet, v71,count, %Stake7% NL Hold'em - Blinds ahk_class PokerStarsTableFrameClass
		WinGet, v72,count, %Stake7% NL Hold'em  - Blinds ahk_class PokerStarsTableFrameClass
		WinGet, v73,count, %Stake7% NL Hold'em   - Blinds ahk_class PokerStarsTableFrameClass
		WinGet, v74,count, %Stake7% NL Hold'em    - Blinds ahk_class PokerStarsTableFrameClass
		WinGet, v75,count, %Stake7% NL Hold'em     - Blinds ahk_class PokerStarsTableFrameClass
		WinGet, v76,count, %Stake7% NL Hold'em      - Blinds ahk_class PokerStarsTableFrameClass
		}
	else
		{
		WinGet, v71, count, %Stake7% NL Hold'em [%Type7% ahk_class PokerStarsTableFrameClass
		}
	
	v7 := v71 + v72 + v73 + v74 + v75 + v76

    Loop, %v7%
    	{	
    	c7 += 1
    	}

    if (t7 = 0)
		{
		GuiControl,, Stake7, 0 / 0
    	r7 = 0
		}

    if (t7 < c7)
		{
		t7 := c7 - 1
		}

    if (c7 > r7)
    	{
		t7++
    	GuiControl,, Stake7, %c7% / %t7%
    	r7 = %c7%
    	}

	else, if (c7 < r7)
    	{
		GuiControl,, Stake7, %c7% / %t7%
      	r7 = %c7%
    	}
;--------------------------------------------------------- STAKE 8 ------------------------------------------------------------

    v8 := 0
    v81 := 0
    v82 := 0
    v83 := 0
    v84 := 0
    v85 := 0
	v86 := 0
    c8 := 0
	
	If Type8 = 18
		{
		WinGet, v81,count, %Stake8% NL Hold'em [18 Players`, Turbo] ahk_class PokerStarsTableFrameClass
		WinGet, v82,count, %Stake8% NL Hold'em [18 Players] ahk_class PokerStarsTableFrameClass
		}
	else, if Type8 = HUSTT
		{
		WinGet, v81,count, %Stake8% NL Hold'em [HU`, 2 Players] ahk_class PokerStarsTableFrameClass
		WinGet, v82,count, %Stake8% NL Hold'em [HU`, Turbo`, 2 Players] ahk_class PokerStarsTableFrameClass
		WinGet, v83,count, %Stake8% NL Hold'em [HU`, Hyper-Turbo`, 2 Players] ahk_class PokerStarsTableFrameClass
		WinGet, v84,count, %Stake8% NL Hold'em [HU`, Deep`, No Blind Increases] ahk_class PokerStarsTableFrameClass
		}
	else, if InStr(Type8, "9-Max, Turbo",0)
		{
		WinGet, v81,count, %Stake8% NL Hold'em [Turbo] ahk_class PokerStarsTableFrameClass
		WinGet, v82,count, %Stake8% NL Hold'em [Turbo`, Knockout] ahk_class PokerStarsTableFrameClass
		}
	else, if InStr(Type8, "9-Max",0)
		{
		WinGet, v81,count, %Stake8% NL Hold'em - Blinds ahk_class PokerStarsTableFrameClass
		WinGet, v82,count, %Stake8% NL Hold'em  - Blinds ahk_class PokerStarsTableFrameClass
		WinGet, v83,count, %Stake8% NL Hold'em   - Blinds ahk_class PokerStarsTableFrameClass
		WinGet, v84,count, %Stake8% NL Hold'em    - Blinds ahk_class PokerStarsTableFrameClass
		WinGet, v85,count, %Stake8% NL Hold'em     - Blinds ahk_class PokerStarsTableFrameClass
		WinGet, v86,count, %Stake8% NL Hold'em      - Blinds ahk_class PokerStarsTableFrameClass
		}
	else
		{
		WinGet, v81, count, %Stake8% NL Hold'em [%Type8% ahk_class PokerStarsTableFrameClass
		}
	
	v8 := v81 + v82 + v83 + v84 + v85 + v86

    Loop, %v8%
    	{	
    	c8 += 1
    	}

    if (t8 = 0)
		{
		GuiControl,, Stake8, 0 / 0
    	r8 = 0
		}

    if (t8 < c8)
		{
		t8 := c8 - 1
		}

    if (c8 > r8)
    	{
		t8++
    	GuiControl,, Stake8, %c8% / %t8%
     	r8 = %c8%
    	}

	else, if (c8 < r8)
    	{
		GuiControl,, Stake8, %c8% / %t8%
      	r8 = %c8%
    	}
;--------------------------------------------------------- STAKE 9 ------------------------------------------------------------

    v9 := 0
    v91 := 0
    v92 := 0
    v93 := 0
    v94 := 0
    v95 := 0
	v96 := 0
    c9 := 0
	
	If Type9 = 18
		{
		WinGet, v91,count, %Stake9% NL Hold'em [18 Players`, Turbo] ahk_class PokerStarsTableFrameClass
		WinGet, v92,count, %Stake9% NL Hold'em [18 Players] ahk_class PokerStarsTableFrameClass
		}
	else, if Type9 = HUSTT
		{
		WinGet, v91,count, %Stake9% NL Hold'em [HU`, 2 Players] ahk_class PokerStarsTableFrameClass
		WinGet, v92,count, %Stake9% NL Hold'em [HU`, Turbo`, 2 Players] ahk_class PokerStarsTableFrameClass
		WinGet, v93,count, %Stake9% NL Hold'em [HU`, Hyper-Turbo`, 2 Players] ahk_class PokerStarsTableFrameClass
		WinGet, v94,count, %Stake9% NL Hold'em [HU`, Deep`, No Blind Increases] ahk_class PokerStarsTableFrameClass
		}
	else, if InStr(Type9, "9-Max, Turbo",0)
		{
		WinGet, v91,count, %Stake9% NL Hold'em [Turbo] ahk_class PokerStarsTableFrameClass
		WinGet, v92,count, %Stake9% NL Hold'em [Turbo`, Knockout] ahk_class PokerStarsTableFrameClass
		}
	else, if InStr(Type9, "9-Max",0)
		{
		WinGet, v91,count, %Stake9% NL Hold'em - Blinds ahk_class PokerStarsTableFrameClass
		WinGet, v92,count, %Stake9% NL Hold'em  - Blinds ahk_class PokerStarsTableFrameClass
		WinGet, v93,count, %Stake9% NL Hold'em   - Blinds ahk_class PokerStarsTableFrameClass
		WinGet, v94,count, %Stake9% NL Hold'em    - Blinds ahk_class PokerStarsTableFrameClass
		WinGet, v95,count, %Stake9% NL Hold'em     - Blinds ahk_class PokerStarsTableFrameClass
		WinGet, v96,count, %Stake9% NL Hold'em      - Blinds ahk_class PokerStarsTableFrameClass
		}
	else
		{
		WinGet, v91, count, %Stake9% NL Hold'em [%Type9% ahk_class PokerStarsTableFrameClass
		}
	
	v9 := v91 + v92 + v93 + v94 + v95 + v96

    Loop, %v9%
    	{	
    	c9 += 1
    	}

    if (t9 = 0)
		{
		GuiControl,, Stake9, 0 / 0
    	r9 = 0
		}

    if (t9 < c9)
		{
		t9 := c9 - 1
		}

    if (c9 > r9)
    	{
		t9++
    	GuiControl,, Stake9, %c9% / %t9%
    	 r9 = %c9%
    	}

	else, if (c9 < r9)
    	{
		GuiControl,, Stake9, %c9% / %t9%
      	r9 = %c9%
    	}
;--------------------------------------------------------- TOTALS -------------------------------------------------------------

    c0 := c1 + c2 + c3 + c4 + c5 + c6 + c7 + c8 + c9
    t0 := t1 + t2 + t3 + t4 + t5 + t6 + t7 + t8 + t9

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

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

    if (c0 < MinMTRatio)
		{
		Gui, Font, s22 c%NumColor%, Verdana
		Gui, Font, Bold
		GuiControl, Font, TotalTables
		}
	else, if (c0 > MaxMTRatio) and (WarnBox = 1)
		{
		Gui, Font, s22 c%NumColorWarn%, Verdana
		Gui, Font, Bold
		GuiControl, Font, TotalTables
		}
	else, if GoalBox = 1
		{
		Gui, Font, s22 c%NumColorGoal%, Verdana
		Gui, Font, Bold
		GuiControl, Font, TotalTables
		}

    if (t0 = TotalLimit)
    	{
		If AchieveBox = 1
			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)
	
	IfInString, Buyin_Dollars_Avg, .00
		StringReplace, Buyin_Dollars_Avg, Buyin_Dollars_Avg, .00,
	
	IfInString, Buyin_Dollars, .00
		StringReplace, Buyin_Dollars, Buyin_Dollars, .00,
		
	IfInString, Buyin_Total_Avg, .00
		StringReplace, Buyin_Total_Avg, Buyin_Total_Avg, .00,
		
	IfInString, Buyin_Total, .00
		StringReplace, Buyin_Total, Buyin_Total, .00,
	
	GuiControl,,Dollars,% "$" Buyin_Dollars_Avg " ($" BuyIn_Total_Avg ")"
	GuiControl,,TotalABI,% "$" BuyIn_Dollars " ($" BuyIn_Total ")"
}

If (BuyIn_Total_Avg = 0)
	{
	Gui, Font, s11 c%NumColor%, Verdana
	Gui, Font, Norm
	GuiControl, Font, Dollars
	}
else, If (BuyIn_Total_Avg > MaxABI) or (BuyIn_Total_Avg < MinABI) and (WarnBox = 1)
	{
	Gui, Font, s11 c%NumColorWarn%, Verdana
	Gui, Font, Norm
	GuiControl, Font, Dollars
	}
else, If (BuyIn_Total_Avg <= MaxABI) and (BuyIn_Total_Avg >= MinABI) and (GoalBox = 1)
	{
	Gui, Font, s11 c%NumColorGoal%, Verdana
	Gui, Font, Norm
	GuiControl, Font, Dollars
	}
	
If (BuyIn_Total > MaxInvest) and (WarnBox = 1)
	{
	Gui, Font, s11 c%NumColorWarn%, Verdana
	Gui, Font, Norm
	GuiControl, Font, TotalABI
	}
else
	{
	Gui, Font, s11 c%NumColor%, Verdana
	Gui, Font, Norm
	GuiControl, Font, TotalABI
	}

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 
	}
		
;---------------------------------------------------------- VPP --------------------------------------------------------------

	VPP1 := t1 * Stake1VPP
	VPP2 := t2 * Stake2VPP
	VPP3 := t3 * Stake3VPP
	VPP4 := t4 * Stake4VPP
	VPP5 := t5 * Stake5VPP
	VPP6 := t6 * Stake6VPP
	VPP7 := t7 * Stake7VPP
	VPP8 := t8 * Stake8VPP
	VPP9 := t9 * Stake9VPP
	
	VPP := Round(VPP1+VPP2+VPP3+VPP4+VPP5+VPP6+VPP7+VPP8+VPP9,2)
	
	
	IfInString, VPP, .00
		StringReplace, VPP, VPP, .00,
		
	Loop, 9
		{
		N += 1
		IfInString, VPP, .%N%0
			{
			StringTrimRight, VPP, VPP, 1
			break
			}	
		}
		
	N = 0

    GuiControl,, VPP, %VPP%
	
	If (VPP >= VPPGoal) and (GoalBox = 1)
		{
		Gui, Font, s11 c%NumColorGoal%, Verdana
		GuiControl, Font, VPP
		GuiControl, Font, FPP
		}
		
;---------------------------------------------------------- FPP ---------------------------------------------------------------

	FPP := VPP * VIPMulti
	
	FPP := Round(FPP,2)
	
	IfInString, FPP, .00
		StringReplace, FPP, FPP, .00,
				
	Loop, 9
		{
		N += 1
		IfInString, FPP, .%N%0
			{
			StringTrimRight, FPP, FPP, 1
			break
			}	
		}
		
	N = 0

    GuiControl,, FPP, %FPP%
	
;--------------------------------------------------------- CLOCK --------------------------------------------------------------

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

If (Minutes != Var)
	{
	M2 += 1
	Var := Minutes
	}

If (M2 > 9)
	{
	M1 += 1
	M2 = 0
	}

If (M1 > 5)
	{
	H2 += 1
	M1 = 0
	M2 = 0
	}

If (H2 > 9)
	{
	H1 += 1
	H2 = 0
	M1 = 0
	M2 = 0
	}
	
Runtime = %H1%%H2%:%M1%%M2%

If (Runtime >= SessionTimeGoal) and (GoalBox = 1)
	{
	Gui, Font, s14 c%NumColorGoal%, Verdana
	Gui, Font, Norm
	GuiControl, Font, SessionTime
	}
	
If (H1 = 0)
	GuiControl,, SessionTime, %H2%:%M1%%M2%
else, GuiControl,, SessionTime, %H1%%H2%:%M1%%M2%
	
;--------------------------------------------------------- GAMES/H -------------------------------------------------------------

S := ((H1 * 600) + (H2 * 60) + (M1 * 10) + M2) / 60
S := Round(S,6)

Games := (t0 - c0) / S
Games := Round(Games,1)

IfInString, Games, .0
	StringReplace, Games, Games, .0,

If (H2 < 1)
	Games := t0 - c0

If (Games = 0)
	Games = N/A
GuiControl,, Games, %Games%

;-------------------------------------------------------- INTERVAL -------------------------------------------------------------

   Sleep %LoopInterval%

}
return

;----------------------------------------------------- MENU HANDLERS -----------------------------------------------------------
;----------------------------------------------------- SETTINGS GUI ------------------------------------------------------------

TrayMenuHdlr_Bring:
WinActivate, SessionMan %Build% ahk_class AutoHotkeyGUI
return

TrayMenuHdlr_Position:
WinGetPos, xpos, ypos,,, SessionMan %Build% ahk_class AutoHotkeyGUI
IniWrite, %xpos%, %A_ScriptDir%\SessionMan.ini, GuiPos, x
IniWrite, %ypos%, %A_ScriptDir%\SessionMan.ini, GuiPos, y
return

TrayMenuHdlr_Reload:
Reload
return

TrayMenuHdlr_Log:
IniRead, Logging, %A_ScriptDir%\SessionMan.ini, Logging, Log 
If Logging = false  
	{
	IniWrite, true, %A_ScriptDir%\SessionMan.ini, Logging, Log
	IfNotExist, %A_ScriptDir%\SessionMan.log.ini
		{
		IniWrite, 1, %A_ScriptDir%\SessionMan.log.ini, Sessions, Logged
		FileAppend, `n, %A_ScriptDir%\SessionMan.log.ini
		}
	Menu Tray, Check, Enable Logging
	GoSub CheckLogging
	}
else
	{
	IniWrite, false, %A_ScriptDir%\SessionMan.ini, Logging, Log	
	Menu Tray, Uncheck, Enable Logging
	}
return	

TrayMenuHdlr_Logfile:
Run, %A_ScriptDir%\SessionMan.log.ini
return

TrayMenuHdlr_ClrLog:
MsgBox, 4, SessionMan - Clear Logfile, Do you want to clear the logfile?
IfMsgBox OK
{
IfWinExist, SessionMan.log.ini
	WinClose, SessionMan.log.ini
FileDelete, %A_ScriptDir%\SessionMan.log.ini
FormatTime, Start, %A_Now%, ddd d.M.yyyy H:mm:ss
GoSub CheckLogging
}
return

TrayMenuHdlr_Config:
IfWinExist, Settings - SessionMan %Build% ahk_class AutoHotkeyGUI
	WinActivate, Settings - SessionMan %Build% ahk_class AutoHotkeyGUI
else, GoSub MenuHdlr_ConfigGUI
return

TrayMenuHdlr_Pause:
if A_IsPaused
	{
	Pause off
	Menu Tray, Uncheck, Pause/Continue
	}
else
	{
	Menu Tray, Check, Pause/Continue
	Pause On
	}
return

TrayMenuHdlr_Exit:
GoSub CreateLog
ExitApp
return

;----------------------------------------------------- SETTINGS GUI ------------------------------------------------------------

MenuHdlr_ConfigGUI:
Menu, HelpMenu, Add, Help, MenuHdlr_Help
Menu, HelpMenu, Add, WindowSpy, MenuHdlr_WinSpy
Menu, HelpMenu, Add, Color Codes (Web), MenuHdlr_WebColors
Menu, Menubar, Add, Help, :HelpMenu
Gui, 2:Menu, MenuBar

Gui, 2:Add, Tab, x-4 y0 w500 h750 , Stakes|Options|Hotkeys|Types
Gui, 2:Tab, Stakes
Gui, 2:Font, S8 CDefault Bold
Gui, 2:Add, Text, x8 y32 w100 h40 , Captions:
Gui, 2:Font, S8 CDefault norm
Gui, 2:Add, Edit, x31 y50 w50 h20 vColumnL, %ColumnL%
Gui, 2:Add, Edit, x141 y50 w50 h20 vColumnM, %ColumnM%
Gui, 2:Add, Edit, x251 y50 w50 h20 vColumnR, %ColumnR%
Gui, 2:Font, S8 CDefault Bold
Gui, 2:Add, Text, x8 y82 w50 h20 , Stakes:
Gui, 2:Font, S8 Cff0000 norm
Gui, 2:Add, Text, x55 y82 w400 h20 , For rebuy games, include the "+R" appendix in the buy-in
Gui, 2:Font, S8 CDefault norm
Gui, 2:Add, Edit, x6 y100 w100 h20 vStake1, %Stake1%
Gui, 2:Add, Edit, x6 y120 w100 h20 vStake2, %Stake2%
Gui, 2:Add, Edit, x6 y140 w100 h20 vStake3, %Stake3%
Gui, 2:Add, Edit, x116 y100 w100 h20 vStake4, %Stake4%
Gui, 2:Add, Edit, x116 y120 w100 h20 vStake5, %Stake5%
Gui, 2:Add, Edit, x116 y140 w100 h20 vStake6, %Stake6%
Gui, 2:Add, Edit, x226 y100 w100 h20 vStake7, %Stake7%
Gui, 2:Add, Edit, x226 y120 w100 h20 vStake8, %Stake8%
Gui, 2:Add, Edit, x226 y140 w100 h20 vStake9, %Stake9%
Gui, 2:Font, S8 CDefault Bold
Gui, 2:Add, Text, x8 y172 w80 h20 , Game Types:
Gui, 2:Font, S8 Cff0000 norm
Gui, 2:Add, Text, x87 y172 w400 h20 , See "Types" Tab
Gui, 2:Font, S8 CDefault norm
Gui, 2:Add, Edit, x6 y190 w100 h20 vType1, %Type1%
Gui, 2:Add, Edit, x6 y210 w100 h20 vType2, %Type2%
Gui, 2:Add, Edit, x6 y230 w100 h20 vType3, %Type3%
Gui, 2:Add, Edit, x116 y190 w100 h20 vType4, %Type4%
Gui, 2:Add, Edit, x116 y210 w100 h20 vType5, %Type5%
Gui, 2:Add, Edit, x116 y230 w100 h20 vType6, %Type6%
Gui, 2:Add, Edit, x226 y190 w100 h20 vType7, %Type7%
Gui, 2:Add, Edit, x226 y210 w100 h20 vType8, %Type8%
Gui, 2:Add, Edit, x226 y230 w100 h20 vType9, %Type9%
Gui, 2:Font, S8 CDefault Bold
Gui, 2:Add, Text, x8 y262 w100 h20 , VPP:
Gui, 2:Font, S8 CDefault norm
Gui, 2:Add, Edit, x6 y280 w100 h20 vStake1VPP, %Stake1VPP%
Gui, 2:Add, Edit, x6 y300 w100 h20 vStake2VPP, %Stake2VPP%
Gui, 2:Add, Edit, x6 y320 w100 h20 vStake3VPP, %Stake3VPP%
Gui, 2:Add, Edit, x116 y280 w100 h20 vStake4VPP, %Stake4VPP%
Gui, 2:Add, Edit, x116 y300 w100 h20 vStake5VPP, %Stake5VPP%
Gui, 2:Add, Edit, x116 y320 w100 h20 vStake6VPP, %Stake6VPP%
Gui, 2:Add, Edit, x226 y280 w100 h20 vStake7VPP, %Stake7VPP%
Gui, 2:Add, Edit, x226 y300 w100 h20 vStake8VPP, %Stake8VPP%
Gui, 2:Add, Edit, x226 y320 w100 h20 vStake9VPP, %Stake9VPP%
Gui, 2:Font, S8 CDefault Bold
If ColorsBox = 1
	Gui, 2:Add, CheckBox, x8 y350 w105 h20 Checked%ColorsBox% vColorsBox, %A_Space%Unique Colors:
else
	Gui, 2:Add, CheckBox, x8 y350 w105 h20 Unchecked%ColorsBox% vColorsBox, %A_Space%Unique Colors:
Gui, 2:Font, S8 Cff0000 norm
Gui, 2:Add, Text, x116 y353 w220 h20 , Colors reset to default if disabled
Gui, 2:Font, S8 CDefault norm
Gui, 2:Add, Edit, x6 y370 w100 h20 vColor1, %Color1%
Gui, 2:Add, Edit, x6 y390 w100 h20 vColor2, %Color2%
Gui, 2:Add, Edit, x6 y410 w100 h20 vColor3, %Color3%
Gui, 2:Add, Edit, x116 y370 w100 h20 vColor4, %Color4%
Gui, 2:Add, Edit, x116 y390 w100 h20 vColor5, %Color5%
Gui, 2:Add, Edit, x116 y410 w100 h20 vColor6, %Color6%
Gui, 2:Add, Edit, x226 y370 w100 h20 vColor7, %Color7%
Gui, 2:Add, Edit, x226 y390 w100 h20 vColor8, %Color8%
Gui, 2:Add, Edit, x226 y410 w100 h20 vColor9, %Color9%
Gui, 2:Add, Button, x118 y455 w40 h20 gSave,Save
Gui, 2:Add, Button, x163 y455 w50 h20 gCancel,Cancel
Gui, 2:Font, S8 Cff0000 Bold
Gui, 2:Add, Text, x84 y481 w220 h20 , Note: Saving Restarts Script

Gui, 2:Tab, Options
Gui, 2:Font, S8 CDefault norm
Gui, 2:Add, Text, x8 y32 w220 h20 , Window Background Color
Gui, 2:Add, Edit, x226 y30 w100 h20 vGUIColor, %GUIColor%
Gui, 2:Add, Text, x8 y52 w220 h20 , Default Number Color
Gui, 2:Add, Edit, x226 y50 w100 h20 vNumColor, %NumColor%
Gui, 2:Add, Text, x8 y72 w220 h20 , Default Text Color
Gui, 2:Add, Edit, x226 y70 w100 h20 vTextColor, %TextColor%
Gui, 2:Add, Text, x8 y92 w220 h20 , Separator Color
Gui, 2:Add, Edit, x226 y90 w100 h20 vSeparatorColor, %SeparatorColor%
If GoalBox = 1
	Gui, 2:Add, CheckBox, x8 y110 w200 h20 Checked%GoalBox% vGoalBox, Achievement Color
else
	Gui, 2:Add, CheckBox, x8 y110 w200 h20 Unchecked%GoalBox% vGoalBox, Achievement Color
Gui, 2:Add, Edit, x226 y110 w100 h20 vNumColorGoal, %NumColorGoal%
If WarnBox = 1
	Gui, 2:Add, CheckBox, x8 y130 w200 h20 Checked%WarnBox% vWarnBox, Warning Color
else
	Gui, 2:Add, CheckBox, x8 y130 w200 h20 Unchecked%WarnBox% vWarnBox, Warning Color
Gui, 2:Add, Edit, x226 y130 w100 h20 vNumColorWarn, %NumColorWarn%
If BreakBox = 1
	Gui, 2:Add, CheckBox, x8 y150 w200 h20 Checked%BreakBox% vBreakBox, Sync Break Clock Color
else
	Gui, 2:Add, CheckBox, x8 y150 w200 h20 Unchecked%BreakBox% vBreakBox, Sync Break Clock Color
Gui, 2:Add, Edit, x226 y150 w100 h20 vClockColorBreak, %ClockColorBreak%
Gui, 2:Add, Text, x8 y182 w220 h20 , Multitabling Ratio (Min)
Gui, 2:Add, Edit, x226 y180 w100 h20 vMinMTRatio, %MinMTRatio%
Gui, 2:Add, Text, x8 y202 w220 h20 , Multitabling Ratio (Max)
Gui, 2:Add, Edit, x226 y200 w100 h20 vMaxMTRatio, %MaxMTRatio%
Gui, 2:Add, Text, x8 y222 w220 h20 , Destinated Games Per Session
Gui, 2:Add, Edit, x226 y220 w100 h20 vTotalLimit, %TotalLimit%
Gui, 2:Add, Text, x8 y242 w220 h20 , Destinated Session Time (hh:mm)
Gui, 2:Add, Edit, x226 y240 w100 h20 vSessionTimeGoal, %SessionTimeGoal%
Gui, 2:Add, Text, x8 y262 w220 h20 , ABI (Min)
Gui, 2:Add, Text, x218 y262 w8 h20 , $
Gui, 2:Add, Edit, x226 y260 w100 h20 vMinABI, %MinABI%
Gui, 2:Add, Text, x8 y282 w220 h20 , ABI (Max)
Gui, 2:Add, Text, x218 y282 w8 h20 , $
Gui, 2:Add, Edit, x226 y280 w100 h20 vMaxABI, %MaxABI%
Gui, 2:Add, Text, x8 y302 w220 h20 , Investment Limit
Gui, 2:Add, Text, x218 y302 w8 h20 , $
Gui, 2:Add, Edit, x226 y300 w100 h20 vMaxInvest, %MaxInvest%
Gui, 2:Add, Text, x8 y322 w220 h20 , VPP Goal
Gui, 2:Add, Edit, x226 y320 w100 h20 vVPPGoal, %VPPGoal%
Gui, 2:Add, Text, x8 y342 w220 h20 , VIP Multiplicator
Gui, 2:Add, Edit, x226 y340 w100 h20 vVIPMulti, %VIPMulti%
If BustBox = 0
	Gui, 2:Add, CheckBox, x8 y370 w100 h20 Unchecked%BustBox% vBustBox, Bustout Sound
else
	Gui, 2:Add, CheckBox, x8 y370 w100 h20 Checked%BustBox% vBustBox, Bustout Sound
Gui, 2:Add, Edit, x126 y370 w200 h20 vSoundBust, %SoundBust%
If AchieveBox = 0
	Gui, 2:Add, CheckBox, x8 y390 w115 h20 Unchecked%GoalBox% vAchieveBox, Achievement Sound
else
	Gui, 2:Add, CheckBox, x8 y390 w115 h20 Checked%GoalBox% vAchieveBox, Achievement Sound
Gui, 2:Add, Edit, x126 y390 w200 h20 vSoundAchieve, %SoundAchieve%
Gui, 2:Add, Text, x14 y407 w20 h14 , |_
If (IntervalBox = 1) and (AchieveBox = 1)
	Gui, 2:Add, CheckBox, x28 y410 w200 h20 Checked%IntervalBox% vIntervalBox, Repetition Interval
else
	Gui, 2:Add, CheckBox, x28 y410 w200 h20 Unchecked%IntervalBox% vIntervalBox, Repetition Interval
Gui, 2:Add, Edit, x226 y410 w100 h20 vSoundInterval, %SoundInterval%
Gui, 2:Add, Text, x34 y426 w30 h20 , |__
Gui, 2:Add, Text, x55 y432 w400 h20 ,This sound applies only for "Destinated Games"
Gui, 2:Add, Button, x118 y455 w40 h20 gSave,Save
Gui, 2:Add, Button, x163 y455 w50 h20 gCancel,Cancel
Gui, 2:Font, S8 Cff0000 Bold
Gui, 2:Add, Text, x84 y481 w220 h20 , Note: Saving Restarts Script

Gui, 2:Tab, Hotkeys
Gui, 2:Font, S8 CDefault Bold
Gui, 2:Add, Text, x6 y30 w240 h20 , Table Slots
Gui, 2:Font, S8 CDefault norm
Gui, 2:Add, Text, x110 y30 w240 h20 , X
Gui, 2:Add, Text, x160 y30 w240 h20 , Y
Gui, 2:Add, Text, x210 y30 w240 h20 , Hotkey
Gui, 2:Add, Text, x8 y52 w80 h20 , Slot 1 
Gui, 2:Add, Edit, x106 y50 w40 h20 vSlotA1x, %SlotA1x%
Gui, 2:Add, Edit, x156 y50 w40 h20 vSlotA1y, %SlotA1y%
Gui, 2:Add, Edit, x206 y50 w120 h20 vSlotA1Key, %SlotA1Key%
Gui, 2:Add, Text, x8 y72 w240 h20 , Slot 2
Gui, 2:Add, Edit, x106 y70 w40 h20 vSlotA2x, %SlotA2x%
Gui, 2:Add, Edit, x156 y70 w40 h20 vSlotA2y, %SlotA2y%
Gui, 2:Add, Edit, x206 y70 w120 h20 vSlotA2Key, %SlotA2Key%
Gui, 2:Add, Text, x8 y92 w240 h20 , Slot 3
Gui, 2:Add, Edit, x106 y90 w40 h20 vSlotA3x, %SlotA3x%
Gui, 2:Add, Edit, x156 y90 w40 h20 vSlotA3y, %SlotA3y%
Gui, 2:Add, Edit, x206 y90 w120 h20 vSlotA3Key, %SlotA3Key%
Gui, 2:Add, Text, x8 y112 w240 h20 , Slot 4
Gui, 2:Add, Edit, x106 y110 w40 h20 vSlotA4x, %SlotA4x%
Gui, 2:Add, Edit, x156 y110 w40 h20 vSlotA4y, %SlotA4y%
Gui, 2:Add, Edit, x206 y110 w120 h20 vSlotA4Key, %SlotA4Key%
Gui, 2:Add, Text, x8 y132 w80 h20 , Slot 5 
Gui, 2:Add, Edit, x106 y130 w40 h20 vSlotB1x, %SlotB1x%
Gui, 2:Add, Edit, x156 y130 w40 h20 vSlotB1y, %SlotB1y%
Gui, 2:Add, Edit, x206 y130 w120 h20 vSlotB1Key, %SlotB1Key%
Gui, 2:Add, Text, x8 y152 w240 h20 , Slot 6
Gui, 2:Add, Edit, x106 y150 w40 h20 vSlotB2x, %SlotB2x%
Gui, 2:Add, Edit, x156 y150 w40 h20 vSlotB2y, %SlotB2y%
Gui, 2:Add, Edit, x206 y150 w120 h20 vSlotB2Key, %SlotB2Key%
Gui, 2:Add, Text, x8 y172 w240 h20 , Slot 7
Gui, 2:Add, Edit, x106 y170 w40 h20 vSlotB3x, %SlotB3x%
Gui, 2:Add, Edit, x156 y170 w40 h20 vSlotB3y, %SlotB3y%
Gui, 2:Add, Edit, x206 y170 w120 h20 vSlotB3Key, %SlotB3Key%
Gui, 2:Add, Text, x8 y192 w240 h20 , Slot 8
Gui, 2:Add, Edit, x106 y190 w40 h20 vSlotB4x, %SlotB4x%
Gui, 2:Add, Edit, x156 y190 w40 h20 vSlotB4y, %SlotB4y%
Gui, 2:Add, Edit, x206 y190 w120 h20 vSlotB4Key, %SlotB4Key%
Gui, 2:Add, Text, x8 y212 w80 h20 , Slot 9 
Gui, 2:Add, Edit, x106 y210 w40 h20 vSlotC1x, %SlotC1x%
Gui, 2:Add, Edit, x156 y210 w40 h20 vSlotC1y, %SlotC1y%
Gui, 2:Add, Edit, x206 y210 w120 h20 vSlotC1Key, %SlotC1Key%
Gui, 2:Add, Text, x8 y232 w240 h20 , Slot 10
Gui, 2:Add, Edit, x106 y230 w40 h20 vSlotC2x, %SlotC2x%
Gui, 2:Add, Edit, x156 y230 w40 h20 vSlotC2y, %SlotC2y%
Gui, 2:Add, Edit, x206 y230 w120 h20 vSlotC2Key, %SlotC2Key%
Gui, 2:Add, Text, x8 y252 w240 h20 , Slot 11
Gui, 2:Add, Edit, x106 y250 w40 h20 vSlotC3x, %SlotC3x%
Gui, 2:Add, Edit, x156 y250 w40 h20 vSlotC3y, %SlotC3y%
Gui, 2:Add, Edit, x206 y250 w120 h20 vSlotC3Key, %SlotC3Key%
Gui, 2:Add, Text, x8 y272 w240 h20 , Slot 12
Gui, 2:Add, Edit, x106 y270 w40 h20 vSlotC4x, %SlotC4x%
Gui, 2:Add, Edit, x156 y270 w40 h20 vSlotC4y, %SlotC4y%
Gui, 2:Add, Edit, x206 y270 w120 h20 vSlotC4Key, %SlotC4Key%
Gui, 2:Add, Text, x8 y302 w180 h20 , Reset Session Time
Gui, 2:Add, Edit, x206 y300 w120 h20 vReset, %Reset%
Gui, 2:Add, Text, x8 y322 w180 h20 , Increase Session Time By 1
Gui, 2:Add, Edit, x206 y320 w120 h20 vIncrease, %Increase%
Gui, 2:Add, Text, x8 y342 w180 h20 , Pause/Continue
Gui, 2:Add, Edit, x206 y340 w120 h20 vPause, %Pause%
Gui, 2:Add, Text, x8 y362 w180 h20 , Close
Gui, 2:Add, Edit, x206 y360 w120 h20 vClose, %Close%
Gui, 2:Add, Button, x118 y455 w40 h20 gSave,Save
Gui, 2:Add, Button, x163 y455 w50 h20 gCancel,Cancel
Gui, 2:Font, S8 Cff0000 Bold
Gui, 2:Add, Text, x84 y481 w220 h20 , Note: Saving Restarts Script

Gui, 2:Tab, Types
Gui, 2:Font, S8 CDefault Bold
Gui, 2:Add, Text, x8 y32 w240 h20 , Game Types Description: 
Gui, 2:Font, S8 CDefault norm
;Gui, 2:Add, Text, x8 y60 w400 h20 , Game Types refer to the term between the square brackets in nnnn
Gui, 2:Add, Text, x8 y60 w400 h20 , Game Types refer %A_Space%to %A_Space%the term %A_Space%inside %A_Space%the square brackets %A_Space%in %A_Space%the
Gui, 2:Add, Text, x8 y77 w400 h20 , target windows' %A_Space%titles. For 9max regular speed games, whose titles
Gui, 2:Add, Text, x8 y94 w400 h20 , lack such a term, %A_Space% just type "9-Max", and for 9max turbos just type  
Gui, 2:Add, Text, x8 y111 w400 h20, "Turbo". The following definitions group games as described:    
Gui, 2:Add, Text, x8 y128 w400 h20,     
Gui, 2:Font, S8 CDefault Bold     
Gui, 2:Add, Text, x8 y145 w400 h20, HU 
Gui, 2:Add, Text, x8 y162 w400 h20, HUSTT    
Gui, 2:Add, Text, x8 y179 w400 h20, 6-Max    
Gui, 2:Add, Text, x8 y196 w400 h20, 9-Max, Turbo 
Gui, 2:Add, Text, x8 y213 w400 h20, 18    
Gui, 2:Add, Text, x8 y230 w400 h20, 45   
Gui, 2:Add, Text, x8 y247 w400 h20, 180       
Gui, 2:Add, Text, x8 y264 w400 h20, 180 Players, Turbo      
Gui, 2:Add, Text, x8 y281 w400 h20,          
Gui, 2:Font, S8 CDefault norm     
Gui, 2:Add, Text, x130 y145 w400 h20, - any heads up SNG, including MTSNG
Gui, 2:Add, Text, x130 y162 w400 h20, - any heads up STT
Gui, 2:Add, Text, x130 y179 w400 h20, - any 6-handed STT     
Gui, 2:Add, Text, x130 y196 w400 h20, - 9-handed turbos and KO's    
Gui, 2:Add, Text, x130 y213 w400 h20, - any 9-handed 18man SNG      
Gui, 2:Add, Text, x130 y230 w400 h20, - any 45 player SNG      
Gui, 2:Add, Text, x130 y247 w400 h20, - any 180 player SNG    
Gui, 2:Add, Text, x130 y264 w400 h20, - any 180 player turbo SNG  
Gui, 2:Add, Text, x130 y281 w400 h20,  
Gui, 2:Add, Text, x8 y298 w400 h20, To avoid accidental groupings, make sure to define the whole term
Gui, 2:Add, Text, x8 y315 w400 h20, inside the brackets. For examle, don't just type %A_Space%"18 Players" %A_Space%if you 
Gui, 2:Add, Text, x8 y332 w400 h20, want to define 18man turbos; Instead, type "18 Players, Turbo".   

;Gui, 2:Tab, About
;Gui, 2:Font, S8 CDefault norm
;Gui, 2:Add, Text, x134 y80 w240 h20 , SessionMan 
;Gui, 2:Add, Text, x132 y100 w240 h20 , Version %Build%

Gui, 2:-SysMenu
Gui, 2:Show, h500 w334, Settings - SessionMan %Build%
return

MenuHdlr_Help:
IfWinExist AutoHotkey Help
    WinActivate
else
	{    
    RegRead ahkInstallDir, HKEY_LOCAL_MACHINE, SOFTWARE\AutoHotkey, InstallDir
    Run %ahkInstallDir%\AutoHotKey.chm
	}
return

MenuHdlr_WinSpy:
RegRead ahkInstallDir, HKEY_LOCAL_MACHINE, SOFTWARE\AutoHotkey, InstallDir
Run %ahkInstallDir%\AU3_Spy.exe
return

MenuHdlr_WebColors:
Gui, 3:Font, S9 C000000 
Gui, 3:Add, Text, x10 y8 w180 h20, Can't access browser. Please visit:
Gui, 3:Add, Edit, x20 y30 w142 h20 vMyEdit, http://html-color-codes.info/
Gui, 3:Add, Button, x65 y60 w50 h20 gCancel,Cancel
Gui, 3:-SysMenu
Gui, 3:Show, h90 w185, Error 
return

Save:
IniRead, xpos, %A_ScriptDir%\SessionMan.ini, GuiPos, x, 4
IniRead, ypos, %A_ScriptDir%\SessionMan.ini, GuiPos, y, 4
IniRead, Logging, %A_ScriptDir%\SessionMan.ini, Logging, Log, false 
Gui, Submit
FileDelete, %A_ScriptDir%\SessionMan.ini
GoSub CheckIni
GoSub UpdateIni
Reload
return

Cancel:
Gui, Destroy
Return

;-------------------------------------------------------- LABELS ---------------------------------------------------------------
CheckIni:
	IfNotExist, %A_ScriptDir%\SessionMan.ini
		{
		IniWrite, %Build%, %A_ScriptDir%\SessionMan.ini, Version, Version
		FileAppend, `n, %A_ScriptDir%\SessionMan.ini
		IniWrite, 4, %A_ScriptDir%\SessionMan.ini, GuiPos, x
		IniWrite, 4, %A_ScriptDir%\SessionMan.ini, GuiPos, y
		FileAppend, `n, %A_ScriptDir%\SessionMan.ini
		IniWrite, false, %A_ScriptDir%\SessionMan.ini, Logging, Log
		}
return	

CheckLogging:
	IfNotExist, %A_ScriptDir%\SessionMan.log.ini
		IniWrite, 0 (logging disabled), %A_ScriptDir%\SessionMan.log.ini, Sessions, Logged
	IniRead, Logging, %A_ScriptDir%\SessionMan.ini, Logging, Log 
	If Logging = true 
		{
		IniRead, SessionCount, %A_ScriptDir%\SessionMan.log.ini, Sessions, Logged
		IniRead, GamesLogged, %A_ScriptDir%\SessionMan.log.ini, Session %SessionCount%, Completed
		If GamesLogged != 0 Game(s)
			{
			SessionCount += 1
			IniWrite, %SessionCount%, %A_ScriptDir%\SessionMan.log.ini, Sessions, Logged
			FileAppend, `n, %A_ScriptDir%\SessionMan.log.ini
			}
		IniWrite, %Start% CET, %A_ScriptDir%\SessionMan.log.ini, Session %SessionCount%, Start
		IniWrite, still running, %A_ScriptDir%\SessionMan.log.ini, Session %SessionCount%, Finish
		IniWrite, N/A, %A_ScriptDir%\SessionMan.log.ini, Session %SessionCount%, Time
		IniWrite, 0 Game(s), %A_ScriptDir%\SessionMan.log.ini, Session %SessionCount%, Total
		IniWrite, 0 Game(s), %A_ScriptDir%\SessionMan.log.ini, Session %SessionCount%, Completed
		Menu Tray, Check, Enable Logging
		}
return

CreateLog:
IniRead, Logging, %A_ScriptDir%\SessionMan.ini, Logging, Log 
If Logging = true
	{
	IniRead, SessionCount, %A_ScriptDir%\SessionMan.log.ini, Sessions, Logged
	IniWrite, %SessionCount%, %A_ScriptDir%\SessionMan.log.ini, Sessions, Logged
	
	FormatTime, Finish, %A_Now%, ddd d.M.yyyy H:mm:ss
	IniWrite, %Finish% CET, %A_ScriptDir%\SessionMan.log.ini, Session %SessionCount%, Finish
	IniWrite, %H1%%H2%:%M1%%M2%, %A_ScriptDir%\SessionMan.log.ini, Session %SessionCount%, Time
	Completed := t0 - c0
	IniWrite, %t0% Game(s), %A_ScriptDir%\SessionMan.log.ini, Session %SessionCount%, Total
	IniWrite, %Completed% Game(s), %A_ScriptDir%\SessionMan.log.ini, Session %SessionCount%, Completed
	;IniWrite, %c0% Game(s), %A_ScriptDir%\SessionMan.log.ini, Session %SessionCount%, Running
	If Completed != 0
		{
		If (H = 0) and (M1 = 0) and (M2 = 0)
			Games := Completed
		IniWrite, %Games%, %A_ScriptDir%\SessionMan.log.ini, Session %SessionCount%, Games/h
		IniWrite, $%BuyIn_Total_Avg%, %A_ScriptDir%\SessionMan.log.ini, Session %SessionCount%, ABI
		IniWrite, $%BuyIn_Total%, %A_ScriptDir%\SessionMan.log.ini, Session %SessionCount%, Invest
		IniWrite, %VPP%, %A_ScriptDir%\SessionMan.log.ini, Session %SessionCount%, VPP
		IniWrite, %FPP%, %A_ScriptDir%\SessionMan.log.ini, Session %SessionCount%, FPP
		FileAppend, `n, %A_ScriptDir%\SessionMan.log.ini
		}
	}
return

UpdateIni:
IniWrite, %Build%, %A_ScriptDir%\SessionMan.ini, Version, Version
FileAppend, `n, %A_ScriptDir%\SessionMan.ini
IniWrite, %xpos%, %A_ScriptDir%\SessionMan.ini, GuiPos, x
IniWrite, %ypos%, %A_ScriptDir%\SessionMan.ini, GuiPos, y
FileAppend, `n, %A_ScriptDir%\SessionMan.ini
IniWrite, %Logging%, %A_ScriptDir%\SessionMan.ini, Logging, Log
If ColumnL
	IniWrite, %ColumnL%, %A_ScriptDir%\SessionMan.ini, Stakes, ColumnL
If ColumnM
	IniWrite, %ColumnM%, %A_ScriptDir%\SessionMan.ini, Stakes, ColumnM
If ColumnR
	IniWrite, %ColumnR%, %A_ScriptDir%\SessionMan.ini, Stakes, ColumnR
If Stake1
	IniWrite, %Stake1%, %A_ScriptDir%\SessionMan.ini, Stakes, Stake1
If Stake2
	IniWrite, %Stake2%, %A_ScriptDir%\SessionMan.ini, Stakes, Stake2
If Stake3
	IniWrite, %Stake3%, %A_ScriptDir%\SessionMan.ini, Stakes, Stake3
If Stake4
	IniWrite, %Stake4%, %A_ScriptDir%\SessionMan.ini, Stakes, Stake4
If Stake5
	IniWrite, %Stake5%, %A_ScriptDir%\SessionMan.ini, Stakes, Stake5
If Stake6
	IniWrite, %Stake6%, %A_ScriptDir%\SessionMan.ini, Stakes, Stake6
If Stake7
	IniWrite, %Stake7%, %A_ScriptDir%\SessionMan.ini, Stakes, Stake7
If Stake8
	IniWrite, %Stake8%, %A_ScriptDir%\SessionMan.ini, Stakes, Stake8
If Stake9
	IniWrite, %Stake9%, %A_ScriptDir%\SessionMan.ini, Stakes, Stake9
If Type1
	IniWrite, %Type1%, %A_ScriptDir%\SessionMan.ini, Stakes, Type1
If Type2
	IniWrite, %Type2%, %A_ScriptDir%\SessionMan.ini, Stakes, Type2
If Type3
	IniWrite, %Type3%, %A_ScriptDir%\SessionMan.ini, Stakes, Type3
If Type4
	IniWrite, %Type4%, %A_ScriptDir%\SessionMan.ini, Stakes, Type4
If Type5
	IniWrite, %Type5%, %A_ScriptDir%\SessionMan.ini, Stakes, Type5
If Type6
	IniWrite, %Type6%, %A_ScriptDir%\SessionMan.ini, Stakes, Type6
If Type7
	IniWrite, %Type7%, %A_ScriptDir%\SessionMan.ini, Stakes, Type7
If Type8
	IniWrite, %Type8%, %A_ScriptDir%\SessionMan.ini, Stakes, Type8
If Type9
	IniWrite, %Type9%, %A_ScriptDir%\SessionMan.ini, Stakes, Type9
If Stake1VPP
	IniWrite, %Stake1VPP%, %A_ScriptDir%\SessionMan.ini, Stakes, Stake1VPP
If Stake2VPP
	IniWrite, %Stake2VPP%, %A_ScriptDir%\SessionMan.ini, Stakes, Stake2VPP
If Stake3VPP
	IniWrite, %Stake3VPP%, %A_ScriptDir%\SessionMan.ini, Stakes, Stake3VPP
If Stake4VPP
	IniWrite, %Stake4VPP%, %A_ScriptDir%\SessionMan.ini, Stakes, Stake4VPP
If Stake5VPP
	IniWrite, %Stake5VPP%, %A_ScriptDir%\SessionMan.ini, Stakes, Stake5VPP
If Stake6VPP
	IniWrite, %Stake6VPP%, %A_ScriptDir%\SessionMan.ini, Stakes, Stake6VPP
If Stake7VPP
	IniWrite, %Stake7VPP%, %A_ScriptDir%\SessionMan.ini, Stakes, Stake7VPP
If Stake8VPP
	IniWrite, %Stake8VPP%, %A_ScriptDir%\SessionMan.ini, Stakes, Stake8VPP
If Stake9VPP
	IniWrite, %Stake9VPP%, %A_ScriptDir%\SessionMan.ini, Stakes, Stake9VPP
If ColorsBox
	IniWrite, 1, %A_ScriptDir%\SessionMan.ini, Stakes, ColorsBox
else, 
	IniWrite, 0, %A_ScriptDir%\SessionMan.ini, Stakes, ColorsBox
If Color1
	IniWrite, %Color1%, %A_ScriptDir%\SessionMan.ini, Stakes, Color1
If Color2
	IniWrite, %Color2%, %A_ScriptDir%\SessionMan.ini, Stakes, Color2
If Color3
	IniWrite, %Color3%, %A_ScriptDir%\SessionMan.ini, Stakes, Color3
If Color4
	IniWrite, %Color4%, %A_ScriptDir%\SessionMan.ini, Stakes, Color4
If Color5
	IniWrite, %Color5%, %A_ScriptDir%\SessionMan.ini, Stakes, Color5
If Color6
	IniWrite, %Color6%, %A_ScriptDir%\SessionMan.ini, Stakes, Color6
If Color7
	IniWrite, %Color7%, %A_ScriptDir%\SessionMan.ini, Stakes, Color7
If Color8
	IniWrite, %Color8%, %A_ScriptDir%\SessionMan.ini, Stakes, Color8
If Color9
	IniWrite, %Color9%, %A_ScriptDir%\SessionMan.ini, Stakes, Color9
	FileAppend, `n, %A_ScriptDir%\SessionMan.ini
If GUIColor
	IniWrite, %GUIColor%, %A_ScriptDir%\SessionMan.ini, Options, GUIColor
If NumColor
	IniWrite, %NumColor%, %A_ScriptDir%\SessionMan.ini, Options, NumColor
If TextColor
	IniWrite, %TextColor%, %A_ScriptDir%\SessionMan.ini, Options, TextColor
If SeparatorColor
	IniWrite, %SeparatorColor%, %A_ScriptDir%\SessionMan.ini, Options, SeparatorColor
If GoalBox
	IniWrite, 1, %A_ScriptDir%\SessionMan.ini, Options, GoalBox
else, 
	IniWrite, 0, %A_ScriptDir%\SessionMan.ini, Options, GoalBox
If NumColorGoal
	IniWrite, %NumColorGoal%, %A_ScriptDir%\SessionMan.ini, Options, NumColorGoal
If WarnBox
	IniWrite, 1, %A_ScriptDir%\SessionMan.ini, Options, WarnBox
else, 
	IniWrite, 0, %A_ScriptDir%\SessionMan.ini, Options, WarnBox
If NumColorWarn
	IniWrite, %NumColorWarn%, %A_ScriptDir%\SessionMan.ini, Options, NumColorWarn
If BreakBox
	IniWrite, 1, %A_ScriptDir%\SessionMan.ini, Options, BreakBox
else, 
	IniWrite, 0, %A_ScriptDir%\SessionMan.ini, Options, BreakBox
If ClockColorBreak
	IniWrite, %ClockColorBreak%, %A_ScriptDir%\SessionMan.ini, Options, ClockColorBreak
If MinMTRatio
	IniWrite, %MinMTRatio%, %A_ScriptDir%\SessionMan.ini, Options, MinMTRatio
If MaxMTRatio
	IniWrite, %MaxMTRatio%, %A_ScriptDir%\SessionMan.ini, Options, MaxMTRatio
If TotalLimit
	IniWrite, %TotalLimit%, %A_ScriptDir%\SessionMan.ini, Options, TotalLimit
If SessionTimeGoal
	IniWrite, %SessionTimeGoal%, %A_ScriptDir%\SessionMan.ini, Options, SessionTimeGoal
If MinABI
	IniWrite, %MinABI%, %A_ScriptDir%\SessionMan.ini, Options, MinABI
If MaxABI
	IniWrite, %MaxABI%, %A_ScriptDir%\SessionMan.ini, Options, MaxABI
If MaxInvest
	IniWrite, %MaxInvest%, %A_ScriptDir%\SessionMan.ini, Options, MaxInvest
If VPPGoal
	IniWrite, %VPPGoal%, %A_ScriptDir%\SessionMan.ini, Options, VPPGoal
If VIPMulti
	IniWrite, %VIPMulti%, %A_ScriptDir%\SessionMan.ini, Options, VIPMulti
If BustBox
	IniWrite, 1, %A_ScriptDir%\SessionMan.ini, Options, BustBox
else, 
	IniWrite, 0, %A_ScriptDir%\SessionMan.ini, Options, BustBox
If SoundBust
	IniWrite, %SoundBust%, %A_ScriptDir%\SessionMan.ini, Options, SoundBust
If AchieveBox
	IniWrite, 1, %A_ScriptDir%\SessionMan.ini, Options, AchieveBox
else, 
	IniWrite, 0, %A_ScriptDir%\SessionMan.ini, Options, AchieveBox
If SoundAchieve
	IniWrite, %SoundAchieve%, %A_ScriptDir%\SessionMan.ini, Options, SoundAchieve
If IntervalBox
	IniWrite, 1, %A_ScriptDir%\SessionMan.ini, Options, IntervalBox
else, 
	IniWrite, 0, %A_ScriptDir%\SessionMan.ini, Options, IntervalBox
If SoundInterval
	IniWrite, %SoundInterval%, %A_ScriptDir%\SessionMan.ini, Options, SoundInterval
	FileAppend, `n, %A_ScriptDir%\SessionMan.ini
If SlotA1x
	IniWrite, %SlotA1x%, %A_ScriptDir%\SessionMan.ini, Coords, SlotA1x
If SlotA2x
	IniWrite, %SlotA2x%, %A_ScriptDir%\SessionMan.ini, Coords, SlotA2x
If SlotA3x
	IniWrite, %SlotA3x%, %A_ScriptDir%\SessionMan.ini, Coords, SlotA3x
If SlotA4x
	IniWrite, %SlotA4x%, %A_ScriptDir%\SessionMan.ini, Coords, SlotA4x
If SlotB1x
	IniWrite, %SlotB1x%, %A_ScriptDir%\SessionMan.ini, Coords, SlotB1x
If SlotB2x
	IniWrite, %SlotB2x%, %A_ScriptDir%\SessionMan.ini, Coords, SlotB2x
If SlotB3x
	IniWrite, %SlotB3x%, %A_ScriptDir%\SessionMan.ini, Coords, SlotB3x
If SlotB4x
	IniWrite, %SlotB4x%, %A_ScriptDir%\SessionMan.ini, Coords, SlotB4x
If SlotC1x
	IniWrite, %SlotC1x%, %A_ScriptDir%\SessionMan.ini, Coords, SlotC1x
If SlotC2x
	IniWrite, %SlotC2x%, %A_ScriptDir%\SessionMan.ini, Coords, SlotC2x
If SlotC3x
	IniWrite, %SlotC3x%, %A_ScriptDir%\SessionMan.ini, Coords, SlotC3x
If SlotC4x
	IniWrite, %SlotC4x%, %A_ScriptDir%\SessionMan.ini, Coords, SlotC4x
If SlotA1y
	IniWrite, %SlotA1y%, %A_ScriptDir%\SessionMan.ini, Coords, SlotA1y
If SlotA2y
	IniWrite, %SlotA2y%, %A_ScriptDir%\SessionMan.ini, Coords, SlotA2y
If SlotA3y
	IniWrite, %SlotA3y%, %A_ScriptDir%\SessionMan.ini, Coords, SlotA3y
If SlotA4y
	IniWrite, %SlotA4y%, %A_ScriptDir%\SessionMan.ini, Coords, SlotA4y
If SlotB1y
	IniWrite, %SlotB1y%, %A_ScriptDir%\SessionMan.ini, Coords, SlotB1y
If SlotB2y
	IniWrite, %SlotB2y%, %A_ScriptDir%\SessionMan.ini, Coords, SlotB2y
If SlotB3y
	IniWrite, %SlotB3y%, %A_ScriptDir%\SessionMan.ini, Coords, SlotB3y
If SlotB4y
	IniWrite, %SlotB4y%, %A_ScriptDir%\SessionMan.ini, Coords, SlotB4y
If SlotC1y
	IniWrite, %SlotC1y%, %A_ScriptDir%\SessionMan.ini, Coords, SlotC1y
If SlotC2y
	IniWrite, %SlotC2y%, %A_ScriptDir%\SessionMan.ini, Coords, SlotC2y
If SlotC3y
	IniWrite, %SlotC3y%, %A_ScriptDir%\SessionMan.ini, Coords, SlotC3y
If SlotC4y
	IniWrite, %SlotC4y%, %A_ScriptDir%\SessionMan.ini, Coords, SlotC4y
	FileAppend, `n, %A_ScriptDir%\SessionMan.ini
If SlotA1Key
	IniWrite, %SlotA1Key%, %A_ScriptDir%\SessionMan.ini, Hotkeys, SlotA1Key
If SlotA2Key
	IniWrite, %SlotA2Key%, %A_ScriptDir%\SessionMan.ini, Hotkeys, SlotA2Key
If SlotA3Key
	IniWrite, %SlotA3Key%, %A_ScriptDir%\SessionMan.ini, Hotkeys, SlotA3Key
If SlotA4Key
	IniWrite, %SlotA4Key%, %A_ScriptDir%\SessionMan.ini, Hotkeys, SlotA4Key
If SlotB1Key
	IniWrite, %SlotB1Key%, %A_ScriptDir%\SessionMan.ini, Hotkeys, SlotB1Key
If SlotB2Key
	IniWrite, %SlotB2Key%, %A_ScriptDir%\SessionMan.ini, Hotkeys, SlotB2Key
If SlotB3Key
	IniWrite, %SlotB3Key%, %A_ScriptDir%\SessionMan.ini, Hotkeys, SlotB3Key
If SlotB4Key
	IniWrite, %SlotB4Key%, %A_ScriptDir%\SessionMan.ini, Hotkeys, SlotB4Key
If SlotC1Key
	IniWrite, %SlotC1Key%, %A_ScriptDir%\SessionMan.ini, Hotkeys, SlotC1Key
If SlotC2Key
	IniWrite, %SlotC2Key%, %A_ScriptDir%\SessionMan.ini, Hotkeys, SlotC2Key
If SlotC3Key
	IniWrite, %SlotC3Key%, %A_ScriptDir%\SessionMan.ini, Hotkeys, SlotC3Key
If SlotC4Key
	IniWrite, %SlotC4Key%, %A_ScriptDir%\SessionMan.ini, Hotkeys, SlotC4Key
If Reset
	IniWrite, %Reset%, %A_ScriptDir%\SessionMan.ini, Hotkeys, Reset
If Increase
	IniWrite, %Increase%, %A_ScriptDir%\SessionMan.ini, Hotkeys, Increase
If Pause
	IniWrite, %Pause%, %A_ScriptDir%\SessionMan.ini, Hotkeys, Pause
If Close
	IniWrite, %Close%, %A_ScriptDir%\SessionMan.ini, Hotkeys, Close	
return

ReadIni:
IniRead, ColumnL, %A_ScriptDir%\SessionMan.ini, Stakes, ColumnL, 180s
IniRead, ColumnM, %A_ScriptDir%\SessionMan.ini, Stakes, ColumnM, 45s
IniRead, ColumnR, %A_ScriptDir%\SessionMan.ini, Stakes, ColumnR, 18s
IniRead, Stake1, %A_ScriptDir%\SessionMan.ini, Stakes, Stake1, $3.50+R
IniRead, Stake2, %A_ScriptDir%\SessionMan.ini, Stakes, Stake2, $8.00
IniRead, Stake3, %A_ScriptDir%\SessionMan.ini, Stakes, Stake3, $15.00
IniRead, Stake4, %A_ScriptDir%\SessionMan.ini, Stakes, Stake4, $3.50
IniRead, Stake5, %A_ScriptDir%\SessionMan.ini, Stakes, Stake5, $7.00
IniRead, Stake6, %A_ScriptDir%\SessionMan.ini, Stakes, Stake6, $15.00
IniRead, Stake7, %A_ScriptDir%\SessionMan.ini, Stakes, Stake7, $3.50
IniRead, Stake8, %A_ScriptDir%\SessionMan.ini, Stakes, Stake8, $7.00
IniRead, Stake9, %A_ScriptDir%\SessionMan.ini, Stakes, Stake9, $15.00
IniRead, Type1, %A_ScriptDir%\SessionMan.ini, Stakes, Type1, 180
IniRead, Type2, %A_ScriptDir%\SessionMan.ini, Stakes, Type2, 180
IniRead, Type3, %A_ScriptDir%\SessionMan.ini, Stakes, Type3, 180
IniRead, Type4, %A_ScriptDir%\SessionMan.ini, Stakes, Type4, 45
IniRead, Type5, %A_ScriptDir%\SessionMan.ini, Stakes, Type5, 45
IniRead, Type6, %A_ScriptDir%\SessionMan.ini, Stakes, Type6, 45
IniRead, Type7, %A_ScriptDir%\SessionMan.ini, Stakes, Type7, 18
IniRead, Type8, %A_ScriptDir%\SessionMan.ini, Stakes, Type8, 18
IniRead, Type9, %A_ScriptDir%\SessionMan.ini, Stakes, Type9, 18
IniRead, Stake1VPP, %A_ScriptDir%\SessionMan.ini, Stakes, Stake1VPP, 1.71					 
IniRead, Stake2VPP, %A_ScriptDir%\SessionMan.ini, Stakes, Stake2VPP, 3.63													
IniRead, Stake3VPP, %A_ScriptDir%\SessionMan.ini, Stakes, Stake3VPP, 6.77												
IniRead, Stake4VPP, %A_ScriptDir%\SessionMan.ini, Stakes, Stake4VPP, 1.71											 
IniRead, Stake5VPP, %A_ScriptDir%\SessionMan.ini, Stakes, Stake5VPP, 3.19					 
IniRead, Stake6VPP, %A_ScriptDir%\SessionMan.ini, Stakes, Stake6VPP, 6.71													
IniRead, Stake7VPP, %A_ScriptDir%\SessionMan.ini, Stakes, Stake7VPP, 1.87												
IniRead, Stake8VPP, %A_ScriptDir%\SessionMan.ini, Stakes, Stake8VPP, 3.03											 
IniRead, Stake9VPP, %A_ScriptDir%\SessionMan.ini, Stakes, Stake9VPP, 6.11			
IniRead, Color1, %A_ScriptDir%\SessionMan.ini, Stakes, Color1, ff0000
IniRead, Color2, %A_ScriptDir%\SessionMan.ini, Stakes, Color2, ff5500
IniRead, Color3, %A_ScriptDir%\SessionMan.ini, Stakes, Color3, ffaa00
IniRead, Color4, %A_ScriptDir%\SessionMan.ini, Stakes, Color4, 00ff55
IniRead, Color5, %A_ScriptDir%\SessionMan.ini, Stakes, Color5, 005555
IniRead, Color6, %A_ScriptDir%\SessionMan.ini, Stakes, Color6, 00aaaa
IniRead, Color7, %A_ScriptDir%\SessionMan.ini, Stakes, Color7, 0033ff
IniRead, Color8, %A_ScriptDir%\SessionMan.ini, Stakes, Color8, 5555ff
IniRead, Color9, %A_ScriptDir%\SessionMan.ini, Stakes, Color9, aa55ff 
IniRead, ColorsBox, %A_ScriptDir%\SessionMan.ini, Stakes, ColorsBox, 0
IniRead, GUIColor, %A_ScriptDir%\SessionMan.ini, Options, GUIColor, 383838
IniRead, NumColor, %A_ScriptDir%\SessionMan.ini, Options, NumColor, 999999
IniRead, TextColor, %A_ScriptDir%\SessionMan.ini, Options, TextColor, 000000
IniRead, SeparatorColor, %A_ScriptDir%\SessionMan.ini, Options, SeparatorColor, 282828
IniRead, GoalBox, %A_ScriptDir%\SessionMan.ini, Options, GoalBox, 1 
IniRead, NumColorGoal, %A_ScriptDir%\SessionMan.ini, Options, NumColorGoal, 33ff33
IniRead, WarnBox, %A_ScriptDir%\SessionMan.ini, Options, WarnBox, 1 
IniRead, NumColorWarn, %A_ScriptDir%\SessionMan.ini, Options, NumColorWarn, ff0000
IniRead, BreakBox, %A_ScriptDir%\SessionMan.ini, Options, BreakBox, 1
IniRead, ClockColorBreak, %A_ScriptDir%\SessionMan.ini, Options, ClockColorBreak, ff0000
IniRead, MinMTRatio, %A_ScriptDir%\SessionMan.ini, Options, MinMTRatio, 16
IniRead, MaxMTRatio, %A_ScriptDir%\SessionMan.ini, Options, MaxMTRatio, 20
IniRead, TotalLimit, %A_ScriptDir%\SessionMan.ini, Options, TotalLimit, 150
IniRead, SessionTimeGoal, %A_ScriptDir%\SessionMan.ini, Options, SessionTimeGoal, 06:00
IniRead, MinABI, %A_ScriptDir%\SessionMan.ini, Options, MinABI, 5
IniRead, MaxABI, %A_ScriptDir%\SessionMan.ini, Options, MaxABI, 7
IniRead, MaxInvest, %A_ScriptDir%\SessionMan.ini, Options, MaxInvest, 1000
IniRead, VPPGoal, %A_ScriptDir%\SessionMan.ini, Options, VPPGoal, 375
IniRead, VIPMulti, %A_ScriptDir%\SessionMan.ini, Options, VIPMulti, 2
IniRead, BustBox, %A_ScriptDir%\SessionMan.ini, Options, BustBox, 0
IniRead, SoundBust, %A_ScriptDir%\SessionMan.ini, Options, SoundBust, C:\Program Files (x86)\PokerStars\snd\bust.wav
IniRead, AchieveBox, %A_ScriptDir%\SessionMan.ini, Options, AchieveBox, 0	
IniRead, SoundAchieve, %A_ScriptDir%\SessionMan.ini, Options, SoundAchieve, C:\Program Files (x86)\PokerStars\snd\ding.wav
IniRead, IntervalBox, %A_ScriptDir%\SessionMan.ini, Options, IntervalBox, 0
IniRead, SoundInterval, %A_ScriptDir%\SessionMan.ini, Options, SoundInterval, 25
IniRead, SlotA1x, %A_ScriptDir%\SessionMan.ini, Coords, SlotA1x, 304
IniRead, SlotA2x, %A_ScriptDir%\SessionMan.ini, Coords, SlotA2x, 1112
IniRead, SlotA3x, %A_ScriptDir%\SessionMan.ini, Coords, SlotA3x, 1920
IniRead, SlotA4x, %A_ScriptDir%\SessionMan.ini, Coords, SlotA4x, 2728
IniRead, SlotB1x, %A_ScriptDir%\SessionMan.ini, Coords, SlotB1x, 304
IniRead, SlotB2x, %A_ScriptDir%\SessionMan.ini, Coords, SlotB2x, 1112
IniRead, SlotB3x, %A_ScriptDir%\SessionMan.ini, Coords, SlotB3x, 1920
IniRead, SlotB4x, %A_ScriptDir%\SessionMan.ini, Coords, SlotB4x, 2728
IniRead, SlotC1x, %A_ScriptDir%\SessionMan.ini, Coords, SlotC1x, 304
IniRead, SlotC2x, %A_ScriptDir%\SessionMan.ini, Coords, SlotC2x, 1112
IniRead, SlotC3x, %A_ScriptDir%\SessionMan.ini, Coords, SlotC3x, 1920
IniRead, SlotC4x, %A_ScriptDir%\SessionMan.ini, Coords, SlotC4x, 2728
IniRead, SlotA1y, %A_ScriptDir%\SessionMan.ini, Coords, SlotA1y, 0
IniRead, SlotA2y, %A_ScriptDir%\SessionMan.ini, Coords, SlotA2y, 0
IniRead, SlotA3y, %A_ScriptDir%\SessionMan.ini, Coords, SlotA3y, 0
IniRead, SlotA4y, %A_ScriptDir%\SessionMan.ini, Coords, SlotA4y, 0
IniRead, SlotB1y, %A_ScriptDir%\SessionMan.ini, Coords, SlotB1y, 584
IniRead, SlotB2y, %A_ScriptDir%\SessionMan.ini, Coords, SlotB2y, 584
IniRead, SlotB3y, %A_ScriptDir%\SessionMan.ini, Coords, SlotB3y, 584
IniRead, SlotB4y, %A_ScriptDir%\SessionMan.ini, Coords, SlotB4y, 584	
IniRead, SlotC1y, %A_ScriptDir%\SessionMan.ini, Coords, SlotC1y, 299
IniRead, SlotC2y, %A_ScriptDir%\SessionMan.ini, Coords, SlotC2y, 299
IniRead, SlotC3y, %A_ScriptDir%\SessionMan.ini, Coords, SlotC3y, 299
IniRead, SlotC4y, %A_ScriptDir%\SessionMan.ini, Coords, SlotC4y, 299
IniRead, SlotA1Key, %A_ScriptDir%\SessionMan.ini, Hotkeys, SlotA1Key, F1
IniRead, SlotA2Key, %A_ScriptDir%\SessionMan.ini, Hotkeys, SlotA2Key, F2
IniRead, SlotA3Key, %A_ScriptDir%\SessionMan.ini, Hotkeys, SlotA3Key, F3
IniRead, SlotA4Key, %A_ScriptDir%\SessionMan.ini, Hotkeys, SlotA4Key, F4
IniRead, SlotB1Key, %A_ScriptDir%\SessionMan.ini, Hotkeys, SlotB1Key, F5
IniRead, SlotB2Key, %A_ScriptDir%\SessionMan.ini, Hotkeys, SlotB2Key, F6
IniRead, SlotB3Key, %A_ScriptDir%\SessionMan.ini, Hotkeys, SlotB3Key, F7
IniRead, SlotB4Key, %A_ScriptDir%\SessionMan.ini, Hotkeys, SlotB4Key, F8
IniRead, SlotC1Key, %A_ScriptDir%\SessionMan.ini, Hotkeys, SlotC1Key, F9
IniRead, SlotC2Key, %A_ScriptDir%\SessionMan.ini, Hotkeys, SlotC2Key, F10
IniRead, SlotC3Key, %A_ScriptDir%\SessionMan.ini, Hotkeys, SlotC3Key, F11
IniRead, SlotC4Key, %A_ScriptDir%\SessionMan.ini, Hotkeys, SlotC4Key, F12
IniRead, Reset, %A_ScriptDir%\SessionMan.ini, Hotkeys, Reset, CTRL+F9
IniRead, Increase, %A_ScriptDir%\SessionMan.ini, Hotkeys, Increase, CTRL+F10
IniRead, Pause, %A_ScriptDir%\SessionMan.ini, Hotkeys, Pause, ALT+Pause
IniRead, Close, %A_ScriptDir%\SessionMan.ini, Hotkeys, Close, CTRL+Q
return

;====================================================== SECTION END =============================================================
;================================================================================================================================
;======================================================== HOTKEYS ===============================================================

^F9::				;counter (SessionTime) reset
{
FormatTime, Start, %A_Now%, ddd d.M.yyyy HH:mm:ss
H1 = 0
H2 = 0
M1 = 0
M2 = 0
Gui, Font, s14 c%NumColor%, Verdana
Gui, Font, Norm
GuiControl, Font, SessionTime
GuiControl,, SessionTime, %H2%:%M1%%M2%
GoSub CheckLogging
}
return
;................................................................................................................................

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

F1::
{
IfWinActive, ahk_class PokerStarsTableFrameClass
	WinMove, %SlotA1x%, %SlotA1y%
else, return
}
return
;......................................................... SLOT1 ................................................................

F2::
{
IfWinActive, ahk_class PokerStarsTableFrameClass
	WinMove, %SlotA2x%, %SlotA2y%
else, return
}
return
;......................................................... SLOT2 ................................................................

F3::
{
IfWinActive, ahk_class PokerStarsTableFrameClass
	WinMove, %SlotA3x%, %SlotA3y%
else, return
}
return
;......................................................... SLOT3 ................................................................

F4::
{
IfWinActive, ahk_class PokerStarsTableFrameClass
	WinMove, %SlotA4x%, %SlotA4y%
else, return
}
return
;......................................................... SLOT4 ................................................................

^F3::
{
IfWinActive, ahk_class PokerStarsTableFrameClass
	WinMove, %SlotA0x%, %SlotA0y%
else, return
}
return
;......................................................... SLOT5 ................................................................

F5::
{
IfWinActive, ahk_class PokerStarsTableFrameClass
	WinMove, %SlotB1x%, %SlotB1y%
else, return
}
return
;......................................................... SLOT6 ................................................................

F6::
{
IfWinActive, ahk_class PokerStarsTableFrameClass
	WinMove, %SlotB2x%, %SlotB2y%
else, return
}
return
;......................................................... SLOT7 ................................................................

F7::
{
IfWinActive, ahk_class PokerStarsTableFrameClass
	WinMove, %SlotB3x%, %SlotB3y%
else, return
}
return
;......................................................... SLOT8 ................................................................

F8::
{
IfWinActive, ahk_class PokerStarsTableFrameClass
	WinMove, %SlotB4x%, %SlotB4y%
else, return
}
return
;......................................................... SLOT9 ................................................................

F9::
{
IfWinActive, ahk_class PokerStarsTableFrameClass
	WinMove, %SlotC1x%, %SlotC1y%
else, return
}
return
;......................................................... SLOT10 ...............................................................

F10::
{
IfWinActive, ahk_class PokerStarsTableFrameClass
	WinMove, %SlotC2x%, %SlotC2y%
else, return
}
return
;......................................................... SLOT11 ...............................................................

F11::
{
IfWinActive, ahk_class PokerStarsTableFrameClass
	WinMove, %SlotC3x%, %SlotC3y%
else, return
}
return
;......................................................... SLOT12 ...............................................................

F12::
{
IfWinActive, ahk_class PokerStarsTableFrameClass
	WinMove, %SlotC4x%, %SlotC4y%
else, return
}
return

;................................................................................................................................

^Q::
GoSub, GuiClose
return
;................................................................................................................................

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

GuiClose:
GoSub, CreateLog 
ExitApp
I fail to find the "tray icon" and the page is no longer available, does anybody still have these 2 files? Thanks.
Table Counter AHK for PokerStars Quote
02-07-2020 , 05:35 PM
could anyone make one like this for party? i would pay of course.
Table Counter AHK for PokerStars Quote
12-22-2020 , 03:54 PM
Can't get this to work now with the aurora update Anyone got a fix. I would appreciate it very much.
Table Counter AHK for PokerStars Quote
12-24-2020 , 06:06 AM
balls'n'all, you need to search and replace PokerStarsTableFrameClass with GLFW30 inside the script code.
Table Counter AHK for PokerStars Quote

      
m