#1
|
|||
|
|||
GameTime Plus and Average Pot Size
I've never been able to figure out how to show average pot sizes for a room with GT+ so I took a few minutes and wrote this Win32 perl script that I put in the same directory as my hand histories and let it calculate the average pot size for me so I don't have to find my table in the party table list to see if my table's avg pot size has gone way down from when I sat down. It works with ActivePerl for Windows. You can do whatever you want with it. It seems to work ok on Party Hands.
Put it in the same dir as your hand histories and run: perl avgpot.pl <sleep time> e.g. to process hands every 5 minutes-> perl avgpot.pl 5 It won't process hand history files that haven't changed within the sleep interval. I'm not a programmer or anything so it may not be that well written but it may be of some use. #AVG POT Calculator for use with Poker $DEBUG=1; $forever=1; use Win32::File; use Cwd 'abs_path'; use File::stat; $workdir = abs_path(); system("cls"); print "\n\n"; do { print "Working Directory: \n$workdir\n"; if ($ARGV[0] ne '') { #lets convert CLI argument to seconds $sleep_time=$ARGV[0] * 60; opendir(DIR,"."); @files = readdir(DIR); closedir(DIR); foreach $file_temp (@files) { $total_wins=0; $total_won=0; next if ($file_temp eq "."); next if ($file_temp eq ".."); next if ($file_temp eq "avgpot.pl" || $file_temp eq "avgpot.pl.bak"); Win32::File::GetAttributes($file_temp, $attr); next if ($attr ne 32); $stats = stat($file_temp); $modified_time=$stats->mtime; if ($hash{$file_temp} != $modified_time) {$file_changed=1;} else {$file_changed=0;} $hash{ $file_temp } = $modified_time; #print $hash{$file_temp}; if ($file_changed) { #open file open(list, $file_temp) or die "an error occured: $!"; @file_contents=<list>; close (list); foreach $temp_contents (@file_contents) { if ($temp_contents =~ /Table Table/) { $table = $temp_contents; } if ($temp_contents =~ /wins \$/) { @wins_temp = split(/\$/, $temp_contents); @pot = split(/ /,@wins_temp[1]); chomp(@pot[0]); $cash_won=@pot[0]; $total_won = $total_won + $cash_won; ++$total_wins; } } #next file in dir if ($total_wins != 0) {$table_pot_avg = $total_won / $total_wins;} $table_pot_avg = sprintf("%.2f", $table_pot_avg); #fix up table name $table_name_len=length($table); $table=substr($table,6,$table_name_len); if ($total_wins != 0) {print "\n$table";} if ($total_wins != 0) {printf "AVG POT = \$$table_pot_avg on the last $total_wins hands\n";} } } #no more files print "\n\nWaiting for $ARGV[0] minutes to check for changed files...\n"; sleep($sleep_time); system("cls"); } else { #no arg entered...print syntax print "\n\nSyntax: perl avgpot.pl <timer>\n"; #halt script $forever=0; } }while ($forever); |
#2
|
|||
|
|||
Re: GameTime Plus and Average Pot Size
????? explain
|
#3
|
|||
|
|||
Re: GameTime Plus and Average Pot Size
I just like seeing the average pot size for each table I'm at and GameTime+ doesn't show this (that I can see). here's an example of the output after running perl avgpot.pl 5:
Working Directory: D:/Program Files/PartyPoker/HandHistory/lockenvar/20050611 Table 32753 (Real Money) AVG POT = $17.87 on the last 157 hands Table 32176 (Real Money) AVG POT = $22.38 on the last 75 hands Table 32178 (Real Money) AVG POT = $21.69 on the last 160 hands Waiting for 5 minutes to check for changed files... BTW...I tweaked it up a bit more and here is the result: #AVG POT Calculator for use with Poker $DEBUG=0; $forever=1; use Win32::File; use Cwd 'abs_path'; use File::stat; $workdir = abs_path(); system("cls"); print "\n\n"; do { print "Working Directory: \n$workdir\n"; if ($ARGV[0] ne '') { #lets convert CLI argument to seconds $sleep_time=$ARGV[0] * 60; opendir(DIR,"."); @files = readdir(DIR); closedir(DIR); foreach $file_temp (@files) { $total_wins=0; $total_won=0; next if ($file_temp eq "."); next if ($file_temp eq ".."); next if ($file_temp eq "avgpot.pl" || $file_temp eq "avgpot.pl.bak"); Win32::File::GetAttributes($file_temp, $attr); next if ($attr ne 32); $stats = stat($file_temp); $modified_time=$stats->mtime; if ($hash{$file_temp} != $modified_time) {$file_changed=1;} else {$file_changed=0;} $hash{ $file_temp } = $modified_time; #print $hash{$file_temp}; if ($file_changed) { #open file open(list, $file_temp) or die "an error occured: $!"; @file_contents=<list>; close (list); foreach $temp_contents (@file_contents) { if ($temp_contents =~ /Table Table/) { $table = $temp_contents; } if ($temp_contents =~ /wins \$/ && $temp_contents !~ /The Progressive Bad Beat Jackpot has been hit/) { @wins_temp = split(/\$/, $temp_contents); @pot = split(/ /,@wins_temp[1]); chomp(@pot[0]); $cash_won=@pot[0]; $total_won = $total_won + $cash_won; ++$total_wins; if ($DEBUG==1) {print "$cash_won\t$total_wins\n";} } } #next file in dir if ($total_wins != 0) {$table_pot_avg = $total_won / $total_wins;} $table_pot_avg = sprintf("%.2f", $table_pot_avg); #fix up table name $table_name_len=length($table); $table=substr($table,6,$table_name_len); if ($total_wins != 0) {print "\n$table";} if ($total_wins != 0) {printf "AVG POT = \$$table_pot_avg on the last $total_wins hands\n";} } } #no more files print "\n\nWaiting for $ARGV[0] minutes to check for changed files...\n"; sleep($sleep_time); system("cls"); } else { #no arg entered...print syntax print "\n\nSyntax: perl avgpot.pl <timer>\n"; #halt script $forever=0; } }while ($forever); |
|
|