#21
|
|||
|
|||
Re: Fix for GameTime+ on Everest Poker
I can't get it to paste other than continuous lines, can you put a link to a Python or text file that can be downloaded or something?
|
#22
|
|||
|
|||
Re: Fix for GameTime+ on Everest Poker
Ship it, got it working- thanks dude.
|
#23
|
|||
|
|||
Re: Fix for GameTime+ on Everest Poker
I installed Vista (32 bit) and it doesn't work anymore.
Black dos-screen opens and remains open, but the HH's aren't written to the folder I want to. I installed Pyton 2.5.1 Greets. K. |
#24
|
|||
|
|||
Re: Fix for GameTime+ on Everest Poker
works fine for me on Vista
|
#25
|
|||
|
|||
Re: Fix for GameTime+ on Everest Poker
Hi everybody. I add some "feature" to this script.
Now you don't have to choice the number of player yourself. The script check in a list of name table to know which type of table it is (short handed, full ring, head's up). If the name isn't in the list so it's a multi table tournament (always full ring now) Please tell me if there is problem or if i forgot a table name. <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 = 10 FR_table_name = ['Aracar', 'Ankara', 'Bishorn', 'Bronze', 'Bangkok', 'Beijing', 'Berlin', 'Brussels', 'Chichon', 'Colima', 'Dom', 'Dhaka', 'Ecrins', 'Elbert', 'Fuji', 'Galeras', 'Gold', 'Hanoi', 'Honiara', 'Jungfrau', 'K2', 'Kabul', 'Kigali', 'Liskamm', 'London', 'Monch', 'Maipo', 'Malabo', 'Manila', 'Moroni', 'Moscow', 'Osaka', 'Putana', 'Purace', 'Pelee', 'Paris', 'Robson', 'Rabat', 'Riga', 'Rome', 'Shasta', 'Sangay', 'Sarajevo', 'Seoul', 'Taal', 'Tashkent', 'Tokyo', 'Usluga', 'Ubinas', 'Vienna'] SH_table_name = ['Alphubel', 'Ararat','Apia', 'Batura', 'Bamako', 'Belgrade', 'Bogota', 'Castor', 'Changtok', 'Cook', 'Chowusha', 'Castries', 'Droites', 'Dili', 'Dodoma', 'Doha', 'Eiger', 'Etna', 'Janak', 'Hungchhi', 'Harare', 'Kenya', 'Kotte', 'Lhotse', 'Lusaka', 'Makalu', 'Muscat', 'Nordend', 'Nassau', 'Olympus', 'Palikir', 'Risum', 'Riyadh', 'Rosseau', 'Sanaa', 'Suva', 'Taipei', 'Thimphu', 'Toronto', 'Tutupaca'] HU_table_name = ['Algiers', 'Athens', 'Beirut', 'Belmopan', 'Bern', 'Cameroon', 'Dublin', 'Elbrus', 'Essen', 'Funafuti', 'Hekla', 'Koror', 'Lisbon', 'Luanda', 'Mawenzi', 'Manaslu', 'Manama', 'Oslo', 'Quito', 'Savoia', 'Sinai', 'Tyree', 'Tsogaka', 'Tarawa', 'Tbilisi', 'Tirana', 'Victoria'] ############################# / 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' ) tablename = xmlLine.childNodes[0].getAttribute( 'tableName' ) tablename = tablename.split('-')[0] if tablename in FR_table_name: number_of_players = 10 ### "full ring table" ### elif tablename in SH_table_name: number_of_players = 6 ### "short handed table" ### elif tablename in HU_table_name: number_of_players = 2 ### "heads up table" ### else: number_of_players = 10 ### "tournament HH" ### 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 /> |
|
|