Thread: PT Help please
View Single Post
  #4  
Old 09-15-2005, 07:25 PM
DavidC DavidC is offline
Senior Member
 
Join Date: Aug 2004
Location: Ontario, Canada
Posts: 292
Default Re: PT Help please

Hey man... just thought I'd put in an update here.

I ran your script: very cool by the way. It's been a long time since I looked at code.

For games between 4 and 5 players, I had about 40% raked [img]/images/graemlins/frown.gif[/img].

This might actually be a good thing if you're playing more hands per hour there, though.

However, when I ran the filter in PT it gave me something like 2400 hands, and your script gave me 2800 hands. All my observed hands are going into another DB rather than the one specified in the script, so I'm a little weirded out by it, but that's not so bad... Maybe it's counting hands where I'm sitting out... this is pretty common for me as I come and go through tables quickly.

---

I wish I knew more about javascript. [img]/images/graemlins/frown.gif[/img]

Maybe it's possible that if players were posting incomplete blinds that it didn't show up as a 2/4 game or something...

------------------------------------------------

I edited the script a bit, and please don't take offense. I'm a pretty bad programmer so I "personalized" the variables section of the code, and I don't know how to write a function in javascript, so I cut-and-pasted (!)... but here's what I adapted the script to. I couldn't have done it without the basic framework and the sql queries. Thanks.

(I'm officially a script-kiddie now.)

-----------

///// change settings here /////
var minrake = 0.01;
var players = 2;
var level = '$2/$4';
var ptdb = 'ptrack11';
////////////////////////////////

///// Globals /////////
var db = new ActiveXObject("ADODB.Recordset");
var cstring = "Driver={Microsoft Access Driver (*.mdb)};DBQ="+ptdb+".mdb";
var totalhands = 0;
var rakedhands = 0;
var sql = '';
var echoout = "Game Level:\t\t" + level + "\n--------------------";
var pcnt = 0;
//////////////////////


/// 2 players

sql = "SELECT Count(game.game_id) AS Hands FROM game"
+ " WHERE game.number_of_players = " + players
+ " AND game.game_level_id=(SELECT game_level_id FROM game_level"
+ " WHERE game_level_desc='"+level+"');"
db.Open(sql, cstring, 1, 3);
totalhands = db(0)+0;
db.Close();

sql = "SELECT Count(game.game_id) AS Hands FROM game"
+ " WHERE game.number_of_players = " + players
+ " AND game.rake > " + minrake
+ " AND game.game_level_id=(SELECT game_level_id FROM game_level"
+ " WHERE game_level_desc='"+level+"');"
db.Open(sql, cstring, 1, 3);
rakedhands = db(0)+0;
db.Close();

pcnt = Math.round(rakedhands / totalhands * 10000)/100;

echoout = echoout
+ "\n\nPlayers:\t\t\t" + players
+ "\nNumber of Hands:\t\t" + totalhands
+ "\nraked hands:\t\t" + rakedhands
+ "\nraked percent:\t\t"+ pcnt + "%";

players++;

/// 3 players

sql = "SELECT Count(game.game_id) AS Hands FROM game"
+ " WHERE game.number_of_players = " + players
+ " AND game.game_level_id=(SELECT game_level_id FROM game_level"
+ " WHERE game_level_desc='"+level+"');"
db.Open(sql, cstring, 1, 3);
totalhands = db(0)+0;
db.Close();

sql = "SELECT Count(game.game_id) AS Hands FROM game"
+ " WHERE game.number_of_players = " + players
+ " AND game.rake > " + minrake
+ " AND game.game_level_id=(SELECT game_level_id FROM game_level"
+ " WHERE game_level_desc='"+level+"');"
db.Open(sql, cstring, 1, 3);
rakedhands = db(0)+0;
db.Close();

pcnt = Math.round(rakedhands / totalhands * 10000)/100;

echoout = echoout
+ "\n\nPlayers:\t\t\t" + players
+ "\nNumber of Hands:\t\t" + totalhands
+ "\nraked hands:\t\t" + rakedhands
+ "\nraked percent:\t\t"+ pcnt + "%";

players++;

/// 4 players

sql = "SELECT Count(game.game_id) AS Hands FROM game"
+ " WHERE game.number_of_players = " + players
+ " AND game.game_level_id=(SELECT game_level_id FROM game_level"
+ " WHERE game_level_desc='"+level+"');"
db.Open(sql, cstring, 1, 3);
totalhands = db(0)+0;
db.Close();

sql = "SELECT Count(game.game_id) AS Hands FROM game"
+ " WHERE game.number_of_players = " + players
+ " AND game.rake > " + minrake
+ " AND game.game_level_id=(SELECT game_level_id FROM game_level"
+ " WHERE game_level_desc='"+level+"');"
db.Open(sql, cstring, 1, 3);
rakedhands = db(0)+0;
db.Close();

pcnt = Math.round(rakedhands / totalhands * 10000)/100;

echoout = echoout
+ "\n\nPlayers:\t\t\t" + players
+ "\nNumber of Hands:\t\t" + totalhands
+ "\nraked hands:\t\t" + rakedhands
+ "\nraked percent:\t\t"+ pcnt + "%";

players++;

/// 5 players

sql = "SELECT Count(game.game_id) AS Hands FROM game"
+ " WHERE game.number_of_players = " + players
+ " AND game.game_level_id=(SELECT game_level_id FROM game_level"
+ " WHERE game_level_desc='"+level+"');"
db.Open(sql, cstring, 1, 3);
totalhands = db(0)+0;
db.Close();

sql = "SELECT Count(game.game_id) AS Hands FROM game"
+ " WHERE game.number_of_players = " + players
+ " AND game.rake > " + minrake
+ " AND game.game_level_id=(SELECT game_level_id FROM game_level"
+ " WHERE game_level_desc='"+level+"');"
db.Open(sql, cstring, 1, 3);
rakedhands = db(0)+0;
db.Close();

pcnt = Math.round(rakedhands / totalhands * 10000)/100;

echoout = echoout
+ "\n\nPlayers:\t\t\t" + players
+ "\nNumber of Hands:\t\t" + totalhands
+ "\nraked hands:\t\t" + rakedhands
+ "\nraked percent:\t\t"+ pcnt + "%";

players++;

/// 6 players

sql = "SELECT Count(game.game_id) AS Hands FROM game"
+ " WHERE game.number_of_players = " + players
+ " AND game.game_level_id=(SELECT game_level_id FROM game_level"
+ " WHERE game_level_desc='"+level+"');"
db.Open(sql, cstring, 1, 3);
totalhands = db(0)+0;
db.Close();

sql = "SELECT Count(game.game_id) AS Hands FROM game"
+ " WHERE game.number_of_players = " + players
+ " AND game.rake > " + minrake
+ " AND game.game_level_id=(SELECT game_level_id FROM game_level"
+ " WHERE game_level_desc='"+level+"');"
db.Open(sql, cstring, 1, 3);
rakedhands = db(0)+0;
db.Close();

pcnt = Math.round(rakedhands / totalhands * 10000)/100;

echoout = echoout
+ "\n\nPlayers:\t\t\t" + players
+ "\nNumber of Hands:\t\t" + totalhands
+ "\nraked hands:\t\t" + rakedhands
+ "\nraked percent:\t\t"+ pcnt + "%";

WScript.Echo(echoout);

======================================

Results:

2 / 229 / 58 / 25.33%
3 / 566 / 177 / 31.27%
4 / 1109 / 395 / 35.62%
5 / 1782 / 782 / 43.88%
6 / 2671 / 1246 / 46.65%
Reply With Quote