![]() |
#1
|
|||
|
|||
![]()
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. |
|
|