Open Side Menu Go to the Top
Register
Jackpot Poker PT4 Tournament Summary Generator Jackpot Poker PT4 Tournament Summary Generator

05-31-2015 , 06:03 PM
Here's my AHK script / program that creates tournament summaries for WPN Jackpot Poker tournaments. The tournament summaries can be imported to PokerTracker 4 so that winnings are accurately recorded.

This is how it works. You copy+paste all your actual winnings from a report available in the poker client into a text file. The program reads that file and creates tournament summaries that can then be imported into PT4.

Done periodically, this is much less time consuming than manually editing each tournament in PT4.


More detailed instructions.
  1. Navigate to "My Account" --> "Transactions".
  2. From the "Poker Statistics" options, select "Tournaments" (not to be confused with "Tournament History").
  3. Select desired date range and specify number of records per page; click the "Submit" button.
  4. Copy and paste the entire tournament results into a text file (no need for the colum headers or totals at the bottom).

    You should have lines in the text file that look something like this:
    Code:
    2705315 Hold'em $2.00 Jackpot Poker $1.88 0.00 0.00 0.00 $0.09 0.00 0.00 0.00 $0.00 0.00 0.00 0.00 $0.00 0.00 0.00 0.00 $0.00 0.00 0.00 0.00 $0.00 0.00 0.00 0.00 $0.00 0.00 0.00 0.00 5/30/2015 6:47:07 PM 5/30/2015 6:47:19 PM 5/30/2015 6:53:16 PM 00:05:57 
    2705353 Hold'em $2.00 Jackpot Poker $1.88 0.00 0.00 0.00 $0.09 0.00 0.00 0.00 $0.00 0.00 0.00 0.00 $0.00 0.00 0.00 0.00 $0.00 0.00 0.00 0.00 $0.00 0.00 0.00 0.00 $4.00 0.00 0.00 0.00 5/30/2015 6:52:00 PM 5/30/2015 6:52:12 PM 5/30/2015 6:57:38 PM 00:05:26 
    2705388 Hold'em $2.00 Jackpot Poker $1.88 0.00 0.00 0.00 $0.09 0.00 0.00 0.00 $0.00 0.00 0.00 0.00 $0.00 0.00 0.00 0.00 $0.00 0.00 0.00 0.00 $0.00 0.00 0.00 0.00 $12.00 0.00 0.00 0.00 5/30/2015 6:55:53 PM 5/30/2015 6:56:06 PM 5/30/2015 7:04:49 PM 00:08:43 
    2705475 Hold'em $2.00 Jackpot Poker $1.88 0.00 0.00 0.00 $0.09 0.00 0.00 0.00 $0.00 0.00 0.00 0.00 $0.00 0.00 0.00 0.00 $0.00 0.00 0.00 0.00 $0.00 0.00 0.00 0.00 $0.00 0.00 0.00 0.00 5/30/2015 7:07:38 PM 5/30/2015 7:07:49 PM 5/30/2015 7:11:31 PM 00:03:42

    The program interface.



  5. Run the program and enter your screen name (needed for the tournament summary).
  6. Enter/Select the results file (created in step 4).
  7. Enter/Select an output folder for tournament summaries.
  8. Push the Generate Summaries button to make it go.
  9. In the PokerTracker client, import the tournament summaries by navigating to "Play Poker" --> "Get Hands from Disk" --> "Select Directory" to choose the output folder.


Here's what a tournament summary contains. (The player finish position is left blank since PT4 already determined that from the hand history. Seems to import like this without a problem.)

Code:
PokerTracker 4 Tournament Summary
Site: Yatahay Network
Game: Holdem
Tournament #: 2549167
Started: 2015/05/09 22:11:37
Finished: 2015/05/09 22:20:19
Buyin: $1.88
Fee: $0.12
Table Type: STT (3 max) Hyper-Turbo SNG LOTTERY
Tourney Type: No Limit
Players: 3

Place: , Player: Evil Limpire, Won: $12.00,

Getting the Jackpot Poker TS Generator.

For people familiar with AHK, find the code below.

For those not familiar, you have two options.
Option 1) Download the compiled version from the link below and run it directly.
Option 2) Familiarize yourself enough to download and install AHK. Put this code into a file called JackpotTS.ahk. Then you can run it by clicking on it.


Executable version can be downloaded here:
www.dropbox.com/s/lw0pdy33hz9uhq2/JackpotTS.exe?dl=0


AHK code:
Code:
;;;
;;; Jackpot Poker PT4 Tournament Summary Generator
;;;
;;; Creates tournament summaries for WPN Jackpot Poker tournaments that 
;;; can be imported to PokerTracker 4 so that winnings are accurately recorded.
;;;
;;; Author: 2+2 user Max Cut
;;; June 2015
;;;

#SingleInstance Force
#NoEnv
#Persistent


;;;
;;; Build the GUI
;;;
Menu, HelpMenu, Add, &Help, Help
Menu, HelpMenu, Add, &2+2 thread, 2p2Thread
Menu, HelpMenu, Add, &About, About
Menu, MyMenuBar, Add, &Help, :HelpMenu

Gui, Menu, MyMenuBar
Gui, Add, Text, x18 y13 w80, Screen Name
Gui, Add, Button, x10 y35 w80 h22 gResultsSelect, Results File
Gui, Add, Button, x10 y60 w80 h22 gOutputSelect, Output Folder
Gui, Add, Edit, x95 y10 w80 Left vScreenname
Gui, Add, Edit, x95 y35 w225 Left vResultsFile
Gui, Add, Edit, x95 y60 w225 Left vOutputFolder
Gui, Add, Progress, x180 y9 w140 h22 -Smooth Disabled
Gui, Font, c008800 s11
Gui, Add, Text, x180 w140 y9  h22 Center 0x200 BackgroundTrans  gGenerateSummaries, Generate Summaries
FullGui := WinExist()
Gui, Show, h90 w 330, Jackpot Poker TS Generator
Gui, Submit, NoHide
return



;;;
;;; Help dialog.
;;;
Help:
helpText = 
( LTrim
	Jakpot Poker Tournament summary Generator
	
	Creates PokerTracker 4 tournament summaries for WPN Jackpot Poker tournaments so that winnings are acurately recorded.
	
	
	Steps for use:
		
		1) Navigate in poker client to "My Account" --> "Transactions".
		
		2) From the "Poker Statistics" options, select "Tournaments" (not to be confused with "Tournament History").
		
		3) Select desired date range and specify number of records per page; click the "Submit" button. 
				
		4) Copy and paste the entire tournament results into a text file (no need for the colum headers or totals at the bottom).
		
		5) Enter screen name.
		
		6) Enter/select the results file (created in step 4).
		
		7) Enter/select an output folder for tournament summaries.
		
		8) Push Generate Summaries button.
		
		9) In the PokerTracker client, import the tournament summaries by navigating to "Play Poker" --> "Get Hands from Disk" --> "Select Directory" to choose the output folder.
		
		
		2+2 thread (link available in help menu) :
		http://forumserver.twoplustwo.com/218/winning-poker-network/jackpot-poker-pt4-tournament-summary-generator-1536354/
)
MsgBox,, Jackpot Poker TS generator: HELP, %helpText%
return



;;;
;;; Link to 2+2 thread
;;;
2p2Thread:
	Run http://forumserver.twoplustwo.com/218/winning-poker-network/jackpot-poker-pt4-tournament-summary-generator-1536354/
return



;;;
;;; About dialog.
;;;
About:
aboutText = 
( LTrim
	Jackpot Poker TS Generator is free from 2+2 user Max Cut.
)
MsgBox,, Jackpot Poker TS generator: ABOUT, %aboutText%
return



;;;
;;; Dialog for selecting results file.
;;;
ResultsSelect:
FileSelectFile, SelectedFile, 3, , Select results file..., Text Documents (*.txt)
If SelectedFile = 
{
	if ResultsFile =
	{
		MsgBox,, Jackpot Poker TS generator: ERROR, Please select a results file...
	}
}
else
{
	ResultsFile := SelectedFile
	GuiControl, , ResultsFile, %SelectedFile%
}
return



;;;
;;; Dialog for selecting output folder
;;;
OutputSelect:
FileSelectFolder, SelectedFolder,, 3, Select output folder...
If SelectedFolder = 
{
	if OutputFolder =
	{
		MsgBox,, Jackpot Poker TS generator: ERROR, Please select a folder for the tournament summaries...
	}
}
else
{
	OutputFolder := SelectedFolder
	GuiControl, , OutputFolder, %SelectedFolder%
}
return



;;;
;;; Generate PT4 tournament summaries from 
;;; results file and write them to output folder
;;;
GenerateSummaries:
Gui, Submit, NoHide

;;; Basic error chaecking
If ScreenName = 
{
	MsgBox,, Jackpot Poker TS generator: ERROR, Please enter a screen name...
	return
}
If ResultsFile = 
{
	MsgBox,, Jackpot Poker TS generator: ERROR, Please select a results file...
	return
}
FileRead, results, %ResultsFile%
If ErrorLevel
{ 
	MsgBox,, Jackpot Poker TS generator: ERROR, Error reading results file: `"%ResultsFile%`".`n`nPlease select a results file...
	return
}
IfNotExist, %OutputFolder% 
{
	MsgBox,, Jackpot Poker TS generator: ERROR, Folder `"%OutputFolder%`" not found.`n`nPlease select a folder for the tournament summaries...
	return
}
	
;;; Number of TS written.
TScount := 0

Loop, Parse, results, `n
{
	;;; line will hold a line from the results file.
	;;; line4 will hold the game type -- looking for Jackpot games.
	line4 =
	StringSplit, line, A_LoopField, %A_Space%
	
	winnings := SubStr(line30, 2)
	
	IfNotInString, line4, Jackpot
	{
		;;; Only generating TS for Jackpot Poker.
		continue
	}

	if  (0 >= winnings)
	{
		;;; Only need to make TS when there are winnings.
		continue
	}
	
	
	;;; Get tournament times and format them
	StringGetPos, pos, line38, :
	hours12 := SubStr(line38, 1, pos)
	rest := SubStr(line38, pos+1)
	if ("AM" == line39)
	{
		if (12 == hours12)
		{
			hours24 := 0
		}
		else
		{
			hours24 := hours12
		}
	}
	else if (12 > hours12)
	{
		hours24 := hours12 + 12
	}
	else
	{
		hours24 := hours12
	}
	t = %line38% %line39%
	line38 = %hours24%%rest%

	StringGetPos, pos, line41, :
	hours12 := SubStr(line41, 1, pos)
	rest := SubStr(line41, pos+1)
	if ("AM" == line42)
	{
		if (12 == hours12)
		{
			hours24 := 0
		}
		else
		{
			hours24 := hours12
		}
	}
	else if (12 > hours12)
	{
		hours24 := hours12 + 12
	}
	else
	{
		hours24 := hours12
	}
	t = %line41% %line42%
	line41 = %hours24%%rest%

	StringSplit, dateParts, line37, /
	SetFormat, FloatFast, 02
	startyear := dateParts3
	startmonth := dateParts1 + 0.0
	startday := dateParts2 + 0.0

	StringSplit, dateParts, line40, /
	SetFormat, FloatFast, 02
	endyear := dateParts3
	endmonth := dateParts1 + 0.0
	endday := dateParts2 + 0.0
	tsdate = %endyear%%endmonth%%endday%	
	
	;;; We leave finish position blank sine PT4 already figured it out from 
	;;; the hand history and there is no way to always tell from the report data.
	;;; Seems to import fine this way.
	finishpos =
	
	;;; tstext is the tournament summary text.
	tstext =
	tstext = 
	( LTrim
		PokerTracker 4 Tournament Summary
		Site: Yatahay Network
		Game: Holdem
		Tournament #: %line1%
		Started: %startyear%/%startmonth%/%startday% %line38%
		Finished: %endyear%/%endmonth%/%endday% %line41%
		Buyin: %line6%
		Fee: %line10%
		Table Type: STT (3 max) Hyper-Turbo SNG LOTTERY
		Tourney Type: No Limit
		Players: 3
		
		Place: %finishpos%, Player: %ScreenName%, Won: %line30%,
	)
	
	;;; tspath is the path of the output tournament summary file to create.
	tspath = %OutputFolder%\T#%line1% - %line6% + %line10% - %tsdate% - Summary.txt

	;;; Overwrite existing summary.
	IfExist, %tspath%
	{
		FileDelete, %tspath%
	}
	
	;;; Write the tournament summary.
	FileAppend, %tstext%, %tspath%
	if (not ErrorLevel)
	{
		TScount++
	}
}

;;; Report number of tournament summaries generated.
MsgBox, %TScount%  tournament summaries written to folder %OutputFolder%
return



;;; Shut it down!
GuiClose:
ExitApp
return

Last edited by Max Cut; 05-31-2015 at 06:29 PM.
05-31-2015 , 07:10 PM
This is great any chance you have something for HM2?
05-31-2015 , 07:14 PM
Quote:
Originally Posted by trade2win
This is great any chance you have something for HM2?
I could do an HM2 option if HM2 has a TS format that will work. I'm not familiar enough with it to know.

FWIW, I found the PT4 format when I exported some hands and found that it writes it's own tournament summaries as part of the export.
05-31-2015 , 07:56 PM
Very cool.

Just tested it with ~125 games from today and it worked great.

Thanks!
05-31-2015 , 09:56 PM
Thanks for the feedback. GL!
06-02-2015 , 01:09 AM
Just realized the tournament report does not include the Sit&Crush fee. I would prefer to include it, so I updated the program.

Executable:
www.dropbox.com/s/lw0pdy33hz9uhq2/JackpotTS.exe?dl=0

AHK source:
www.dropbox.com/s/w83d2sayeuczdrb/JackpotTS.ahk?dl=0

AHK source:
Code:
;;;
;;; Jackpot Poker PT4 Tournament Summary Generator
;;;
;;; Creates tournament summaries for WPN Jackpot Poker tournaments that 
;;; can be imported to PokerTracker 4 so that winnings are accurately recorded.
;;;
;;; Author: 2+2 user Max Cut
;;; June 2015
;;;

#SingleInstance Force
#NoEnv
#Persistent


;;;
;;; Build the GUI
;;;
Menu, HelpMenu, Add, &Help, Help
Menu, HelpMenu, Add, &2+2 thread, 2p2Thread
Menu, HelpMenu, Add, &About, About
Menu, MyMenuBar, Add, &Help, :HelpMenu

Gui, Menu, MyMenuBar
Gui, Add, Text, x18 y13 w80, Screen Name
Gui, Add, Button, x10 y35 w80 h22 gResultsSelect, Results File
Gui, Add, Button, x10 y60 w80 h22 gOutputSelect, Output Folder
Gui, Add, Edit, x95 y10 w80 Left vScreenname
Gui, Add, Edit, x95 y35 w225 Left vResultsFile
Gui, Add, Edit, x95 y60 w225 Left vOutputFolder
Gui, Add, Progress, x180 y9 w140 h22 -Smooth Disabled
Gui, Font, c008800 s11
Gui, Add, Text, x180 w140 y9  h22 Center 0x200 BackgroundTrans  gGenerateSummaries, Generate Summaries
FullGui := WinExist()
Gui, Show, h90 w 330, Jackpot Poker TS Generator
Gui, Submit, NoHide
return



;;;
;;; Help dialog.
;;;
Help:
helpText = 
( LTrim
	Jakpot Poker Tournament summary Generator
	
	Creates PokerTracker 4 tournament summaries for WPN Jackpot Poker tournaments so that winnings are acurately recorded.
	
	
	Steps for use:
		
		1) Navigate in poker client to "My Account" --> "Transactions".
		
		2) From the "Poker Statistics" options, select "Tournaments" (not to be confused with "Tournament History").
		
		3) Select desired date range and specify number of records per page; click the "Submit" button. 
				
		4) Copy and paste the entire tournament results into a text file (no need for the colum headers or totals at the bottom).
		
		5) Enter screen name.
		
		6) Enter/select the results file (created in step 4).
		
		7) Enter/select an output folder for tournament summaries.
		
		8) Push Generate Summaries button.
		
		9) In the PokerTracker client, import the tournament summaries by navigating to "Play Poker" --> "Get Hands from Disk" --> "Select Directory" to choose the output folder.
		
		
		2+2 thread (link available in help menu) :
		http://forumserver.twoplustwo.com/218/winning-poker-network/jackpot-poker-pt4-tournament-summary-generator-1536354/
)
MsgBox,, Jackpot Poker TS generator: HELP, %helpText%
return



;;;
;;; Link to 2+2 thread
;;;
2p2Thread:
	Run http://forumserver.twoplustwo.com/218/winning-poker-network/jackpot-poker-pt4-tournament-summary-generator-1536354/
return



;;;
;;; About dialog.
;;;
About:
aboutText = 
( LTrim
	Jackpot Poker TS Generator is free from 2+2 user Max Cut.
)
MsgBox,, Jackpot Poker TS generator: ABOUT, %aboutText%
return



;;;
;;; Dialog for selecting results file.
;;;
ResultsSelect:
FileSelectFile, SelectedFile, 3, , Select results file..., Text Documents (*.txt)
If SelectedFile = 
{
	if ResultsFile =
	{
		MsgBox,, Jackpot Poker TS generator: ERROR, Please select a results file...
	}
}
else
{
	ResultsFile := SelectedFile
	GuiControl, , ResultsFile, %SelectedFile%
}
return



;;;
;;; Dialog for selecting output folder
;;;
OutputSelect:
FileSelectFolder, SelectedFolder,, 3, Select output folder...
If SelectedFolder = 
{
	if OutputFolder =
	{
		MsgBox,, Jackpot Poker TS generator: ERROR, Please select a folder for the tournament summaries...
	}
}
else
{
	OutputFolder := SelectedFolder
	GuiControl, , OutputFolder, %SelectedFolder%
}
return



;;;
;;; Generate PT4 tournament summaries from 
;;; results file and write them to output folder
;;;
GenerateSummaries:
Gui, Submit, NoHide

;;; Basic error chaecking
If ScreenName = 
{
	MsgBox,, Jackpot Poker TS generator: ERROR, Please enter a screen name...
	return
}
If ResultsFile = 
{
	MsgBox,, Jackpot Poker TS generator: ERROR, Please select a results file...
	return
}
FileRead, results, %ResultsFile%
If ErrorLevel
{ 
	MsgBox,, Jackpot Poker TS generator: ERROR, Error reading results file: `"%ResultsFile%`".`n`nPlease select a results file...
	return
}
IfNotExist, %OutputFolder% 
{
	MsgBox,, Jackpot Poker TS generator: ERROR, Folder `"%OutputFolder%`" not found.`n`nPlease select a folder for the tournament summaries...
	return
}
	
;;; Number of TS written.
TScount := 0

Loop, Parse, results, `n
{
	;;; line will hold a line from the results file.
	;;; line4 will hold the game type -- looking for Jackpot games.
	line4 =
	StringSplit, line, A_LoopField, %A_Space%
	
	winnings := SubStr(line30, 2)
	
	IfNotInString, line4, Jackpot
	{
		;;; Only generating TS for Jackpot Poker.
		continue
	}

	if  (0 >= winnings)
	{
		;;; Only need to make TS when there are winnings.
		continue
	}
	
	;;; Get tournament times and format them
	StringGetPos, pos, line38, :
	hours12 := SubStr(line38, 1, pos)
	rest := SubStr(line38, pos+1)
	if ("AM" == line39)
	{
		if (12 == hours12)
		{
			hours24 := 0
		}
		else
		{
			hours24 := hours12
		}
	}
	else if (12 > hours12)
	{
		hours24 := hours12 + 12
	}
	else
	{
		hours24 := hours12
	}
	t = %line38% %line39%
	line38 = %hours24%%rest%

	StringGetPos, pos, line41, :
	hours12 := SubStr(line41, 1, pos)
	rest := SubStr(line41, pos+1)
	if ("AM" == line42)
	{
		if (12 == hours12)
		{
			hours24 := 0
		}
		else
		{
			hours24 := hours12
		}
	}
	else if (12 > hours12)
	{
		hours24 := hours12 + 12
	}
	else
	{
		hours24 := hours12
	}
	t = %line41% %line42%
	line41 = %hours24%%rest%

	StringSplit, dateParts, line37, /
	SetFormat, FloatFast, 02
	startyear := dateParts3
	startmonth := dateParts1 + 0.0
	startday := dateParts2 + 0.0

	StringSplit, dateParts, line40, /
	SetFormat, FloatFast, 02
	endyear := dateParts3
	endmonth := dateParts1 + 0.0
	endday := dateParts2 + 0.0
	tsdate = %endyear%%endmonth%%endday%	
	
	;;; Account for Sit&Crush fee which is not reported as rake
	SetFormat, FloatFast, 0.2
	StringTrimLeft, fee, line10, 1
	adjustedFee := fee / 0.75
	
	;;; We leave finish position blank sine PT4 already figured it out from 
	;;; the hand history and there is no way to always tell from the report data.
	;;; Seems to import fine this way.
	finishpos =
	
	;;; tstext is the tournament summary text.
	tstext =
	tstext = 
	( LTrim
		PokerTracker 4 Tournament Summary
		Site: Yatahay Network
		Game: Holdem
		Tournament #: %line1%
		Started: %startyear%/%startmonth%/%startday% %line38%
		Finished: %endyear%/%endmonth%/%endday% %line41%
		Buyin: %line6%
		Fee: $%adjustedFee%
		Table Type: STT (3 max) Hyper-Turbo SNG LOTTERY
		Tourney Type: No Limit
		Players: 3
		
		Place: %finishpos%, Player: %ScreenName%, Won: %line30%,
	)
	
	;;; tspath is the path of the output tournament summary file to create.
	tspath = %OutputFolder%\T#%line1% - %line6% + $%adjustedFee% - %tsdate% - Summary.txt

	;;; Overwrite existing summary.
	IfExist, %tspath%
	{
		FileDelete, %tspath%
	}
	
	;;; Write the tournament summary.
	FileAppend, %tstext%, %tspath%
	if (not ErrorLevel)
	{
		TScount++
	}
}

;;; Report number of tournament summaries generated.
MsgBox, %TScount%  tournament summaries written to folder %OutputFolder%
return



;;; Shut it down!
GuiClose:
ExitApp
return
06-02-2015 , 11:46 AM
Bug fixed (date format). Links in previous post still valid.

Code:
;;;
;;; Jackpot Poker PT4 Tournament Summary Generator
;;;
;;; Creates tournament summaries for WPN Jackpot Poker tournaments that 
;;; can be imported to PokerTracker 4 so that winnings are accurately recorded.
;;;
;;; Author: 2+2 user Max Cut
;;; June 2015
;;;

#SingleInstance Force
#NoEnv
#Persistent


;;;
;;; Build the GUI
;;;
Menu, HelpMenu, Add, &Help, Help
Menu, HelpMenu, Add, &2+2 thread, 2p2Thread
Menu, HelpMenu, Add, &About, About
Menu, MyMenuBar, Add, &Help, :HelpMenu

Gui, Menu, MyMenuBar
Gui, Add, Text, x18 y13 w80, Screen Name
Gui, Add, Button, x10 y35 w80 h22 gResultsSelect, Results File
Gui, Add, Button, x10 y60 w80 h22 gOutputSelect, Output Folder
Gui, Add, Edit, x95 y10 w80 Left vScreenname
Gui, Add, Edit, x95 y35 w225 Left vResultsFile
Gui, Add, Edit, x95 y60 w225 Left vOutputFolder
Gui, Add, Progress, x180 y9 w140 h22 -Smooth Disabled
Gui, Font, c008800 s11
Gui, Add, Text, x180 w140 y9  h22 Center 0x200 BackgroundTrans  gGenerateSummaries, Generate Summaries
FullGui := WinExist()
Gui, Show, h90 w 330, Jackpot Poker TS Generator
Gui, Submit, NoHide
return



;;;
;;; Help dialog.
;;;
Help:
helpText = 
( LTrim
	Jakpot Poker Tournament summary Generator
	
	Creates PokerTracker 4 tournament summaries for WPN Jackpot Poker tournaments so that winnings are acurately recorded.
	
	
	Steps for use:
		
		1) Navigate in poker client to "My Account" --> "Transactions".
		
		2) From the "Poker Statistics" options, select "Tournaments" (not to be confused with "Tournament History").
		
		3) Select desired date range and specify number of records per page; click the "Submit" button. 
				
		4) Copy and paste the entire tournament results into a text file (no need for the colum headers or totals at the bottom).
		
		5) Enter screen name.
		
		6) Enter/select the results file (created in step 4).
		
		7) Enter/select an output folder for tournament summaries.
		
		8) Push Generate Summaries button.
		
		9) In the PokerTracker client, import the tournament summaries by navigating to "Play Poker" --> "Get Hands from Disk" --> "Select Directory" to choose the output folder.
		
		
		2+2 thread (link available in help menu) :
		http://forumserver.twoplustwo.com/21...rator-1536354/
)
MsgBox,, Jackpot Poker TS generator: HELP, %helpText%
return



;;;
;;; Link to 2+2 thread
;;;
2p2Thread:
	Run http://forumserver.twoplustwo.com/21...rator-1536354/
return



;;;
;;; About dialog.
;;;
About:
aboutText = 
( LTrim
	Jackpot Poker TS Generator is free from 2+2 user Max Cut.
)
MsgBox,, Jackpot Poker TS generator: ABOUT, %aboutText%
return



;;;
;;; Dialog for selecting results file.
;;;
ResultsSelect:
FileSelectFile, SelectedFile, 3, , Select results file..., Text Documents (*.txt)
If SelectedFile = 
{
	if ResultsFile =
	{
		MsgBox,, Jackpot Poker TS generator: ERROR, Please select a results file...
	}
}
else
{
	ResultsFile := SelectedFile
	GuiControl, , ResultsFile, %SelectedFile%
}
return



;;;
;;; Dialog for selecting output folder
;;;
OutputSelect:
FileSelectFolder, SelectedFolder,, 3, Select output folder...
If SelectedFolder = 
{
	if OutputFolder =
	{
		MsgBox,, Jackpot Poker TS generator: ERROR, Please select a folder for the tournament summaries...
	}
}
else
{
	OutputFolder := SelectedFolder
	GuiControl, , OutputFolder, %SelectedFolder%
}
return



;;;
;;; Generate PT4 tournament summaries from 
;;; results file and write them to output folder
;;;
GenerateSummaries:
Gui, Submit, NoHide

;;; Basic error chaecking
If ScreenName = 
{
	MsgBox,, Jackpot Poker TS generator: ERROR, Please enter a screen name...
	return
}
If ResultsFile = 
{
	MsgBox,, Jackpot Poker TS generator: ERROR, Please select a results file...
	return
}
FileRead, results, %ResultsFile%
If ErrorLevel
{ 
	MsgBox,, Jackpot Poker TS generator: ERROR, Error reading results file: `"%ResultsFile%`".`n`nPlease select a results file...
	return
}
IfNotExist, %OutputFolder% 
{
	MsgBox,, Jackpot Poker TS generator: ERROR, Folder `"%OutputFolder%`" not found.`n`nPlease select a folder for the tournament summaries...
	return
}
	
;;; Number of TS written.
TScount := 0

Loop, Parse, results, `n
{
	;;; line will hold a line from the results file.
	;;; line4 will hold the game type -- looking for Jackpot games.
	line4 =
	StringSplit, line, A_LoopField, %A_Space%
	
	winnings := SubStr(line30, 2)
	
	IfNotInString, line4, Jackpot
	{
		;;; Only generating TS for Jackpot Poker.
		continue
	}

	if  (0 >= winnings)
	{
		;;; Only need to make TS when there are winnings.
		continue
	}
	
	;;; Account for Sit&Crush fee which is not reported as rake
	SetFormat, FloatFast, 0.2
	StringTrimLeft, fee, line10, 1
	adjFee := fee / 0.75
	adjustedFee = %adjFee%

	;;; Get tournament times and format them
	StringGetPos, pos, line38, :
	hours12 := SubStr(line38, 1, pos)
	rest := SubStr(line38, pos+1)
	if ("AM" == line39)
	{
		if (12 == hours12)
		{
			hours24 := 0
		}
		else
		{
			hours24 := hours12
		}
	}
	else if (12 > hours12)
	{
		hours24 := hours12 + 12
	}
	else
	{
		hours24 := hours12
	}
	t = %line38% %line39%
	line38 = %hours24%%rest%

	StringGetPos, pos, line41, :
	hours12 := SubStr(line41, 1, pos)
	rest := SubStr(line41, pos+1)
	if ("AM" == line42)
	{
		if (12 == hours12)
		{
			hours24 := 0
		}
		else
		{
			hours24 := hours12
		}
	}
	else if (12 > hours12)
	{
		hours24 := hours12 + 12
	}
	else
	{
		hours24 := hours12
	}
	t = %line41% %line42%
	line41 = %hours24%%rest%

	StringSplit, dateParts, line37, /
	SetFormat, FloatFast, 02
	startyear := dateParts3
	startmonth := dateParts1 + 0.0
	startday := dateParts2 + 0.0

	StringSplit, dateParts, line40, /
	SetFormat, FloatFast, 02
	endyear := dateParts3
	endmonth := dateParts1 + 0.0
	endday := dateParts2 + 0.0
	tsdate = %endyear%%endmonth%%endday%	
	
	;;; We leave finish position blank sine PT4 already figured it out from 
	;;; the hand history and there is no way to always tell from the report data.
	;;; Seems to import fine this way.
	finishpos =
	
	;;; tstext is the tournament summary text.
	tstext =
	tstext = 
	( LTrim
		PokerTracker 4 Tournament Summary
		Site: Yatahay Network
		Game: Holdem
		Tournament #: %line1%
		Started: %startyear%/%startmonth%/%startday% %line38%
		Finished: %endyear%/%endmonth%/%endday% %line41%
		Buyin: %line6%
		Fee: $%adjustedFee%
		Table Type: STT (3 max) Hyper-Turbo SNG LOTTERY
		Tourney Type: No Limit
		Players: 3
		
		Place: %finishpos%, Player: %ScreenName%, Won: %line30%,
	)
	
	;;; tspath is the path of the output tournament summary file to create.
	tspath = %OutputFolder%\T#%line1% - %line6% + $%adjustedFee% - %tsdate% - Summary.txt

	;;; Overwrite existing summary.
	IfExist, %tspath%
	{
		FileDelete, %tspath%
	}
	
	;;; Write the tournament summary.
	FileAppend, %tstext%, %tspath%
	if (not ErrorLevel)
	{
		TScount++
	}
}

;;; Report number of tournament summaries generated.
MsgBox, %TScount%  tournament summaries written to folder %OutputFolder%
return



;;; Shut it down!
GuiClose:
ExitApp
return
06-02-2015 , 02:12 PM
Thanks for the job, I'll give it a test drive when I have spare time.
06-02-2015 , 07:45 PM
Another bug fix for incorrect fees.


Executable:
www.dropbox.com/s/lw0pdy33hz9uhq2/JackpotTS.exe?dl=0

AHK source:
www.dropbox.com/s/w83d2sayeuczdrb/JackpotTS.ahk?dl=0

AHK source:
Code:
;;;
;;; Jackpot Poker PT4 Tournament Summary Generator
;;;
;;; Creates tournament summaries for WPN Jackpot Poker tournaments that 
;;; can be imported to PokerTracker 4 so that winnings are accurately recorded.
;;;
;;; Author: 2+2 user Max Cut
;;; June 2015
;;;

#SingleInstance Force
#NoEnv
#Persistent


;;;
;;; Build the GUI
;;;
Menu, HelpMenu, Add, &Help, Help
Menu, HelpMenu, Add, &2+2 thread, 2p2Thread
Menu, HelpMenu, Add, &About, About
Menu, MyMenuBar, Add, &Help, :HelpMenu

Gui, Menu, MyMenuBar
Gui, Add, Text, x18 y13 w80, Screen Name
Gui, Add, Button, x10 y35 w80 h22 gResultsSelect, Results File
Gui, Add, Button, x10 y60 w80 h22 gOutputSelect, Output Folder
Gui, Add, Edit, x95 y10 w80 Left vScreenname
Gui, Add, Edit, x95 y35 w225 Left vResultsFile
Gui, Add, Edit, x95 y60 w225 Left vOutputFolder
Gui, Add, Progress, x180 y9 w140 h22 -Smooth Disabled
Gui, Font, c008800 s11
Gui, Add, Text, x180 w140 y9  h22 Center 0x200 BackgroundTrans  gGenerateSummaries, Generate Summaries
FullGui := WinExist()
Gui, Show, h90 w 330, Jackpot Poker TS Generator
Gui, Submit, NoHide
return



;;;
;;; Help dialog.
;;;
Help:
helpText = 
( LTrim
	Jakpot Poker Tournament summary Generator
	
	Creates PokerTracker 4 tournament summaries for WPN Jackpot Poker tournaments so that winnings are acurately recorded.
	
	
	Steps for use:
		
		1) Navigate in poker client to "My Account" --> "Transactions".
		
		2) From the "Poker Statistics" options, select "Tournaments" (not to be confused with "Tournament History").
		
		3) Select desired date range and specify number of records per page; click the "Submit" button. 
				
		4) Copy and paste the entire tournament results into a text file (no need for the colum headers or totals at the bottom).
		
		5) Enter screen name.
		
		6) Enter/select the results file (created in step 4).
		
		7) Enter/select an output folder for tournament summaries.
		
		8) Push Generate Summaries button.
		
		9) In the PokerTracker client, import the tournament summaries by navigating to "Play Poker" --> "Get Hands from Disk" --> "Select Directory" to choose the output folder.
		
		
		2+2 thread (link available in help menu) :
		http://forumserver.twoplustwo.com/218/winning-poker-network/jackpot-poker-pt4-tournament-summary-generator-1536354/
)
MsgBox,, Jackpot Poker TS generator: HELP, %helpText%
return



;;;
;;; Link to 2+2 thread
;;;
2p2Thread:
	Run http://forumserver.twoplustwo.com/218/winning-poker-network/jackpot-poker-pt4-tournament-summary-generator-1536354/
return



;;;
;;; About dialog.
;;;
About:
aboutText = 
( LTrim
	Jackpot Poker TS Generator is free from 2+2 user Max Cut.
)
MsgBox,, Jackpot Poker TS generator: ABOUT, %aboutText%
return



;;;
;;; Dialog for selecting results file.
;;;
ResultsSelect:
FileSelectFile, SelectedFile, 3, , Select results file..., Text Documents (*.txt)
If SelectedFile = 
{
	if ResultsFile =
	{
		MsgBox,, Jackpot Poker TS generator: ERROR, Please select a results file...
	}
}
else
{
	ResultsFile := SelectedFile
	GuiControl, , ResultsFile, %SelectedFile%
}
return



;;;
;;; Dialog for selecting output folder
;;;
OutputSelect:
FileSelectFolder, SelectedFolder,, 3, Select output folder...
If SelectedFolder = 
{
	if OutputFolder =
	{
		MsgBox,, Jackpot Poker TS generator: ERROR, Please select a folder for the tournament summaries...
	}
}
else
{
	OutputFolder := SelectedFolder
	GuiControl, , OutputFolder, %SelectedFolder%
}
return



;;;
;;; Generate PT4 tournament summaries from 
;;; results file and write them to output folder
;;;
GenerateSummaries:
Gui, Submit, NoHide

;;; Basic error chaecking
If ScreenName = 
{
	MsgBox,, Jackpot Poker TS generator: ERROR, Please enter a screen name...
	return
}
If ResultsFile = 
{
	MsgBox,, Jackpot Poker TS generator: ERROR, Please select a results file...
	return
}
FileRead, results, %ResultsFile%
If ErrorLevel
{ 
	MsgBox,, Jackpot Poker TS generator: ERROR, Error reading results file: `"%ResultsFile%`".`n`nPlease select a results file...
	return
}
IfNotExist, %OutputFolder% 
{
	MsgBox,, Jackpot Poker TS generator: ERROR, Folder `"%OutputFolder%`" not found.`n`nPlease select a folder for the tournament summaries...
	return
}
	
;;; Number of TS written.
TScount := 0

Loop, Parse, results, `n
{
	;;; line will hold a line from the results file.
	;;; line4 will hold the game type -- looking for Jackpot games.
	line4 =
	StringSplit, line, A_LoopField, %A_Space%
	
	winnings := SubStr(line30, 2)
	
	IfNotInString, line4, Jackpot
	{
		;;; Only generating TS for Jackpot Poker.
		continue
	}

	if  (0 >= winnings)
	{
		;;; Only need to make TS when there are winnings.
		continue
	}
	
	;;; Get tournament times and format them
	StringGetPos, pos, line38, :
	hours12 := SubStr(line38, 1, pos)
	rest := SubStr(line38, pos+1)
	if ("AM" == line39)
	{
		if (12 == hours12)
		{
			hours24 := 0
		}
		else
		{
			hours24 := hours12
		}
	}
	else if (12 > hours12)
	{
		hours24 := hours12 + 12
	}
	else
	{
		hours24 := hours12
	}
	t = %line38% %line39%
	line38 = %hours24%%rest%

	StringGetPos, pos, line41, :
	hours12 := SubStr(line41, 1, pos)
	rest := SubStr(line41, pos+1)
	if ("AM" == line42)
	{
		if (12 == hours12)
		{
			hours24 := 0
		}
		else
		{
			hours24 := hours12
		}
	}
	else if (12 > hours12)
	{
		hours24 := hours12 + 12
	}
	else
	{
		hours24 := hours12
	}
	t = %line41% %line42%
	line41 = %hours24%%rest%

	StringSplit, dateParts, line37, /
	SetFormat, FloatFast, 02
	startyear := dateParts3
	startmonth := dateParts1 + 0.0
	startday := dateParts2 + 0.0

	StringSplit, dateParts, line40, /
	SetFormat, FloatFast, 02
	endyear := dateParts3
	endmonth := dateParts1 + 0.0
	endday := dateParts2 + 0.0
	tsdate = %endyear%%endmonth%%endday%	
	
	;;; We leave finish position blank sine PT4 already figured it out from 
	;;; the hand history and there is no way to always tell from the report data.
	;;; Seems to import fine this way.
	finishpos =
	
	;;; tstext is the tournament summary text.
	tstext1 =
	tstext1 = 
	( LTrim
		PokerTracker 4 Tournament Summary
		Site: Yatahay Network
		Game: Holdem
		Tournament #: %line1%
		Started: %startyear%/%startmonth%/%startday% %line38%
		Finished: %endyear%/%endmonth%/%endday% %line41%
		
	)
	
	;;; Account for Sit&Crush fee which is not reported as rake
	SetFormat, FloatFast, 0.2
	StringTrimLeft, fee, line10, 1
	adjFee := fee / 0.75

	tstext2 =
	tstext2 = 
	( LTrim
		Buyin: %line6%
		Fee: $%adjFee%
		Table Type: STT (3 max) Hyper-Turbo SNG LOTTERY
		Tourney Type: No Limit
		Players: 3
		
		Place: %finishpos%, Player: %ScreenName%, Won: %line30%,
	)
	
	;;; tspath is the path of the output tournament summary file to create.
	tspath = %OutputFolder%\T#%line1% - %line6% + $%adjFee% - %tsdate% - Summary.txt

	;;; Overwrite existing summary.
	IfExist, %tspath%
	{
		FileDelete, %tspath%
	}
	
	;;; Write the tournament summary.
	FileAppend, %tstext1%%tstext2%, %tspath%
	if (not ErrorLevel)
	{
		TScount++
	}
}

;;; Report number of tournament summaries generated.
MsgBox, %TScount%  tournament summaries written to folder %OutputFolder%
return



;;; Shut it down!
GuiClose:
ExitApp
return
06-03-2015 , 12:46 AM
I tried using this tonight Max and it only created 2 summaries no matter what I did. I used a sample of 10 games, 5 PLO and 5 wsops. The 2 summaries it created were both PLO games...
06-03-2015 , 12:51 AM
I think it only creates summaries for tourneys you cash in. I did it for ~ 9k games I have a feeling it's off by quite a bit for me ~ $5k but I think it was accurate for at least the last 2-3 days .
06-03-2015 , 12:52 AM
It only creates summaries for games you won money in since PT gets it correct when you lose your buyin. That said, I can't even get my PT4 to do buyins correctly as of today. I was hoping I could use the TS for this issue as well but no luck so far. :/

Let me know if you won money in some that it missed. Actually, if that's the case, please paste in the line from the report. Feel free to put in a dummy tournament ID, if you want. I just would like to see if the format is different for WSOP (they pay $TB?) and/or PLO.

Last edited by Max Cut; 06-03-2015 at 01:01 AM.
06-03-2015 , 09:53 AM
Quote:
Originally Posted by Max Cut
It only creates summaries for games you won money in since PT gets it correct when you lose your buyin. That said, I can't even get my PT4 to do buyins correctly as of today. I was hoping I could use the TS for this issue as well but no luck so far. :/

Let me know if you won money in some that it missed. Actually, if that's the case, please paste in the line from the report. Feel free to put in a dummy tournament ID, if you want. I just would like to see if the format is different for WSOP (they pay $TB?) and/or PLO.
I won 2/5 PLO's and those are the 2 it picked up correctly. It seems to not be picking up the WSOPs. They pay $ not TB's. Here's one from the report:

1234567 Hold'em $3 WSOP Jackpots $2.82 0.00 0.00 0.00 $0.13 0.00 0.00 0.00 $0.00 0.00 0.00 0.00 $0.00 0.00 0.00 0.00 $0.00 0.00 0.00 0.00 $0.00 0.00 0.00 0.00 $3.00 0.00 0.00 0.00 6/2/2015 11:15:00 AM 6/2/2015 11:15:15 AM 6/2/2015 11:20:15 AM 00:05:00
06-03-2015 , 11:07 AM
Thanks, I hadn't considered WSOJ since they are devil spawn.


Updated to handle WSOJ.

Executable:
www.dropbox.com/s/lw0pdy33hz9uhq2/JackpotTS.exe?dl=0

AHK source:
www.dropbox.com/s/w83d2sayeuczdrb/JackpotTS.ahk?dl=0

AHK source:
Code:
;;;
;;; Jackpot Poker PT4 Tournament Summary Generator
;;;
;;; Creates tournament summaries for WPN Jackpot Poker tournaments that 
;;; can be imported to PokerTracker 4 so that winnings are accurately recorded.
;;;
;;; Author: 2+2 user Max Cut
;;; June 2015
;;;

#SingleInstance Force
#NoEnv
#Persistent


;;;
;;; Build the GUI
;;;
Menu, HelpMenu, Add, &Help, Help
Menu, HelpMenu, Add, &2+2 thread, 2p2Thread
Menu, HelpMenu, Add, &About, About
Menu, MyMenuBar, Add, &Help, :HelpMenu

Gui, Menu, MyMenuBar
Gui, Add, Text, x18 y13 w80, Screen Name
Gui, Add, Button, x10 y35 w80 h22 gResultsSelect, Results File
Gui, Add, Button, x10 y60 w80 h22 gOutputSelect, Output Folder
Gui, Add, Edit, x95 y10 w80 Left vScreenname
Gui, Add, Edit, x95 y35 w225 Left vResultsFile
Gui, Add, Edit, x95 y60 w225 Left vOutputFolder
Gui, Add, Progress, x180 y9 w140 h22 -Smooth Disabled
Gui, Font, c008800 s11
Gui, Add, Text, x180 w140 y9  h22 Center 0x200 BackgroundTrans  gGenerateSummaries, Generate Summaries
FullGui := WinExist()
Gui, Show, h90 w 330, Jackpot Poker TS Generator
Gui, Submit, NoHide
return



;;;
;;; Help dialog.
;;;
Help:
helpText = 
( LTrim
	Jakpot Poker Tournament summary Generator
	
	Creates PokerTracker 4 tournament summaries for WPN Jackpot Poker tournaments so that winnings are acurately recorded.
	
	
	Steps for use:
		
		1) Navigate in poker client to "My Account" --> "Transactions".
		
		2) From the "Poker Statistics" options, select "Tournaments" (not to be confused with "Tournament History").
		
		3) Select desired date range and specify number of records per page; click the "Submit" button. 
				
		4) Copy and paste the entire tournament results into a text file (no need for the colum headers or totals at the bottom).
		
		5) Enter screen name.
		
		6) Enter/select the results file (created in step 4).
		
		7) Enter/select an output folder for tournament summaries.
		
		8) Push Generate Summaries button.
		
		9) In the PokerTracker client, import the tournament summaries by navigating to "Play Poker" --> "Get Hands from Disk" --> "Select Directory" to choose the output folder.
		
		
		2+2 thread (link available in help menu) :
		http://forumserver.twoplustwo.com/218/winning-poker-network/jackpot-poker-pt4-tournament-summary-generator-1536354/
)
MsgBox,, Jackpot Poker TS generator: HELP, %helpText%
return



;;;
;;; Link to 2+2 thread
;;;
2p2Thread:
	Run http://forumserver.twoplustwo.com/218/winning-poker-network/jackpot-poker-pt4-tournament-summary-generator-1536354/
return



;;;
;;; About dialog.
;;;
About:
aboutText = 
( LTrim
	Jackpot Poker TS Generator is free from 2+2 user Max Cut.
)
MsgBox,, Jackpot Poker TS generator: ABOUT, %aboutText%
return



;;;
;;; Dialog for selecting results file.
;;;
ResultsSelect:
FileSelectFile, SelectedFile, 3, , Select results file..., Text Documents (*.txt)
If SelectedFile = 
{
	if ResultsFile =
	{
		MsgBox,, Jackpot Poker TS generator: ERROR, Please select a results file...
	}
}
else
{
	ResultsFile := SelectedFile
	GuiControl, , ResultsFile, %SelectedFile%
}
return



;;;
;;; Dialog for selecting output folder
;;;
OutputSelect:
FileSelectFolder, SelectedFolder,, 3, Select output folder...
If SelectedFolder = 
{
	if OutputFolder =
	{
		MsgBox,, Jackpot Poker TS generator: ERROR, Please select a folder for the tournament summaries...
	}
}
else
{
	OutputFolder := SelectedFolder
	GuiControl, , OutputFolder, %SelectedFolder%
}
return



;;;
;;; Generate PT4 tournament summaries from 
;;; results file and write them to output folder
;;;
GenerateSummaries:
Gui, Submit, NoHide

;;; Basic error chaecking
If ScreenName = 
{
	MsgBox,, Jackpot Poker TS generator: ERROR, Please enter a screen name...
	return
}
If ResultsFile = 
{
	MsgBox,, Jackpot Poker TS generator: ERROR, Please select a results file...
	return
}
FileRead, results, %ResultsFile%
If ErrorLevel
{ 
	MsgBox,, Jackpot Poker TS generator: ERROR, Error reading results file: `"%ResultsFile%`".`n`nPlease select a results file...
	return
}
IfNotExist, %OutputFolder% 
{
	MsgBox,, Jackpot Poker TS generator: ERROR, Folder `"%OutputFolder%`" not found.`n`nPlease select a folder for the tournament summaries...
	return
}
	
;;; Number of TS written.
TScount := 0

Loop, Parse, results, `n
{
	;;; line will hold a line from the results file.
	;;; line4 will hold the game type -- looking for Jackpot games.
	line4 =
	StringSplit, line, A_LoopField, %A_Space%
	
	winnings := SubStr(line30, 2)
	
	;;; Only generating TS for Jackpot Poker...
	IfNotInString, line4, Jackpot
	{
		;;; or WSOJ.
		IfNotInString, line5, Jackpot
		continue
	}

	;;; Only need to make TS when there are winnings.
	if  (0 >= winnings)
	{
		continue
	}
	
	;;; Get tournament times and format them
	SetFormat, FloatFast, 02
	StringGetPos, pos, line38, :
	hours12 := SubStr(line38, 1, pos)
	rest := SubStr(line38, pos+1)
	if ("AM" == line39)
	{
		if (12 == hours12)
		{
			hours24 := 0
		}
		else
		{
			hours24 := hours12
		}
	}
	else if (12 > hours12)
	{
		hours24 := hours12 + 12
	}
	else
	{
		hours24 := hours12
	}
	t = %line38% %line39%
	line38 = %hours24%%rest%

	StringGetPos, pos, line41, :
	hours12 := SubStr(line41, 1, pos)
	rest := SubStr(line41, pos+1)
	if ("AM" == line42)
	{
		if (12 == hours12)
		{
			hours24 := 0
		}
		else
		{
			hours24 := hours12
		}
	}
	else if (12 > hours12)
	{
		hours24 := hours12 + 12
	}
	else
	{
		hours24 := hours12
	}
	t = %line41% %line42%
	line41 = %hours24%%rest%

	StringSplit, dateParts, line37, /
	SetFormat, FloatFast, 02
	startyear := dateParts3
	startmonth := dateParts1 + 0.0
	startday := dateParts2 + 0.0

	StringSplit, dateParts, line40, /
	SetFormat, FloatFast, 02
	endyear := dateParts3
	endmonth := dateParts1 + 0.0
	endday := dateParts2 + 0.0
	tsdate = %endyear%%endmonth%%endday%	
	
	;;; We leave finish position blank sine PT4 already figured it out from 
	;;; the hand history and there is no way to always tell from the report data.
	;;; Seems to import fine this way.
	finishpos =
	
	;;; tstext is the tournament summary text.
	tstext1 =
	tstext1 = 
	( LTrim
		PokerTracker 4 Tournament Summary
		Site: Yatahay Network
		Game: Holdem
		Tournament #: %line1%
		Started: %startyear%/%startmonth%/%startday% %line38%
		Finished: %endyear%/%endmonth%/%endday% %line41%
		
	)
	
	;;; Account for Sit&Crush fee which is not reported as rake
	SetFormat, FloatFast, 0.2
	StringTrimLeft, fee, line10, 1
	adjFee := fee / 0.75
	
	;;; $3 WSOJ get rounded up apparently.
	IfInString, line4, WSOP
	{
		IfInString, line6, $2.82
		{
			adjFee := 0.18
		}
	}

	tstext2 =
	tstext2 = 
	( LTrim
		Buyin: %line6%
		Fee: $%adjFee%
		Table Type: STT (3 max) Hyper-Turbo SNG LOTTERY
		Tourney Type: No Limit
		Players: 3
		
		Place: %finishpos%, Player: %ScreenName%, Won: %line30%,
	)
	
	;;; tspath is the path of the output tournament summary file to create.
	tspath = %OutputFolder%\T#%line1% - %line6% + $%adjFee% - %tsdate% - Summary.txt

	;;; Overwrite existing summary.
	IfExist, %tspath%
	{
		FileDelete, %tspath%
	}
	
	;;; Write the tournament summary.
	FileAppend, %tstext1%%tstext2%, %tspath%
	if (not ErrorLevel)
	{
		TScount++
	}
}

;;; Report number of tournament summaries generated.
MsgBox, %TScount%  tournament summaries written to folder %OutputFolder%
return



;;; Shut it down!
GuiClose:
ExitApp
return

Last edited by Max Cut; 06-03-2015 at 11:23 AM.
06-03-2015 , 11:13 AM
Thanks Max. It's generating the summary now for wsops but changing the fee from .18c to .17c for the $3 ones, which is over writing the correct fee amount already in PT4.
06-03-2015 , 11:25 AM
Thanks! I updated it now in the previous post.
06-03-2015 , 11:32 AM
Did PT4 stop assining a buyin for anyone else or did I break mine? I just get $0.00 for all my games.
06-03-2015 , 03:08 PM
Quote:
Originally Posted by Max Cut
Did PT4 stop assining a buyin for anyone else or did I break mine? I just get $0.00 for all my games.
It stopped, I submitted a ticket to them already.
06-03-2015 , 03:17 PM
Groovy, thanks.
06-03-2015 , 04:08 PM
Added the option to generate summaries for all jackpot games or only cashes. Seems my PT4 will sometimes update the buyin from a TS, so thought I would at least add the option. GL!



Executable:
www.dropbox.com/s/lw0pdy33hz9uhq2/JackpotTS.exe?dl=0

AHK source:
www.dropbox.com/s/w83d2sayeuczdrb/JackpotTS.ahk?dl=0

AHK source:
Code:
;;;
;;; Jackpot Poker PT4 Tournament Summary Generator
;;;
;;; Creates tournament summaries for WPN Jackpot Poker tournaments that 
;;; can be imported to PokerTracker 4 so that winnings are accurately recorded.
;;;
;;; Author: 2+2 user Max Cut
;;; June 2015
;;;

#SingleInstance Force
#NoEnv
#Persistent


;;;
;;; Build the GUI
;;;
Menu, HelpMenu, Add, &Help, Help
Menu, HelpMenu, Add, &2+2 thread, 2p2Thread
Menu, HelpMenu, Add, &About, About
Menu, MyMenuBar, Add, &Help, :HelpMenu

Gui, Menu, MyMenuBar
Gui, Add, Text, x18 y13 w80, Screen Name
Gui, Add, Button, x10 y35 w80 h22 gResultsSelect, Results File
Gui, Add, Button, x10 y60 w80 h22 gOutputSelect, Output Folder
Gui, Add, Checkbox, x315 y45 w55  vCashesOnly, Cashes Only
Gui, Add, Edit, x95 y10 w130 Left vScreenname
Gui, Add, Edit, x95 y35 w215 Left vResultsFile
Gui, Add, Edit, x95 y60 w215 Left vOutputFolder
Gui, Add, Progress, x230 y9 w140 h22 -Smooth Disabled
Gui, Font, c008800 s10
Gui, Add, Text, x230 w140 y9  h22 Center 0x200 BackgroundTrans  gGenerateSummaries, Generate Summaries
FullGui := WinExist()
Gui, Show, h90 w 380, Jackpot Poker TS Generator
Gui, Submit, NoHide
return



;;;
;;; Help dialog.
;;;
Help:
helpText = 
( LTrim
	Jakpot Poker Tournament summary Generator
	
	Creates PokerTracker 4 tournament summaries for WPN Jackpot Poker tournaments so that winnings are acurately recorded.
	
	
	Steps for use:
		
		1) Navigate in poker client to "My Account" --> "Transactions".
		
		2) From the "Poker Statistics" options, select "Tournaments" (not to be confused with "Tournament History").
		
		3) Select desired date range and specify number of records per page; click the "Submit" button. 
				
		4) Copy and paste the entire tournament results into a text file (no need for the colum headers or totals at the bottom).
		
		5) Enter screen name.
		
		6) Enter/select the results file (created in step 4).
		
		7) Enter/select an output folder for tournament summaries.
		
		8) Push Generate Summaries button.
		
		9) In the PokerTracker client, import the tournament summaries by navigating to "Play Poker" --> "Get Hands from Disk" --> "Select Directory" to choose the output folder.
		
		
		2+2 thread (link available in help menu) :
		http://forumserver.twoplustwo.com/218/winning-poker-network/jackpot-poker-pt4-tournament-summary-generator-1536354/
)
MsgBox,, Jackpot Poker TS generator: HELP, %helpText%
return



;;;
;;; Link to 2+2 thread
;;;
2p2Thread:
	Run http://forumserver.twoplustwo.com/218/winning-poker-network/jackpot-poker-pt4-tournament-summary-generator-1536354/
return



;;;
;;; About dialog.
;;;
About:
aboutText = 
( LTrim
	Jackpot Poker TS Generator is free from 2+2 user Max Cut.
)
MsgBox,, Jackpot Poker TS generator: ABOUT, %aboutText%
return



;;;
;;; Dialog for selecting results file.
;;;
ResultsSelect:
FileSelectFile, SelectedFile, 3, , Select results file..., Text Documents (*.txt)
If SelectedFile = 
{
	if ResultsFile =
	{
		MsgBox,, Jackpot Poker TS generator: ERROR, Please select a results file...
	}
}
else
{
	ResultsFile := SelectedFile
	GuiControl, , ResultsFile, %SelectedFile%
}
return



;;;
;;; Dialog for selecting output folder
;;;
OutputSelect:
FileSelectFolder, SelectedFolder,, 3, Select output folder...
If SelectedFolder = 
{
	if OutputFolder =
	{
		MsgBox,, Jackpot Poker TS generator: ERROR, Please select a folder for the tournament summaries...
	}
}
else
{
	OutputFolder := SelectedFolder
	GuiControl, , OutputFolder, %SelectedFolder%
}
return



;;;
;;; Generate PT4 tournament summaries from 
;;; results file and write them to output folder
;;;
GenerateSummaries:
Gui, Submit, NoHide

;;; Basic error chaecking
If ScreenName = 
{
	MsgBox,, Jackpot Poker TS generator: ERROR, Please enter a screen name...
	return
}
If ResultsFile = 
{
	MsgBox,, Jackpot Poker TS generator: ERROR, Please select a results file...
	return
}
FileRead, results, %ResultsFile%
If ErrorLevel
{ 
	MsgBox,, Jackpot Poker TS generator: ERROR, Error reading results file: `"%ResultsFile%`".`n`nPlease select a results file...
	return
}
IfNotExist, %OutputFolder% 
{
	MsgBox,, Jackpot Poker TS generator: ERROR, Folder `"%OutputFolder%`" not found.`n`nPlease select a folder for the tournament summaries...
	return
}
	
;;; Number of TS written.
TScount := 0

Loop, Parse, results, `n
{
	;;; line will hold a line from the results file.
	;;; line4 will hold the game type -- looking for Jackpot games.
	line4 =
	StringSplit, line, A_LoopField, %A_Space%
	
	winnings := SubStr(line30, 2)
	
	;;; Only generating TS for Jackpot Poker...
	IfNotInString, line4, Jackpot
	{
		;;; or WSOJ.
		IfNotInString, line5, Jackpot
		continue
	}

	;;; Only need to make TS when there are winnings.
	if  (0 >= winnings)
	{
		if (CashesOnly) {
			;continue
		}
	}
	
	;;; Get tournament times and format them
	SetFormat, FloatFast, 02
	StringGetPos, pos, line38, :
	hours12 := SubStr(line38, 1, pos)
	rest := SubStr(line38, pos+1)
	if ("AM" == line39)
	{
		if (12 == hours12)
		{
			hours24 := 0
		}
		else
		{
			hours24 := hours12
		}
	}
	else if (12 > hours12)
	{
		hours24 := hours12 + 12
	}
	else
	{
		hours24 := hours12
	}
	t = %line38% %line39%
	line38 = %hours24%%rest%

	StringGetPos, pos, line41, :
	hours12 := SubStr(line41, 1, pos)
	rest := SubStr(line41, pos+1)
	if ("AM" == line42)
	{
		if (12 == hours12)
		{
			hours24 := 0
		}
		else
		{
			hours24 := hours12
		}
	}
	else if (12 > hours12)
	{
		hours24 := hours12 + 12
	}
	else
	{
		hours24 := hours12
	}
	t = %line41% %line42%
	line41 = %hours24%%rest%

	StringSplit, dateParts, line37, /
	SetFormat, FloatFast, 02
	startyear := dateParts3
	startmonth := dateParts1 + 0.0
	startday := dateParts2 + 0.0

	StringSplit, dateParts, line40, /
	SetFormat, FloatFast, 02
	endyear := dateParts3
	endmonth := dateParts1 + 0.0
	endday := dateParts2 + 0.0
	tsdate = %endyear%%endmonth%%endday%	
	
	;;; We leave finish position blank sine PT4 already figured it out from 
	;;; the hand history and there is no way to always tell from the report data.
	;;; Seems to import fine this way.
	finishpos =
	
	;;; tstext is the tournament summary text.
	tstext1 =
	tstext1 = 
	( LTrim
		PokerTracker 4 Tournament Summary
		Site: Yatahay Network
		Game: Holdem
		Tournament #: %line1%
		Started: %startyear%/%startmonth%/%startday% %line38%
		Finished: %endyear%/%endmonth%/%endday% %line41%
		
	)
	
	;;; Account for Sit&Crush fee which is not reported as rake
	SetFormat, FloatFast, 0.2
	StringTrimLeft, fee, line10, 1
	adjFee := fee / 0.75
	
	;;; $3 WSOJ get rounded up apparently.
	IfInString, line4, WSOP
	{
		IfInString, line6, $2.82
		{
			adjFee := 0.18
		}
	}

	tstext2 =
	tstext2 = 
	( LTrim
		Buyin: %line6%
		Fee: $%adjFee%
		Table Type: STT (3 max) Hyper-Turbo SNG LOTTERY
		Tourney Type: No Limit
		Players: 3
		
		Place: %finishpos%, Player: %ScreenName%, Won: %line30%,
	)
	
	;;; tspath is the path of the output tournament summary file to create.
	tspath = %OutputFolder%\T#%line1% - %line6% + $%adjFee% - %tsdate% - Summary.txt

	;;; Overwrite existing summary.
	IfExist, %tspath%
	{
		FileDelete, %tspath%
	}
	
	;;; Write the tournament summary.
	FileAppend, %tstext1%%tstext2%, %tspath%
	if (not ErrorLevel)
	{
		TScount++
	}
}

;;; Report number of tournament summaries generated.
MsgBox, %TScount%  tournament summaries written to folder %OutputFolder%
return



;;; Shut it down!
GuiClose:
ExitApp
return

Last edited by Max Cut; 06-03-2015 at 04:13 PM.
06-04-2015 , 12:01 AM
Worked like a charm, tip o the cap to you sir Max.
06-04-2015 , 12:10 AM
Thanks, good to hear. I've also heard second-hand reports where the winnings worked out good but stats and/or graphs were messed up. So for anyone trying it, you probably want to try on a just few first to see if they come out OK for you.
06-08-2015 , 07:01 PM
I'm seeing something of a time-zone bug, where somehow the script is adding four hours to the tournament length in PT4. (I'm in US Central.) I can't figure out why this is happening - both the tournament results from WPN and the summaries the script is exporting have times in EDT, and all the hands have the right time stamps. But for some reason PT4 is seeing them as starting four hours earlier.
06-08-2015 , 08:49 PM
Yeah thanks, I forgot to mention that. I see the same thing and have not been able to figure it out yet. Weird also that the total for the column seems to not include the 4 hours. *shrug* Will update if I can get it fixed.
06-14-2015 , 01:24 AM
I tried to use this tonight checking the check-box for just wins to generate, but it still generated all of them. Anyone else running into this?

      
m