#31
|
|||
|
|||
Re: Sklansky bucks calculator (php script)
Devil,
Yes, it does. Wildzer, nice script. I didn't realize php was that powerful for local programming. |
#32
|
|||
|
|||
Re: Sklansky bucks calculator (php script)
[ QUOTE ]
I'm working on adding pokenum. I have all of the source code, I just need to compile it on Windows [/ QUOTE ] it's somewhere 4 download, not sure exactly where http://download.gna.org/pokersource/...eval/examples/ |
#33
|
|||
|
|||
Re: Sklansky bucks calculator (php script)
[ QUOTE ]
[ QUOTE ] I'm working on adding pokenum. I have all of the source code, I just need to compile it on Windows [/ QUOTE ] it's somewhere 4 download, not sure exactly where http://download.gna.org/pokersource/...eval/examples/ [/ QUOTE ] Great find. I've been scouring all of these directories and couldnt find the executible anywhere! This should save me some time... |
#34
|
|||
|
|||
Re: Sklansky bucks calculator (php script)
[ QUOTE ]
[ QUOTE ] I'm working on adding pokenum. I have all of the source code, I just need to compile it on Windows [/ QUOTE ] it's somewhere 4 download, not sure exactly where http://download.gna.org/pokersource/...eval/examples/ [/ QUOTE ] holy crap! I must've looked for that .exe file for hours. nice find ! This script's pretty much a piece of cake to run now. |
#35
|
|||
|
|||
Re: Sklansky bucks calculator (php script)
Finished product?
|
#36
|
|||
|
|||
Re: Sklansky bucks calculator (php script)
[ QUOTE ]
[ QUOTE ] [ QUOTE ] I'm working on adding pokenum. I have all of the source code, I just need to compile it on Windows [/ QUOTE ] it's somewhere 4 download, not sure exactly where http://download.gna.org/pokersource/...eval/examples/ [/ QUOTE ] holy crap! I must've looked for that .exe file for hours. nice find ! This script's pretty much a piece of cake to run now. [/ QUOTE ] Help! I've downloaded php and copied that script into notepad and renamed it luck.php. Then opened the php program and put the location of luck.php into it. Nothing happens. Just moves onto the next line. Now on my desktop the notepad file is now a php file, but when I double click it in opens php for a second and then closes without "spitting out" any info. Any idea where I'm going wrong. This is an excellent idea btw. Respect. |
#37
|
|||
|
|||
Re: Sklansky bucks calculator (php script)
sounds like you've gotten reasonably far! Here's a quick tutorial that I hope everyone can use.
1. Go to http://www.apachefriends.org/en/xampp.html and download the windows installer. This is just an easy way to install php on your system. 2. Go to http://download.gna.org/pokersource/...eval/examples/ and download pokenum.exe 3. Copy the script I'm about to paste below into a text document, call it luck.php (keep it in the same folder as pokenum.exe). 4. Open up luck.php in notepad and change the variables at the top to match your settings (there are notes in the file to walk you through it, it's easy. 5. Open up your windows command line, easiest way is to go to Start->run and type "cmd" 6. cd to the directory where luck.php and pokenum are 7. type: "c:\Program Files\xampp\php\php.exe" luck.php" 8. Wait for it to finish (could take a while) 9. Bask in the glory of your earned Sklansky bucks. |
#38
|
|||
|
|||
Re: Sklansky bucks calculator (php script)
Here's a version of the script with a quick change to make it easier to use on windows systems. If you're on windows, use this instead of the code I pasted above.
[ 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 = "sceenname"; //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-01"; //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.exe -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" . $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 ] |
#39
|
|||
|
|||
Re: Sklansky bucks calculator (php script)
Anyone getting this to work?
I followed all the steps above and edited the screen name, stake, date and password. I also put the pokenum.exe in the same directory as the luck.php script. This is what I get with the script for Linux and the recently posted one for Windows: Fatal error: Call to undefinded function pg_connect() in C:\path\luck.php on line 32 |
#40
|
|||
|
|||
Re: Sklansky bucks calculator (php script)
[ QUOTE ]
Anyone getting this to work? I followed all the steps above and edited the screen name, stake, date and password. I also put the pokenum.exe in the same directory as the luck.php script. This is what I get with the script for Linux and the recently posted one for Windows: Fatal error: Call to undefinded function pg_connect() in C:\path\luck.php on line 32 [/ QUOTE ] Almost there! I forgot that postgres support is disabled in xampp by default. This is easy. 1. Open up c:\Program Files\xampp\php\php.ini in notepad or something similar. 2. Search for this line: [ QUOTE ] extension=php_pdo_pgsql.dll [/ QUOTE ] 3. Delete the semicolon at the beginning of the line. 4. Do the same thing for this line: [ QUOTE ] extension=php_pgsql.dll [/ QUOTE ] 5. Save the file. |
|
|