Two Plus Two Publishing LLC Two Plus Two Publishing LLC
 

Go Back   Two Plus Two Poker Forums > Internet Poker > Software > Free Software

Notices

Free Software Discussion of Free / Freeware / Donationware / Open Source poker software and Free Graphics mods

Reply
 
Thread Tools Display Modes
Old 09-09-2008, 03:07 AM   #751
Jax
newbie
 
Join Date: Sep 2006
Location: Sydney Australia
Posts: 44
Re: SnG Luck Analyzer (Beta)

Quote:
Originally Posted by Quietdeath View Post
Code:
Full Tilt Poker Game #7888985959: $7+$0.50 Sit&Go (Super Turbo) (59983916), Table 1 - 15/30 - No Limit Hold'em - 9:33:06 ET - 2008/09/01
*** HOLE CARDS ***
Dealt to ThouCantBluffMe [Kh Ah]
ThouCantBluffMe raises to 300, and is all in
snakeman7979 folds
dabillls has 15 seconds left to act
dabillls folds
googlectual folds
fustercluck1 folds
Col Kurtzz folds
rekin1111 folds
FullHOuSE112 folds
melisa2003 folds
Uncalled bet of 270 returned to ThouCantBluffMe
ThouCantBluffMe mucks
ThouCantBluffMe wins the pot (75)
*** SUMMARY ***
Total pot 75 | Rake 0
Seat 1: FullHOuSE112 (small blind) folded before the Flop
Seat 2: melisa2003 (big blind) folded before the Flop
Seat 3: ThouCantBluffMe collected (75), mucked
Seat 4: snakeman7979 didn't bet (folded)
Seat 5: dabillls didn't bet (folded)
Seat 6: googlectual didn't bet (folded)
Seat 7: fustercluck1 didn't bet (folded)
Seat 8: Col Kurtzz didn't bet (folded)
Seat 9: rekin1111 (button) didn't bet (folded)
This HH is incomplete it does not have the starting stacks, that is why it fails. I should have a section withe the seats and starting stacks like this:

Code:
Full Tilt Poker Game #7763347847: $6 + $0.50 Sit & Go (Turbo) (59041467), Table 1 - 15/30 - No Limit Hold'em - 3:49:39 ET - 2008/08/23
Seat 1: suntaek (1,500)
Seat 2: j1mm4y (1,500)
Seat 3: lumpsum (1,500)
Seat 4: Olivers_90 (1,500)
Seat 5: Krstf86 (1,500)
Seat 6: OzTex (1,500)
suntaek posts the small blind of 15
j1mm4y posts the big blind of 30
The button is in seat #6
*** HOLE CARDS ***
It is a common occurence in FTP HH files but the impact is minimal, it just does not evaluate the 1st hand.

I though about artificially re-generating it but it is quite complicated because the script works sequentially and to fix this I would need to go back one hand so it will not be fixed.

Cheers
Jax
Jax is offline   Reply With Quote
Old 09-09-2008, 03:12 AM   #752
Jax
newbie
 
Join Date: Sep 2006
Location: Sydney Australia
Posts: 44
Re: SnG Luck Analyzer (Beta)

Juk,
I thought about the batch files for different formats and we can make as many batch files as we want but it will always be incomplete, I think the best is to do a small script/application that actually generates the batch file.

As example we enter buyin,fee,player,pay structure and it generates the batch.

I am happy to do it but I would need you to communicate to me the formula to calculate the entry_fee_percentage.

Cheers
Jax
Jax is offline   Reply With Quote
Old 09-09-2008, 04:47 AM   #753
sad panda
 
jukofyork's Avatar
 
Join Date: Sep 2004
Location: United Federation of Nit-Farmers.
Posts: 9,406
Re: SnG Luck Analyzer (Beta)

Quote:
Originally Posted by Jax View Post
Juk,
I thought about the batch files for different formats and we can make as many batch files as we want but it will always be incomplete, I think the best is to do a small script/application that actually generates the batch file.
It might even be better to just do away with the batch files altogther and call the main EXE from a GUI AHK script itself, but I'm not sure how to go about getting it to spawn a DOS box for the output (I think it will just silently call the EXE when called from AHK atm).

Quote:
I am happy to do it but I would need you to communicate to me the formula to calculate the entry_fee_percentage.
entry_fee_percentage = (amount_paid_to_enter_sng / total_amount_in_prize_pool) * 100

So for example, Party 33s: It cost $33 to enter and the prize pool is $300 (1st=$150, 2nd=$90, 3rd=$60), so:

entry_fee_percentage = (33 / 300) * 100 = 11%

Juk
jukofyork is offline   Reply With Quote
Old 09-09-2008, 05:01 AM   #754
Jax
newbie
 
Join Date: Sep 2006
Location: Sydney Australia
Posts: 44
Re: SnG Luck Analyzer (Beta)

Quote:
Originally Posted by jukofyork View Post
It might even be better to just do away with the batch files altogther and call the main EXE from a GUI AHK script itself, but I'm not sure how to go about getting it to spawn a DOS box for the output (I think it will just silently call the EXE when called from AHK atm).


entry_fee_percentage = (amount_paid_to_enter_sng / total_amount_in_prize_pool) * 100

So for example, Party 33s: It cost $33 to enter and the prize pool is $300 (1st=$150, 2nd=$90, 3rd=$60), so:

entry_fee_percentage = (33 / 300) * 100 = 11%

Juk
Humm, so simple dont know how I missed it...

I think you are right launching from an ahk script w/o batches would be neat and simple.
You can spawn processe usinf the "run" command in ahk. Not sure it is necessary to open a command prompt but it would be hand to open a notepad window with the log and an explorer window in the working folder to click the .csv

I am improving my script to sort the different tourneys in a separate folder for each buyin and structure to cater for PS and Party but I am kind of stuck with party, I can't find a way to determine the fee from the HH files.

Cheers
Jax
Jax is offline   Reply With Quote
Old 09-09-2008, 06:18 AM   #755
Jax
newbie
 
Join Date: Sep 2006
Location: Sydney Australia
Posts: 44
Re: SnG Luck Analyzer (Beta)

Here is an improved version of the HH sorter.
What this script does is it takes all the hand histories in a folder and copy them in a folder structure where each folder contains only files pertaining to a certain buyin,fee and number of players.
This saves you the work of sorting your files manually before processing them via Juk's program.

Features and limitations
  • HH file must contain at least 2 hands
  • HH must not be corrupt
  • HH must have a .txt filename
  • HH must be FTP, PS or Party (not sure about Party skins)
  • HH must start from the begining of the tourney, it will detect how many players are left in the 1st hand, if you have partial files starting mid tourney, it will incorrectly classify the file as having less starting players.
  • Script will overwrite any existing file in the destination but will not delete files that are not replaced
  • The fee for party HH is not detected, they all go in the Buyin_Players folder
  • The output folders are named i format X+Y_Z where X=Buying Y=Fee Z=Players
  • It will only pick SNG or tournament games
  • It can't differentiate if it is SNG, MTT or Tourney
  • It will only pick NLH games

http://rapidshare.com/files/143841205/hhsorter.exe.html

This script will not work in 100% of the cases but it will do most of your sorting work.

Cheers
Jax
Jax is offline   Reply With Quote
Old 09-09-2008, 08:02 AM   #756
stranger
 
Join Date: Nov 2006
Posts: 6
Re: SnG Luck Analyzer (Beta)

Quote:
Originally Posted by Jax View Post
This HH is incomplete it does not have the starting stacks, that is why it fails. I should have a section withe the seats and starting stacks like this
No, that's not the main problem - but here you go - a handhistory with starting stacks which has the same issue:
Code:
Full Tilt Poker Game #7999560079: $7+$0.50 Sit&Go (Super Turbo) (60835759), Table 1 - 15/30 - No Limit Hold'em - 7:37:36 ET - 2008/09/09
Seat 1: pronto911 (300)
Seat 2: Litchia (300)
Seat 3: rice1975 (300)
Seat 4: ThouCantBluffMe (300)
Seat 5: 1Endymion1 (300)
Seat 6: 7Scred7 (300)
Seat 7: Jason Sun (300)
Seat 8: Thricewise (300)
Seat 9: SoYuKKUSENMAN (300)
pronto911 posts the small blind of 15
Litchia posts the big blind of 30
The button is in seat #9
*** HOLE CARDS ***
Dealt to ThouCantBluffMe [Jd 2s]
rice1975 folds
ThouCantBluffMe folds
1Endymion1 folds
7Scred7 calls 30
Jason Sun folds
Thricewise folds
SoYuKKUSENMAN folds
pronto911 raises to 300, and is all in
Litchia folds
7Scred7 calls 270, and is all in
pronto911 shows [Kc Ah]
7Scred7 shows [Kh Tc]
*** FLOP *** [6c 2h 5d]
*** TURN *** [6c 2h 5d] [As]
*** RIVER *** [6c 2h 5d As] [Td]
pronto911 shows a pair of Aces
7Scred7 shows a pair of Tens
pronto911 wins the pot (630) with a pair of Aces
7Scred7 stands up
*** SUMMARY ***
Total pot 630 | Rake 0
Board: [6c 2h 5d As Td]
Seat 1: pronto911 (small blind) showed [Kc Ah] and won (630) with a pair of Aces
Seat 2: Litchia (big blind) folded before the Flop
Seat 3: rice1975 didn't bet (folded)
Seat 4: ThouCantBluffMe didn't bet (folded)
Seat 5: 1Endymion1 didn't bet (folded)
Seat 6: 7Scred7 showed [Kh Tc] and lost with a pair of Tens
Seat 7: Jason Sun didn't bet (folded)
Seat 8: Thricewise didn't bet (folded)
Seat 9: SoYuKKUSENMAN (button) didn't bet (folded)
If you convert it you get:
Code:
NL Texas Hold'em $ USD Buy-in Trny:60835759 Level:1   Blinds(15/30) - Tuesday, September 09, 07:37:36 ET 2008
Quietdeath is offline   Reply With Quote
Old 09-09-2008, 10:57 AM   #757
Jax
newbie
 
Join Date: Sep 2006
Location: Sydney Australia
Posts: 44
Re: SnG Luck Analyzer (Beta)

Quote:
Originally Posted by Quietdeath View Post
No, that's not the main problem - but here you go - a handhistory with starting stacks which has the same issue:
Code:
Full Tilt Poker Game #7999560079: $7+$0.50 Sit&Go (Super Turbo) (60835759), Table 1 - 15/30 - No Limit Hold'em - 7:37:36 ET - 2008/09/09
Seat 1: pronto911 (300)
Seat 2: Litchia (300)
Seat 3: rice1975 (300)
Seat 4: ThouCantBluffMe (300)
Seat 5: 1Endymion1 (300)
Seat 6: 7Scred7 (300)
Seat 7: Jason Sun (300)
Seat 8: Thricewise (300)
Seat 9: SoYuKKUSENMAN (300)
pronto911 posts the small blind of 15
Litchia posts the big blind of 30
The button is in seat #9
*** HOLE CARDS ***
Dealt to ThouCantBluffMe [Jd 2s]
rice1975 folds
ThouCantBluffMe folds
1Endymion1 folds
7Scred7 calls 30
Jason Sun folds
Thricewise folds
SoYuKKUSENMAN folds
pronto911 raises to 300, and is all in
Litchia folds
7Scred7 calls 270, and is all in
pronto911 shows [Kc Ah]
7Scred7 shows [Kh Tc]
*** FLOP *** [6c 2h 5d]
*** TURN *** [6c 2h 5d] [As]
*** RIVER *** [6c 2h 5d As] [Td]
pronto911 shows a pair of Aces
7Scred7 shows a pair of Tens
pronto911 wins the pot (630) with a pair of Aces
7Scred7 stands up
*** SUMMARY ***
Total pot 630 | Rake 0
Board: [6c 2h 5d As Td]
Seat 1: pronto911 (small blind) showed [Kc Ah] and won (630) with a pair of Aces
Seat 2: Litchia (big blind) folded before the Flop
Seat 3: rice1975 didn't bet (folded)
Seat 4: ThouCantBluffMe didn't bet (folded)
Seat 5: 1Endymion1 didn't bet (folded)
Seat 6: 7Scred7 showed [Kh Tc] and lost with a pair of Tens
Seat 7: Jason Sun didn't bet (folded)
Seat 8: Thricewise didn't bet (folded)
Seat 9: SoYuKKUSENMAN (button) didn't bet (folded)
If you convert it you get:
Code:
NL Texas Hold'em $ USD Buy-in Trny:60835759 Level:1   Blinds(15/30) - Tuesday, September 09, 07:37:36 ET 2008
Somehow your file is a bit different than what I have they have no spaces between the buyin and fee, I've changed it to cater for both and fixed another small problem with players sitting out.

Here is the new version http://rapidshare.com/files/14388892...erter.exe.html

When reporting problems it helps if ppl mentions script version and attaches the troublesome HH

Cheers

Jax
Jax is offline   Reply With Quote
Old 09-09-2008, 12:21 PM   #758
sad panda
 
jukofyork's Avatar
 
Join Date: Sep 2004
Location: United Federation of Nit-Farmers.
Posts: 9,406
Re: SnG Luck Analyzer (Beta)

Quote:
Originally Posted by Jax View Post
When reporting problems it helps if ppl mentions script version and attaches the troublesome HH
I'm gonna give it another day to see if any more problems are ironed out.

Can anybody here confirm if the updated Stars converter (posted recently) is working OK?

Juk
jukofyork is offline   Reply With Quote
Old 09-10-2008, 05:46 PM   #759
centurion
 
MsC0inflip's Avatar
 
Join Date: Oct 2006
Posts: 183
Re: SnG Luck Analyzer (Beta)

Ji Juk,

This one looks like a bug to me.
The summary says that -$109 that I got from the tourney is totally deserved:
Quote:
C:\HH\Juks_BackTestAllInLuck_v1_02b>RunParty_10man _109s.bat
Running on all 10-man Party hands found in the current folder...
Scanning: .\Speed #1331073_1331073.txt
- Total Hands Parsed: 8 (Errors: 0)


NumSNGs : 1 (NumAllIns[2,3,4+]=1,0,0 / NumDataPoints=1)
Actual Won : -109$ (Actual ROI=-100%)
Adjusted Won : -108$ (Adjusted ROI=-99.955%)
$EV Luck : 0$ (-0.0490361$ per all-in)
cEV Luck : 0t (-1.00397e-005t per all-in)

NOTE: 0 SNGs (0 data-points) with missing final hands were ignored.
allin_luck_results_by_hand.csv :
Quote:
HandNumber,ActualWinnings,AdjustedWinnings,$EV_Luc k,cEV_Luck
7364673804,-109,-108.951,-0.0490361,-1.00397e-005
The hand mentioned in the file is a one where I folded preflop.

The hand that I finished with is the following:
Quote:
#Game No : 7364688506
***** Hand History for Game 7364688506 *****
NL Texas Hold'em $109 USD Buy-in Trny: 41930291 Level: 2 Blinds(30/60) - Wednesday, September 10, 17:24:28 ET 2008
Table Speed #1331073 (Real Money)
Seat 5 is the button
Total number of players : 10
Seat 2: Oreglegios ( 3,520 )
Seat 4: Halind111 ( 3,080 )
Seat 5: fastplay666 ( 1,540 )
Seat 6: Drusel ( 200 )
Seat 7: xion05 ( 1,840 )
Seat 9: Tash09 ( 1,140 )
Seat 10: ullerich604 ( 2,240 )
Seat 1: MsC0inflip ( 1,940 )
Seat 3: doublepaddle ( 2,860 )
Seat 8: zoeppie ( 1,640 )
Trny: 41930291 Level: 2
Blinds(30/60)
** Dealing down cards **
Dealt to MsC0inflip [ 5h 6h ]
>You have options at Speed #1384180 Table!.
zoeppie calls [60]
Tash09 folds
ullerich604 calls [60]
MsC0inflip calls [60]
Oreglegios folds
doublepaddle calls [60]
>You have options at Speed #1330027 Table!.
Halind111 raises [180]
fastplay666 folds
Drusel folds
xion05 calls [120]
zoeppie calls [120]
ullerich604 calls [120]
MsC0inflip calls [120]
doublepaddle calls [120]
** Dealing Flop ** [ 3h, 3c, 5s ]
xion05 checks
zoeppie checks
>You have options at Speed #1330027 Table!.
ullerich604 checks
MsC0inflip checks
doublepaddle checks
>You have options at Speed #1384180 Table!.
Halind111 bets [300]
>You have options at Speed #1330115 Table!.
xion05 folds
zoeppie folds
ullerich604 folds
Your time bank will be activated in 5 secs. If you do not want it to be used, please act now.
MsC0inflip will be using his time bank for this hand.
>You have options at Speed #1330115 Table!.
MsC0inflip raises [840]
>You have options at Speed #1330115 Table!.
doublepaddle folds
Halind111 is all-In [2,600]
Your time bank will be activated in 5 secs. If you do not want it to be used, please act now.
MsC0inflip will be using his time bank for this hand.
MsC0inflip is all-In [920]
** Dealing Turn ** [ Qc ]
** Dealing River ** [ 2d ]
MsC0inflip shows [ 5h, 6h ]two pairs, Fives and Threes.
Halind111 shows [ Qd, 9d ]two pairs, Queens and Threes.
Halind111 wins 1,140 chips from the side pot 1 with two pairs, Queens and Threes.
Halind111 wins 4,630 chips from the main pot with two pairs, Queens and Threes.
MsC0inflip finished in 10 place.
MsC0inflip is offline   Reply With Quote
Old 09-10-2008, 05:56 PM   #760
sad panda
 
jukofyork's Avatar
 
Join Date: Sep 2004
Location: United Federation of Nit-Farmers.
Posts: 9,406
Re: SnG Luck Analyzer (Beta)

Quote:
Originally Posted by MsC0inflip View Post
The hand mentioned in the file is a one where I folded preflop.
If you folded pre-flop and 2/3 others got all-in pre-flop then it will work the $EV_Luck out for that hand (ie: it doesn't require you to be involved to effect your luck).

Quote:
The hand that I finished with is the following:
The current code does not handle post-flop all-ins, so this hand will just be ignored. The code I'll release tomorrow does handle post-flop all-ins though.

Juk
jukofyork is offline   Reply With Quote
Old 09-10-2008, 06:19 PM   #761
sad panda
 
jukofyork's Avatar
 
Join Date: Sep 2004
Location: United Federation of Nit-Farmers.
Posts: 9,406
Re: SnG Luck Analyzer (Beta)

So here is what I'm to include tomorrow:

The updated Stars converter posted by k4b4l in post #729:

Code:
; starsconverter.ahk v0.11 - Written by dave_w11 from the 2+2 software forum
; =========================================================================
;
; Usage: autohotkey.exe starsconverter.ahk "output folder" ["input folder"]
; or compile the script  and use starsconverter.exe "output folder" ["input folder"]
;
; if no parameters given, or just the output folder, then select folder(s) using dialogs
;
; IMPORTANT - Make sure the input folder has only PokerStars hand history .txt files in it.
;             I have no idea what will happen if other files are in there.


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


overwritefiles := 0 	; if set to 1 existing converted hand history files will be replaced
			; if set to 0 existing files will be assumed to be correctly converted and skipped


if 0 > 2
{
	MsgBox,16,ERROR,Too many parameters.`nUse starsconverter.exe `"outputfolder`" [`"inputfolder`"]
	ExitApp
}
if 0 < 2
{
	FileSelectFolder,input_folder,*%A_WorkingDir%,0,Select a folder containing ONLY PokerStars hand histories

	if input_folder =
	{
		MsgBox,16,ERROR,No input file selected!
		ExitApp
	}
	IfNotExist,%input_folder%\*.txt
	{
		MsgBox,16,ERROR,No *.txt files found in input folder.
		ExitApp
	}
}
else
{
	input_folder = %2%

	IfNotExist,%input_folder%\*.txt
	{
		MsgBox,16,ERROR,No *.txt files found in input folder.`nUse starsconverter.exe `"outputfolder`" [`"inputfolder`"]
		ExitApp
	}
}


if 0 > 0
{
	usedcommandline := 1

	output_folder = %1%

	IfNotExist,%output_folder%
	{
		FileCreateDir,%output_folder%
		if errorlevel = 1
		{
			MsgBox,16,ERROR,Output folder does not exist and creating folder failed.`nUse starsconverter.exe `"outputfolder`" [`"inputfolder`"]
			ExitApp
		}
	}
}
else
{
	FileSelectFolder,output_folder,*%input_folder%,1,Select a folder to save converted hand histories
	if output_folder =
	{
		MsgBox,16,ERROR,No output file selected!
		ExitApp
	}
	IfNotExist,%output_folder%
	{
		MsgBox,16,ERROR,Output folder does not exist.
		ExitApp
	}
}



ScriptStartTime := A_Now
StartTime := A_TickCount
Tournaments := 0
Loop,%input_folder%\*.txt
	Tournaments += 1


files_kept := 0
files_overwritten := 0
old_files := 0
discarded_hands := 0



Gui,Add,Text,vProgress,Processing tournament 0000000 of %Tournaments%`nTime Elapsed: 000m00s`nTime Remaining: 000m00s
Gui,Show,,Converting Tournaments

Loop,%input_folder%\*.txt
{
	TimeRemaining := (A_TickCount - StartTime)*(Tournaments-A_Index)/(A_Index-files_kept)/1000/60
	GuiControl,,Progress,% "Processing tournament " . A_Index . " of " . Tournaments . "`nTime elapsed: " . Floor((A_TickCount-StartTime)/60000) . "m" . Round(( (A_TickCount-StartTime)/60000 - Floor((A_TickCount-StartTime)/60000) ) * 60) . "s`nTime Remaining: " . Floor(TimeRemaining) . "m" . Round(( TimeRemaining - Floor(TimeRemaining) ) * 60) . "s"
	CurrentHand =
	CurrentTournament =
	a := 1

	FileRead,hh_file,%A_LoopFileFullPath%
	Loop, parse,hh_file, `n, `r
	{
		if A_LoopField
		{
			If a = 1
			{
				a := 0
				reached_summary := 0
				playercount := 0
				ante := 0
				antestring =
				lastante := 0
				discard_hand := 0
				totalpot := 0
				showdown := 0
				allins := 0
				ignore_summary := 0
				smallest_ante := 0
				done_posting := 0
				Loop,10
				{
					player_%A_Index% =
					stack_%A_Index% =
					moneyinpot_%A_Index% := 0
				}

				stacks =
				actionline =
				collectline =
				winline =
				showline =

				StringSplit,parts,A_LoopField,%A_Space%

				StringTrimLeft,game_number,parts3,1
				StringTrimRight,game_number,game_number,1

				StringTrimLeft,tournament_number,parts5,1
				StringTrimRight,tournament_number,tournament_number,1



				StringSplit,buyin,parts6,+
				StringTrimLeft,buyin,buyin1,1
				StringTrimLeft,fee,buyin2,1

				
				StringSplit,dateparts,parts15,/
				year := dateparts1
				month := dateparts2
				day := dateparts3

				hours =
				minutes =
				seconds =
				time =

				If parts16 = -
				{
					StringSplit,timeparts,parts17,:
					hours := timeparts1
					minutes := timeparts2
					seconds := timeparts3
					time := parts17
				}
				Else
				{

					StringSplit,timeparts,parts16,:
					hours := timeparts1
					minutes := timeparts2
					seconds := timeparts3
					time := parts16
				}

				date_and_time := year . month . day . hours . minutes . seconds

				FormatTime,dayofweek,%date_and_time%,WDay

				dayofweek := DayString(dayofweek)
				month := MonthString(month)
				;FormatTime,timestring,%date_and_time%,dddd, MMMM dd, HH:mm:ss
				;timestring .= " ET " . year

				timestring = %dayofweek%, %month% %day%, %time% ET %year%

				levelnumber := getlevelnumber(parts12)

				StringSplit,blindparts,parts13,/
				StringTrimLeft,smallblind,blindparts1,1
				StringTrimRight,bigblind,blindparts2,1

			}
			Else
			{
				StringSplit,parts,A_LoopField,%A_Space%

				if RegExMatch(A_LoopField," said, ")
					continue


				

				if (done_posting != 1)
				{

					if RegExMatch(A_LoopField,"^Seat (.*)?: (.*) \((.*) in chips\)",regex_part)
					{
						playercount += 1
						seat := regex_part1
						player_%seat% := regex_part2
						stack_%seat% := regex_part3
						stacks .= "Seat " . seat . ": " . PartyName(regex_part2) . " ( " . AddCommas(regex_part3) . " )`n"
						continue
					}


	
					if RegExMatch(A_LoopField,"(.*): posts the ante ([^\s]*)(.*)",regex_part)
					{
	
						if regex_part2 > %ante%
							ante := regex_part2

						if regex_part3 = %A_Space%and is all-in
							discard_hand := 1

						name := regex_part1
						antestring .= PartyName(name) . " posts ante [" . regex_part2 . "]`n"
						seat := FindSeat(name)
						;moneyinpot_%seat% += ante
						stack_%seat% -= regex_part2
						totalpot += regex_part2
						continue
					}



					if RegExMatch(A_LoopField,"(.*): posts (.*) blind ([^\s]*)(.*)",regex_part)
					{
						name := regex_part1
						seat := FindSeat(name)
						moneyinpot_%seat% += regex_part3
						totalpot += regex_part3

						;if regex_part4 = %A_Space%and is all-in
						;	discard_hand := 1

						continue
					}



					if RegExMatch(A_LoopField,"^Table '(.*) 1' .*-max Seat #(.*) is the button",regex_part)
					{
						button := regex_part2
						table_number := regex_part1
						buttonline = Seat %button% is the button`n
						continue
					}
				}



				if RegExMatch(A_LoopField,"(.*): folds",regex_part)
				{
					name := regex_part1
					actionline .= PartyName(name) . " folds`n"
					continue
				}
				if RegExMatch(A_LoopField,"(.*): calls ([^\s]*)",regex_part)
				{
					name := regex_part1
					seat := FindSeat(name)
					moneyinpot_%seat% += regex_part2
					totalpot += regex_part2
					if moneyinpot_%seat% = % stack_%seat%
					{
						actionline .= PartyName(name) . " is all-In  [" . AddCommas(regex_part2) . "]`n"
						allins += 1
					}
					else
						actionline .= PartyName(name) . " calls [" . AddCommas(regex_part2) . "]`n"
					continue
				}
				if RegExMatch(A_LoopField,"(.*): checks",regex_part)
				{
					name := regex_part1
					actionline .= PartyName(name) . " checks`n"
					continue
				}


				if RegExMatch(A_LoopField,"^Dealt to (.*) \[(..) (..)\]",regex_part)
				{
					StringTrimLeft,c1,parts4,1
					StringTrimRight,c2,parts5,1
					holecardline := "** Dealing down cards **`nDealt to " . PartyName(regex_part1) . " [  " . regex_part2 . " " . regex_part3 . " ]`n"
					continue
				}


				If A_LoopField = *** HOLE CARDS ***
				{
					done_posting := 1
					continue
				}

				If A_LoopField = *** SHOW DOWN ***
				{
					NewStreet()
					showdown := 1
					continue
				}

				If A_LoopField = *** SUMMARY ***
				{
					reached_summary := 1
					continue
				}

				if (SubStr(A_LoopField,1,12) = "*** FLOP ***")
				{
					StringTrimLeft,c1,parts4,1
					c2 := parts5
					StringTrimRight,c3,parts6,1
					actionline .= "** Dealing Flop ** [ " . c1 . ", " . c2 . ", " . c3 . " ]`n"
					NewStreet()
					continue
				}
				if (SubStr(A_LoopField,1,12) = "*** TURN ***")
				{
					StringTrimLeft,c4,parts7,1
					StringTrimRight,c4,c4,1
					actionline .= "** Dealing Turn ** [ " . c4 . " ]`n"
					NewStreet()
					continue
				}
				if (SubStr(A_LoopField,1,13) = "*** RIVER ***")
				{
					StringTrimLeft,c5,parts8,1
					StringTrimRight,c5,c5,1
					actionline .= "** Dealing River ** [ " . c5 . " ]`n"
					NewStreet()
					continue
				}












				if RegExMatch(A_LoopField,"(.*): raises [^\s]* to ([^\s]*)",regex_part)
				{
					name := regex_part1
					seat := FindSeat(name)

					chips_added := regex_part2 - moneyinpot_%seat%
					totalpot += chips_added
					

					if chips_added = % stack_%seat% - moneyinpot_%seat%
					{
						actionline .= PartyName(name) . " is all-In  [" . AddCommas(chips_added) . "]`n"
						allins += 1
					}
					else
						actionline .= PartyName(name) . " raises [" . AddCommas(chips_added) . "]`n"

					moneyinpot_%seat% += chips_added
					continue
				}

				if RegExMatch(A_LoopField,"(.*): bets ([^\s]*)",regex_part)
				{
					name := regex_part1
					seat := FindSeat(name)

					moneyinpot_%seat% += regex_part2
					totalpot += regex_part2
					
					;MsgBox % "Money in pot: " . moneyinpot_%seat% . "`nStack: " . stack_%seat%
					if moneyinpot_%seat% = % stack_%seat%
					{
						actionline .= PartyName(name) . " is all-In  [" . AddCommas(regex_part2) . "]`n"
						allins += 1
					}
					else
						actionline .= PartyName(name) . " bets [" . AddCommas(regex_part2) . "]`n"
					continue
				}

				if RegExMatch(A_LoopField,"(.*) collected .* from pot",regex_part)
				{
					name := regex_part1
					if showdown = 0
					{
						collectline := PartyName(name) . " does not show cards.`n" . PartyName(name) . " wins " . AddCommas(totalpot) . " chips`n"
						ignore_summary := 1
					}
				}

				if reached_summary = 1
				{
					if ignore_summary = 1
						continue


					if RegExMatch(A_LoopField,"^Seat (.*): .* (showed|mucked) \[(..) (..)\]",regex_part)
						showline .= PartyName(player_%regex_part1%) . " shows [ " . regex_part3 . ", " . regex_part4 . " ]`n"


					if RegExMatch(A_LoopField,"^Seat (.*): .* and won \((.*)\)",regex_part)
					{
							totalpot -= regex_part2
							winline .= PartyName(player_%regex_part1%) . " wins " . AddCommas(regex_part2) . " chips`n" 
					}

				}


				;MsgBox Line not recognised:`n'%A_LoopField%'
			}
		}
		else
		{
			if a = 0
			{
				playercount := playercount // 2
				
				position := playercount - actions + 1

				if ante > 0
					blindstring := "Blinds-Antes(" . AddCommas(smallblind) . "/" . AddCommas(bigblind) . " -" . ante . ")"
				else
					blindstring := "Blinds(" . AddCommas(smallblind) . "/" . AddCommas(bigblind) . ")"

				trnyline := "Trny:" . tournament_number . " Level:" . levelnumber . "  " . blindstring . "`n"

				
				header := " Game #" . game_number . " starts.`n`n#Game No : " . game_number . "`n***** Hand History for Game " . game_number . " *****`nNL Texas Hold'em $" . buyin + fee . " USD Buy-in Trny:" . tournament_number . " Level:" . levelnumber . "   " . blindstring . " - " . timestring . "`nTable Speed #" . table_number . " (Real Money)`n"
				
				hand = %header%%buttonline%%stacks%%trnyline%%antestring%%holecardline%%actionline%%collectline%%showline%%winline%
				;hand := header . buttonline . stacks . trnyline . antestring . holecardline . actionline . collectline . showline . winline
				;MsgBox %hand%`n`n%discard_hand%
				;if (discard_hand != 1)
				;	FileAppend,%hand%,%output_folder%\party T%tournament_number%.txt
				;else
				;	FileAppend,%hand%,%output_folder%\discarded hands.txt



				;first hand of file.. see if file already exists
				if CurrentTournament =
				{
					IfExist,%output_folder%\party T%tournament_number%.txt
					{
						old_files += 1
						
						;if modified since starting script do nothing (will append text), probably from a tournament split across 2 files
						FileGetTime,ModifyTime,%output_folder%\party T%tournament_number%.txt
						EnvSub,ModifyTime,%ScriptStartTime%,Seconds
						if ModifyTime < 0
						{
							if overwritefiles = 1
							{
								FileDelete,%output_folder%\party T%tournament_number%.txt
								files_overwritten += 1
							}
							else
							{
								files_kept += 1
								break			;keeping old file, skip to next
							}
						}
					}
				}
				if discard_hand = 0
					CurrentTournament .= hand
				else
					discarded_hands +=  1
			}
			CurrentHand =
			a := 1
		}

		

	}
	FileAppend,%CurrentTournament%,%output_folder%\party T%tournament_number%.txt
}

if usedcommandline = 1
	MsgBox,64,Done! (message box times out in 3 seconds),Read %Tournaments% files.`nSkipped %files_kept% already converted tournaments.`nOverwrote %files_overwritten% files.`nDiscarded %discarded_hands% hands.,3
else
	MsgBox,64,Done!,Read %Tournaments% files.`nSkipped %files_kept% already converted tournaments.`nOverwrote %files_overwritten% files.`nDiscarded %discarded_hands% hands.


GuiClose:
ExitApp


AddCommas(number)
{
	len := StrLen(number)
	out =
	Loop,%len%
	{
		if A_Index > 1
			if mod(A_Index,3) = 1
				out := "," . out
		out := SubStr(number,1 - A_Index,1) . out
	}
	return out
}


FindSeat(findseat_name)
{
	global

	Loop,10
	{
		if player_%A_Index% = %findseat_name%
			return A_Index
	}
}


NewStreet()
{
	global winline


	stacklist =

	highest := 0
	second := 0
	Loop,10
	{
		if moneyinpot_%A_Index% > %highest%
		{
			second := highest
			second_seat := highest_seat
			highest_seat := A_Index
			highest := moneyinpot_%A_Index%
		}
		else if moneyinpot_%A_Index% > %second%
		{
			second := moneyinpot_%A_Index%
			second_seat := A_Index
		}
		
		
	}
	;MsgBox % "Highest: " . player_%highest_seat% . " (" . highest . " invested)`nSecond: " . player_%second_seat% . " (" . second . " invested)`n"
	if highest > %second%
		winline .= PartyName(player_%highest_seat%) . " wins " . AddCommas(highest - second) . " chips`n"
	
	Loop,10
	{
		stack_%A_Index% -= moneyinpot_%A_Index%
		moneyinpot_%A_Index% := 0
		;stacklist .= player%A_Index% . ": " . stack
	}
	

}



PartyName(name)
{
	output := name
	Loop	
		if pos := InStr(output,A_Space)
			output := SubStr(output,1,pos - 1) . SubStr(output,pos + 1)
		else
			break

	return output
}


getlevelnumber(string)
{
	If string = I
		return 1
	else If string = II
		return 2
	else If string = III
		return 3
	else If string = IV
		return 4
	else If string = V
		return 5
	else If string = VI
	 	return 6
	else If string = VII
		return 7
	else If string = VIII
		return 8
	else If string = IX
		return 9
	else If string = X
		return 10
	else If string = XI
		return 11
	else If string = XII
		return 12
}

DayString(day)
{
	if day = 1
		return "Monday"
	if day = 2
		return "Tuesday"
	if day = 3
		return "Wednesday"
	if day = 4
		return "Thursday"
	if day = 5
		return "Friday"
	if day = 6
		return "Saturday"
	if day = 7
		return "Sunday"
}

MonthString(month)
{
	if month = 1
		return "January"
	if month = 2
		return "February"
	if month = 3
		return "March"
	if month = 4
		return "April"
	if month = 5
		return "May"
	if month = 6
		return "June"
	if month = 7
		return "July"
	if month = 8
		return "August"
	if month = 9
		return "September"
	if month = 10
		return "October"
	if month = 11
		return "November"
	if month = 12
		return "December"
}

The two batch files posted by Quietdeath in post #743:

RunFTP_supTurbo_9man_3s.bat:
Code:
@echo off

echo Converting FTP hands to Party hands.
mkdir TempConvertedStarsHands 2> NUL
del /Q .\TempConvertedStarsHands\*.txt 2> NUL
ftpconverter.exe .\TempConvertedStarsHands .

echo Running on all 9-man FTP hands found in the TempConvertedStarsHands folder...

rem For Super Turbo 3.8s we pay 12.063492063492063492063492063492% of the final prize-pool as our entry fee.
BackTestAllInLuck.exe 12.063492063492063492063492063492 50 30 20 TempConvertedStarsHands

pause
RunFTP_supTurbo_9man_7s.bat:
Code:
@echo off

echo Converting FTP hands to Party hands.
mkdir TempConvertedStarsHands 2> NUL
del /Q .\TempConvertedStarsHands\*.txt 2> NUL
ftpconverter.exe .\TempConvertedStarsHands .

echo Running on all 9-man FTP hands found in the TempConvertedStarsHands folder...

rem For Super Turbo 7.5s we pay 11.904761904761904761904761904762% of the final prize-pool as our entry fee.
BackTestAllInLuck.exe 11.904761904761904761904761904762 50 30 20 TempConvertedStarsHands

pause

The new FTP converter posted by Jax in post #757: http://rapidshare.com/files/14388892...erter.exe.html

(if possible can you post your source AHK script, as I'm going to have to use the EXE2AHK on this and it'll lose all the comments otherwise).


Has anybody else posted any other example batch files that I've missed and are these the correct (most recent) versions of the scripts?

Juk
jukofyork is offline   Reply With Quote
Old 09-12-2008, 07:30 AM   #762
sad panda
 
jukofyork's Avatar
 
Join Date: Sep 2004
Location: United Federation of Nit-Farmers.
Posts: 9,406
Post Version 1.03 of Juk's BackTestAllInLuck released

New for version 1.03
1. The new code can now handle any all-in situation (including 4-way [or more] and postflop all-ins).
2. The updated FTP conversion script should now reject fewer SNGs than it did before and should now work with the new "super turbo" format.
3. The updated Stars conversion script should now work with Stars' new hand history format.
4. People using a non-English locale in Windows should no longer suffer from the "Could not get day of week" problem when using either conversion script.
5. A small bug that effected 2-way all-ins involving a side-pot has been fixed (was very rare occurrence anyway and hardly had any effect...).

Credits for version 1.03
1. Thanks to Jax for the new FTP conversion script (and thanks to Gnumsploitz and Excedrin who originally worked on the FTP script).
2. Thanks to k4b4l for updating the PokerStars conversion script (and thanks to dave_w11 who originally created the Stars script).
3. Thanks to Quietdeath for providing two example batch files for working with FTP's "super turbo" SNGs.
4. Thanks to Steve Brecher for providing his hand evaluation code copyright free.

Notes for version 1.03
1. The first time you run the code it will take longer as it has to converted the 2-way and 3-way lookups from the sparse format into the non-sparse binary format. After this initial conversion, the code will run at full speed.
2. The current code uses Monte Carlo simulation for anything but 2-way and 3-way preflop all-ins. This will mean the results are not exactly the same each time you run it, but overall this should have very little effect. I will fix this to use full enumeration in a future version.
3. As before I have provided the source code required to understand how my algorithm works (see "BackTestAllInLuck.h" and "hand_outcome_generator.h"), but have not released all of the source code required to build the rest of the application (to stop bot writers and real-time helper writers from misusing the rest of the code...). As a result of not being able to release the full source, I have not been bale to use the GNU pokersrc library and have had to modify a version of Steve Brecher's evaluator which can be used in place of pokersrc. If you look at the file "SteveBrecherHandEval.h" then you will see what I did (it may also be useful for others who run into similar problems with the GNU licence...).

The new version of the code can be downloaded from here: Juks_BackTestAllInLuck_v1_03.rar

Any problems to do with BackTestAllInLuck.exe then please contact me.

Any problems to do with the FTP or Stars converter then please contact the relevant script writer (I don't know anything about these I'm afraid, so can't help with problems, etc).

Juk

PS: Custom "Entry Fee Percentage" reminder

Entry Fee Percentage = (Amount Paid To Enter / Total Prize Pool) * 100

Example 1) Party 10-man 22s : (22 / 200) * 100 = 11%
Example 2) FTP 9-man 12s : (12 / 99) * 100 = 12.12121212%
Example 3) Stars 9-man 16s : (16 / 135) * 100 = 11.85185185%
jukofyork is offline   Reply With Quote
Old 09-12-2008, 12:50 PM   #763
Jax
newbie
 
Join Date: Sep 2006
Location: Sydney Australia
Posts: 44
Re: SnG Luck Analyzer (Beta)

Thanks for the new pack Juk.
Here is a new thing, a gui for the allin-luck evaluator
This is the first cut, there is probably a few bugs.

To test this do the following.
1. Download Juk's .rar from previous post
2. download this http://rapidshare.com/files/14470945...algui.exe.html and copy it in the same folder as BackTestAllInLuck.exe
3. Do a command prompt and run luckevalgui.exe
4. Change folders if necessary
5. Click on Read_HH
6. If the parameters appear correct, click on Run
7. If not correct manually adjust, Click on Re-Calc and click on Run


The gui will pick the 1st hand in the folder you selected and will attempt to extract all the information needed, since the Party hand do not specify the Fee you will have to adjust the Buyin and Fee for the Party HH.

I strongly recommend that you use my script hhsorter.exe I posted a few days ago prior to using the luckevalgui.exe, the hhsorter will filter some of the invalid hh files and ensure that the buyins are consistent.

Pls report any problems on the forum

Cheers

Jax
Jax is offline   Reply With Quote
Old 09-12-2008, 02:47 PM   #764
Carpal \'Tunnel
 
Gazillion's Avatar
 
Join Date: Feb 2008
Location: volume failing
Posts: 8,659
Re: SnG Luck Analyzer (Beta)

Jax, I'm getting an error when running this. It stops at line 133. Erro: specifically, the system cannot find the file specified.

Am I doing something really dumb? I have pointed the "in" path to where my source HH's are, and I have left the default "out" path to "Temp Hands"
Gazillion is offline   Reply With Quote
Old 09-12-2008, 02:54 PM   #765
centurion
 
MsC0inflip's Avatar
 
Join Date: Oct 2006
Posts: 183
Re: SnG Luck Analyzer (Beta)

Thanks for the new version.
With the previous one I was -72 buyins in $EV luck over last 560 tourneys.
Now I'm - 84 buyins over those same tourneys.
MsC0inflip is offline   Reply With Quote

Reply
      

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -4. The time now is 04:02 PM.


Powered by vBulletin®
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.6.0 ©2011, Crawlability, Inc.
Copyright © 2008-2010, Two Plus Two Interactive