#1
|
|||
|
|||
Fix for GameTime+ on Everest Poker
Hi,
If anyone here plays on Everest Poker and uses GameTime+ they probably noticed that you have to move the labels around each time you open a new table, because Everest always places you at the front seat no matter what seat you have. I've created a script to workaround this annoying problem. It's written in Python which you'll need to run the script. Python can be found here: http://www.python.org/download/ What this script does is monitor the HH's Everest Poker produces, converts them to make sure you are always at seat 0 in the handhistory and writes them in a different directory (output_dir) which you can import into PT. There are 3 settings in this script: - everest_dir: this is the directory where Everest Poker places the handhistories, this is usually correct by default. - output_dir: the directory the script outputs the parsed handhistories, make sure this directory exists. - number_of_players: whether you play headsup (2), shorthanded (6) or fullring (10). Save the code of the script to a .py file (e.g. ConvertEverest.py) and doubleclick to run it. It will not output anything on screen but will parse the handhistories every 60 seconds. Just let it run. Make sure PT imports the output_dir and not the everest_dir. Here's the script: <font class="small">Code:</font><hr /><pre>import os, time, re, xml.dom.minidom, xml.parsers.expat ############################### SETTINGS ############################### everest_dir = "C:\Program Files\Everest Poker\history\\" output_dir = "C:\Program Files\Everest Poker\history\processed\\" number_of_players = 6 ############################# / SETTINGS ############################### def ParseFile( filename ): in_file = open( everest_dir + filename, 'rb' ) out_file = open( output_dir + filename, 'wb' ) lines = in_file.readlines() handtext = [ ] for line in lines: handtext.append( line ) if '<SESSION' in line: xmlLine = xml.dom.minidom.parseString( line ) nickname = xmlLine.childNodes[0].getAttribute( 'screenName' ) elif '<HAND' in line: position = { } elif '<SEAT' in line: xmlLine = xml.dom.minidom.parseString( line ) pos = xmlLine.childNodes[0].getAttribute( 'position' ) name = xmlLine.childNodes[0].getAttribute( 'name' ) position[ name ] = pos elif '<DEALER' in line: offset = int( position[ nickname ] ) elif '</HAND>' in line: for l in handtext: try: xmlLine = xml.dom.minidom.parseString( l ) pos = xmlLine.childNodes[0].getAttribute( 'position' ) pos = int(pos) pos = (pos - offset) % number_of_players out_file.write( re.sub( 'position="[0-9]+"', 'position="' + str(pos) + '"', l ) ) except (ValueError, xml.parsers.expat.ExpatError): if '<WIN' in l: pos = int( l[ 17 ] ) pos = (pos - offset) % number_of_players l = l[:17] + str(pos) + l[18:] out_file.write( l ) handtext = [ ] handled = { } while True: files = os.listdir( everest_dir ) for file in files: if re.match( "^[0-9]+\.txt", file ): mtime = os.path.getmtime( everest_dir + file ) if file not in handled: handled[ file ] = 0 if mtime > handled[ file ]: ParseFile( file ) handled[ file ] = mtime time.sleep( 60 )</pre><hr /> I have tested this briefly and it seems to work. Any questions/comments/suggestions are welcome. |
#2
|
|||
|
|||
Re: Fix for GameTime+ on Everest Poker
Nice one!
Thanks. I've tested it and it works for me. |
#3
|
|||
|
|||
Re: Fix for GameTime+ on Everest Poker
Hi, I tired the sof, but I got this error:
C:\Program Files\Everest Poker>everest.py Traceback (most recent call last): File "C:\Program Files\Everest Poker\everest.py", line 57, in <module> ParseFile( file ) File "C:\Program Files\Everest Poker\everest.py", line 14, in ParseFile out_file = open( output_dir + filename, 'wb' ) IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Everest Poker\ \history\\processed\\110.txt' |
#4
|
|||
|
|||
Re: Fix for GameTime+ on Everest Poker
Ok got it, I have to create the 'C:\Program Files\Everest Poker\history\processed\ folder.
|
#5
|
|||
|
|||
Re: Fix for GameTime+ on Everest Poker
Thank you very much for creating the script and to share it. It is of great help
|
#6
|
|||
|
|||
Re: Fix for GameTime+ on Everest Poker
Shouldn't this be trivially easy to implement directly into gametime+? I don't know any C++ or else I would try.
|
#7
|
|||
|
|||
Re: Fix for GameTime+ on Everest Poker
Yes, shouldn't be too hard. Problem is the code on sourceforge is appearently not up to date. Also, I'm lazy.
|
#8
|
|||
|
|||
Re: Fix for GameTime+ on Everest Poker
A very effective improvement of my lie's quality!! Thanks a lot for this!
2 assumptions: 1) it's light weight, not a big task for the computer 2) the sleep 60 in the end means the script is executed every 60 seconds I'm not a very good programmer, but if i'm correct, i could make the script run every 15 seconds, so the delay between handhistory and gametime stats is reduced a bit, right? Anyway, great job!! |
#9
|
|||
|
|||
Re: Fix for GameTime+ on Everest Poker
[ QUOTE ]
2 assumptions: 1) it's light weight, not a big task for the computer 2) the sleep 60 in the end means the script is executed every 60 seconds I'm not a very good programmer, but if i'm correct, i could make the script run every 15 seconds, so the delay between handhistory and gametime stats is reduced a bit, right? [/ QUOTE ] This is all true. I doubt it would make a difference changing the 60 to 15 because you can only let PokerTracker import once every 60 seconds. |
#10
|
|||
|
|||
Re: Fix for GameTime+ on Everest Poker
Does this thing affect your position stats in Pokertracker or does the button also moves according your seat?
Greets. K. |
Thread Tools | |
Display Modes | |
|
|