SQL to read/write custom variables

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

SQL to read/write custom variables

Postby mtagliaf » Thu Dec 04, 2008 10:31 am

I have created a new variable under "Holdem Tournament Player Statistics". Say the name of the variable is "Fred", and its expression is "99". I have also created the corresponding Statistic for this variable, and added it to my HUD.

I now want to be able to update this custom statistic from an outside program, using an ODBC connection, and SQL. How/where are the custom variables stored in the database? What SQL command would I issue for a player named "taglius", to update this new variable "Fred" so that its value is "4", for example?

I have been browsing the PT3 Postgres database, but I don't see the table where custom variables are kept.

thanks
mtagliaf
 
Posts: 45
Joined: Tue Feb 12, 2008 10:30 pm

Re: SQL to read/write custom variables

Postby kraada » Thu Dec 04, 2008 11:05 am

Custom statistics are actually kept in the StatsDefititionsCustomized.pt3 file, located in C:\Program Files\PokerTracker 3\Data\ directory. As far as I'm aware, the file is encrypted and there is no easy way to edit it.

Why not just edit it within PT3?
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: SQL to read/write custom variables

Postby mtagliaf » Thu Dec 04, 2008 11:20 am

kraada wrote:Custom statistics are actually kept in the StatsDefititionsCustomized.pt3 file, located in C:\Program Files\PokerTracker 3\Data\ directory. As far as I'm aware, the file is encrypted and there is no easy way to edit it.

Why not just edit it within PT3?


I'm trying to merge the worlds of PokerTracker and Sharkscope into a single glorious HUD. Here's what I do today:

When a tourney starts, I use Sharkscope to lookup all of the players in the tourney. I then create a "Player Note" in the FullTilt client that tells me how many tourneys they played, and their ROI. I also use the Fulltilt custom color to designate if they're "Good", "Bad", "Average", or "Not enough tourneys to tell".

This is a manual process. I have to right click on every player name, type in the sharkscope info, and set the color. It takes about a minute to do. If I'm only playing one tourney, this is ok, but once I start the second, third, etc tourney, it becomes difficult to find the time to get all of this info into the notes.

What I would like to do is write a program that will let me copy the sharkscope data into the clipboard (one single CTRL-C for all players at the table), and then paste it into my program. My program will parse out the player name/tourneys/ROI out of the HTML, and then punch it into the PokerTracker database using the custom variables that I created. Finally, I will configure the HUD to display those variables, along with custom coloring.

Fantastic, huh?

Can you think of any way I could do this? I tried creating a "column" instead of a "variable", but I couldn't think of a way to create a static column of information that I could overwrite later. Can you think of a way to do this?

Or, alternately, is there a way to display the player "notes" in the HUD? I could create a custom sharkscope note for each player. This way would work, but wouldn't give me the custom coloring that I really want, but I would live with it <g>.

Thanks in advance for all your help.
mtagliaf
 
Posts: 45
Joined: Tue Feb 12, 2008 10:30 pm

Re: SQL to read/write custom variables

Postby kraada » Thu Dec 04, 2008 11:26 am

There really isn't a way to manually edit the StatsDefinitionsCustomized.pt3 file to do what you want as far as I'm aware.

However, FTP changed its note file recently and it's XML now so it'd be really easy to work with that. What I don't know is if manual changes to the file outside of FTP are picked up instantly; you'd have to check that.

Otherwise the format is pretty self explanatory when you look at it, and the only things you'd need to do is make sure that (a) there's no notes on that player and (b) set the icon color as you'd like.

Though that shouldn't be too hard in your program, once you've read in the ROI information, if ROI > X, set color = 1, if ROI < X and ROI < Y set color = 2, etc.

The FTP notes are stored in C:\Program Files\Full Tilt Poker\YourScreenName.xml
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: SQL to read/write custom variables

Postby mtagliaf » Thu Dec 04, 2008 1:07 pm

Thanks for this idea.

This will absolutely work, and is my next course of action, but only if I can't find a way to integrate with the PT3 HUD. If I can get it to work with PT3, then users at other poker sites besides Full Tilt would be able to take advantage of it.

Can you think of anyplace I can stick these values in the database, either existing or custom, that would be accessible to display on the HUD? The Notes? An Unused or "reserved for future use" column? Anywhere?
mtagliaf
 
Posts: 45
Joined: Tue Feb 12, 2008 10:30 pm

Re: SQL to read/write custom variables

Postby kraada » Thu Dec 04, 2008 1:20 pm

There is a notes field in PT3, but I'm not sure you can display it on the HUD yet. (You'd need to create a new note with id_x = player.id_player for that player then set flg_note true for that player in their player table)
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: SQL to read/write custom variables

Postby mtagliaf » Thu Dec 04, 2008 1:31 pm

it looks like you can create a column that refers to a note - I will need to play with it to see if I can pull only the latest note.

I am going to re-post this question to see if anyone else might have tried to do this.

thank you. Maybe we're getting somewhere!
mtagliaf
 
Posts: 45
Joined: Tue Feb 12, 2008 10:30 pm

Re: SQL to read/write custom variables

Postby mtagliaf » Thu Dec 04, 2008 7:02 pm

a dead-end - you cannot change the full tilt notes .xml file while the full tilt client is open - it overwrites the changes upon close. so I am back to trying and come up with a place inside the PT postgres database.

Let me ask this question - if I were to add a column to the "player" table, would the columns/stat customization tool within PT3 pick up that column, create a stat for it, and let me add it to the HUD?
mtagliaf
 
Posts: 45
Joined: Tue Feb 12, 2008 10:30 pm

Re: SQL to read/write custom variables

Postby kraada » Fri Dec 05, 2008 10:29 am

I'm pretty sure that won't work, but you're welcome to try (make sure you have a backup of your data before doing so, just in case).
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY


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

Who is online

Users browsing this forum: No registered users and 0 guests