Getting holecards from holdem_hand_player_detail

Forum for users that want to write their own custom queries against the PT database either via the Structured Query Language (SQL) or using the PT3 custom stats/reports interface.

Moderator: Moderators

Getting holecards from holdem_hand_player_detail

Postby n1mda » Mon Mar 08, 2010 7:44 am

Hi!

I'm trying to get the actual holecards from a given player in a hand, but holecard_1 and holecard_2 both returns integers that are mapped to an actual holecard, where can I find the conversion table for these hands?

I want the actual cards, not their PT3 integers.
n1mda
 
Posts: 3
Joined: Mon Mar 08, 2010 7:38 am

Re: Getting holecards from holdem_hand_player_detail

Postby WhiteRider » Mon Mar 08, 2010 8:39 am

It depends exactly what you're trying to do, but have a look at how the card stats in the Holdem Cash Hand section are built, and in particular the Format Expression which uses lookups to get the card information. e.g. Stats: Hand, Hole1, Hole2.

I wrote a post about the database values which store hole cards:
viewtopic.php?f=18&t=11876#p55492
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: Getting holecards from holdem_hand_player_detail

Postby n1mda » Mon Mar 08, 2010 10:28 am

I'm not using the gui, but my own program to get the hands. How does the lookup_from_id() function work. Is it only available in custom reports?

Thank you for the lookup values, I guess I will have to write them myself as a lookuptable.
n1mda
 
Posts: 3
Joined: Mon Mar 08, 2010 7:38 am

Re: Getting holecards from holdem_hand_player_detail

Postby WhiteRider » Mon Mar 08, 2010 11:05 am

I'm not sure how the lookup_from_id function works - I suspect it is an internal PT3 function, though.
You might find the lookup_hole_cards table in the database useful if you want pairs of cards.
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: Getting holecards from holdem_hand_player_detail

Postby n1mda » Mon Mar 08, 2010 11:14 am

I created an array of the cards that I can access like this:

Code: Select all
const char *cardArray[52] = {
   "2c", "3c", "4c", "5c", "6c", "7c", "8c", "9c", "Tc", "Jc", "Qc", "Kc", "Ac",
   "2d", "3d", "4d", "5d", "6d", "7d", "8d", "9d", "Td", "Jd", "Qd", "Kd", "Ad",
   "2h", "3h", "4h", "5h", "6h", "7h", "8h", "9h", "Th", "Jh", "Qh", "Kh", "Ah",
   "2s", "3s", "4s", "5s", "6s", "7s", "8s", "9s", "Ts", "Js", "Qs", "Ks", "As"
};

card = cardArray[holdem_hand_player_detail.holecard_x -1 ]
n1mda
 
Posts: 3
Joined: Mon Mar 08, 2010 7:38 am

Re: Getting holecards from holdem_hand_player_detail

Postby WhiteRider » Mon Mar 08, 2010 1:36 pm

Cool.
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK


Return to Custom Stats, Reports, and SQL [Read Only]

Who is online

Users browsing this forum: No registered users and 0 guests