#21
|
|||
|
|||
Re: Sklansky bucks calculator (php script)
OK, got a little help from _dave_, posting this thing in a little bit. I'll warn you guys know, it's completely non-user friendly, and it only works for all in hands, but it'll work until Phil's comes out [img]/images/graemlins/smile.gif[/img]
|
#22
|
|||
|
|||
Re: Sklansky bucks calculator (php script)
Post it!
|
#23
|
|||
|
|||
Re: Sklansky bucks calculator (php script)
Yeah, I've actually found it most useful for loading up after each session. Sometimes you think you played great and discover you barely made SB. It really made me think about my game, the short term swings in this game are amazing.
Just a note: I was releasing on April 7th but just realized the forums will be down that day due to the upgrade. I'll be away on Sunday, so I'm going to realease it on the 10th instead so I can deal with problems right away (there are always problems when putting out new software) [img]/images/graemlins/smile.gif[/img] Thanks for the PMs of interest. |
#24
|
|||
|
|||
Re: Sklansky bucks calculator (php script)
OK, here it is. Hopefully it'll be of help to someone. Instructions for getting php running are below, you'll also need a copy of pokenum (it's free) running on you system. I really have no idea how to get it running on windows, but you need it in your system path. Hopefully someone who knows more about it than I do can post a short tutorial on how to do that on windows.
It'll probably a pain in the ass for people to get running, I'll say that right now, but it does work. If anyone generous person out there feels like hosting this, that could make things easier for people too. [ QUOTE ] <?php /* ok, to use this script you need php installed. The easiest way to do this is to go to http://www.apachefriends.org/en/xampp.html and download the windows installer. Instant php! Now you just need to edit the variables below (above the big line). Save this as luck.php You can use the windows command line to run this script then. Just go to start->run and type in cmd. When the windows comes up, type c:\Program Files\xampp\php\php.exe c:\path\to\luck.php It'll spit out 3 numbers. The first number is the amount you won. The 2nd number is the amount you "should have" one (sklansky bucks or whatever). The 3rd number is the total amount of money you put into these pots. */ //put your pokersite screen name here $screen_name = "screenname"; //put the stake string here (just edit the dollar amounts to match your stake $stake_string = "($1.00/$2.00)"; //this is the date to begin with in pokertracker, it'll go from this date to the present. $since_date = "2007-04-04"; //connection info - put all your postgres pt db connection info into these variables. $db_name = "PTPGSQL1"; $host = "localhost"; $user = "postgres"; $password = "password"; //***************************************DON'T EDIT BELOW THIS POINT********************************* $conn_string = "dbname=" . $db_name ." host=" . $host . " user=" . $user . " password=" . $password; $conn = pg_connect($conn_string); if(!$conn) { echo("there was an error\n"); } $query = "select hh.hand_history, gp.hole_card_1, gp.hole_card_2, gp2.hole_card_1, gp2.hole_card_2, g.flop_1, g.flop_2, g.flop_3, g.turn, g.river, gp.pre_flop_bet, gp.flop_bet, gp.turn_bet, gp.river_bet, gp.won_hand, g.pot, gp.total_won, g.game_number, gp.total_bet from game g join hand_histories hh on g.game_number = hh.game_number join game_players gp on g.game_id = gp.game_id join game_players gp2 on g.game_id = gp2.game_id join players p on p.player_id = gp.player_id join players p2 on p2.player_id = gp2.player_id where p.screen_name = '" . $screen_name . "' and p2.screen_name != '" . $screen_name . "' and (gp.pre_flop_bet + gp.flop_bet + gp.turn_bet + gp.river_bet >= gp.chip_count or gp2.pre_flop_bet + gp2.flop_bet + gp2.turn_bet + gp2.river_bet >= gp2.chip_count) and gp2.went_to_showdown_n = 1 and gp.went_to_showdown_n = 1 and g.date_played >= '" . $since_date . "' and hh.hand_history like '%" . $stake_string . "%' order by g.game_number"; $result = pg_query ($conn, $query); if(!$result) { echo("An error occured.\n"); } $a = 0; while($row = pg_fetch_row($result)) { if($last_game_number == $row[17]) { // echo("\n skipping " . $last_game_number); } else { $a++; $hh = $row[0]; $my_hole_card_1 = $row[1]; $my_hole_card_2 = $row[2]; $v_hole_card_1 = $row[3]; $v_hole_card_2 = $row[4]; $flop_1 = $row[5]; $flop_2 = $row[6]; $flop_3 = $row[7]; $turn = $row[8]; $river = $row[9]; $pre_flop_bet = $row[10]; $flop_bet = $row[11]; $turn_bet = $row[12]; $river_bet = $row[13]; $i_won_hand = $row[14]; $pot = $row[15]; $total_won = $row[16]; $last_game_number = $row[17]; $total_bet = $row[18]; $exec_string = "pokenum -h " . $my_hole_card_1 . " " . $my_hole_card_2 . " - " . $v_hole_card_1 . " " . $v_hole_card_2; if($flop_bet > 0 || $turn_bet > 0 || $river_bet > 0) { $exec_string .= " -- " . $flop_1 . " " . $flop_2 . " " . $flop_3; } if($turn_bet >0 || $river_bet > 0) { $exec_string .= " " . $turn; } if($river_bet > 0) { $exec_string .= " " . $river; } unset($pokenum_output); exec($exec_string, $pokenum_output); unset($new_arr); $line_arr = explode(" ", $pokenum_output[2]); $arr_count = 0; for($i=1;$i<count($line_arr);$i++) { if(!$line_arr[$i] == "") { $new_arr[$arr_count] = $line_arr[$i]; $arr_count++; } } $sizeof_arr = sizeof($new_arr) - 1; $ev = $new_arr[$sizeof_arr]; $equity = $ev * $pot; $all_won += $total_won; $all_equity += $equity; $all_bet += $total_bet; $total_ev += $ev; echo("\n" . $exec_string ." "); echo($ev); } } echo("\n" . $a . " hands played with an average ev of " . $total_ev / $a); echo("\nwon: " . $all_won); echo("\nequity: " . $all_equity); echo("\n total bet: " . $all_bet . "\n"); ?> [/ QUOTE ] |
#25
|
|||
|
|||
Re: Sklansky bucks calculator (php script)
[ QUOTE ]
Yeah, I've actually found it most useful for loading up after each session. Sometimes you think you played great and discover you barely made SB. It really made me think about my game, the short term swings in this game are amazing. Just a note: I was releasing on April 7th but just realized the forums will be down that day due to the upgrade. I'll be away on Sunday, so I'm going to realease it on the 10th instead so I can deal with problems right away (there are always problems when putting out new software) [img]/images/graemlins/smile.gif[/img] Thanks for the PMs of interest. [/ QUOTE ] Yeah, of course the numbers converge after a while, but I love this tool for evaluating individual sessions. I never set it up for more than a week at a time. The other thing I love about my script (can't speak for yours yet, but I can't wait to check it out!) is the ability to see how much you bet vs the amount of equity you had. Really helpful for identifying those sessions when you weren't playing at the top of your game |
#26
|
|||
|
|||
Re: Sklansky bucks calculator (php script)
Also, I'll probably be of limited help in supporting this, but feel free to PM me anyway, and I'll do what I can.
|
#27
|
|||
|
|||
Re: Sklansky bucks calculator (php script)
Soooooo, anyone with a pokenum walkthrough? I cant even find it through google.
|
#28
|
|||
|
|||
Re: Sklansky bucks calculator (php script)
Yeah, sorry I can't be more helpful with that part. I got it running on linux with a fair amount of difficulty, I know it works on windows, and there may even be a pokenum.exe file floating out there.
|
#29
|
|||
|
|||
Re: Sklansky bucks calculator (php script)
Phil,
Will your program support Omaha high? |
#30
|
|||
|
|||
Re: Sklansky bucks calculator (php script)
I'm working on adding pokenum. I have all of the source code, I just need to compile it on Windows. Having a little difficulty since I'm not using Vista. I'm not sure how much time I'll have either, as I have a ton of stuff going on in my life right now and have very little free time.
|
|
|