Open Side Menu Go to the Top
Register
Free script to Datamine UB Free script to Datamine UB

04-13-2009 , 04:40 PM
it's in this thread somewhere. go find it.
Free script to Datamine UB Quote
04-13-2009 , 08:04 PM
Quote:
Originally Posted by Christmas_Tree
So where do i down load that from?
Quote:
Originally Posted by Neko
Here is an executable of the lateset version.

For UB:
http://www.mediafire.com/file/z1enezkz3jt/UB_mine.zip

and one for Absolute:

http://www.mediafire.com/file/nnv2tjdtydj/Abs_mine.zip
^
Free script to Datamine UB Quote
04-13-2009 , 09:17 PM
Quote:
Originally Posted by Christmas_Tree
Ok thanks for that, that seems to have worked,

i'm now getting the following message however

failed to make converted hand directory

Any ideas?
If you are on Vista you might have to run it as administrator (or turn UAC off) or create the directories manually.
Free script to Datamine UB Quote
04-20-2009 , 07:26 PM
Just wanted to bump this to say thanks to everyone who has made donations...My team just surpassed our goal of raising $10k for the Ride To Conquer Cancer
Free script to Datamine UB Quote
05-21-2009 , 08:45 PM
DL'd the exe for absolute, extracted it properly, had hands showing up. NOw, how do i get these hands loaded into pokertracker 3?
Free script to Datamine UB Quote
05-22-2009 , 10:44 AM
You need to tell PT3 to import hands from {{your_dir}}\histories\ where {{your_dir}} is the directory where you saved the program (e.g. C:\Program Files\UB_mine\histories\ or whatever it is for you)
Free script to Datamine UB Quote
05-22-2009 , 04:33 PM
yea, i actually tinkered and got luckyl. ty for this .exe and script though. very well done.


i wish it was programmable to open tables at a certain limit, especially usefull for over night mining.
Free script to Datamine UB Quote
05-22-2009 , 04:43 PM
Glad you got it working.

I recently made a SNG datamining program that automatically opens and closes tables http://forumserver.twoplustwo.com/45...-miner-484701/ some time when I get a chance I will probably adapt it to work with cash games, but I am too busy at the moment to devote any time to it.
Free script to Datamine UB Quote
05-22-2009 , 11:35 PM
got ya. and yea, i play sngs, but not frequently enough to scout. however, if you do get time, I'd be willing to donate for that convenience.
Free script to Datamine UB Quote
05-23-2009 , 02:56 PM
Is there an app that will automatically open the table on UB prior to datamining with UB Mine? Would be nice to avoid having to open up 15 tables and minimize them all. Any thoughts?
Free script to Datamine UB Quote
05-23-2009 , 03:23 PM
not at this point no.

I just recently became aware of The Absolute Solution though (search in this forum) which looks to be another more complete dataminer for the CEREUS network. Maybe give it a shot.
Free script to Datamine UB Quote
07-02-2009 , 06:53 PM
HM no longer works if the miner is running. HM Roy sent me this:

Hi, we changed how we do table detection – the filename in the ABS hand history folder contains a number which is the table number and we include that now when searching for tables because Cereus duplicate the table names (but the table numbers are unique). Maybe the guy who wrote the script can change the filename to include the table number?
Free script to Datamine UB Quote
07-09-2009 , 06:56 PM
Hey all, I just tried this. I downloaded the executable and ran it. I let it run for a hwile and ended up with a few "batch" files

Then I ran PT and did an import of handhistories and got:

Import Finished - 30 file(s) read - 0 new hand(s) were imported.

Says it logged 2000 hands. The files look ok. Any ideas what would make it not actually import any hands? I feel dumb here..

Edit: Nmd, tip for everyone out there using old PT2, import using the AP import not the UB import, even if on UB.

Last edited by RayPowers; 07-09-2009 at 07:03 PM.
Free script to Datamine UB Quote
07-13-2009 , 10:14 PM
Jurrr,

Sorry for the slow response but I have been travelling for 3 weeks without internet. I should be able to fix it so it will work with HM again but it will have to wait a little while as I just took on a contract that will be consuming a lot of time. Maybe I will get a chance this weekend.

Ray,

Glad you got it sorted out, yeah, after Absolute and UB merged PT2 and PT Omaha required all Cereus hands to be imported as Absolute hands.
Free script to Datamine UB Quote
07-28-2009 , 04:02 PM
Any luck with a fix Neko?
Free script to Datamine UB Quote
07-28-2009 , 05:02 PM
Sorry I have not had a chance to look at this yet. Is the problem that HM no longer imports the hands or just that the HUD doesn't work anymore?
Free script to Datamine UB Quote
07-28-2009 , 11:41 PM
Quote:
Originally Posted by Neko
Sorry I have not had a chance to look at this yet. Is the problem that HM no longer imports the hands or just that the HUD doesn't work anymore?
HM imports but the HUD is essentially frozen - HUD stats display however it is unresponsive to mouse-overs, clicks, etc.
Free script to Datamine UB Quote
07-29-2009 , 12:00 AM
ok thanks GR. I will devote an hour to it tomorrow.
Free script to Datamine UB Quote
07-29-2009 , 02:09 AM
Quote:
Originally Posted by Neko
ok thanks GR. I will devote an hour to it tomorrow.
Thank you Neko, your time/work/effort is much appreciated.
Free script to Datamine UB Quote
07-29-2009 , 12:09 PM
Here is a hacked version that I think should fix it (works for me atm). I will put up a compiled version on Friday once I'm back home.

Code:
#ub_mine.py v1.4 July 29th 2009
#written by Neko (2+2 handle)
#This code is released under the WTF licence. That means you can
#do W.hatever T.he F.uck you feel like with it.
#If you would like to make a small donation via UB or Absolute p.m. me on 2+2
#or email me neko2p2@gmail.com

import os,shutil,sys,string,time,traceback
from msvcrt import kbhit,getch

#maximum number of hands to store in one batch file
max_hands_per_file = 100

#if True converted .dat files will be deleted otherwise they will be moved
del_converted = True

root_dir=os.path.dirname(sys.argv[0])

#list of locations to look for AP instant replay data files
replay_dir_file = root_dir+"/replay_dirs.txt"

#move instant replay files to this directory after processing

print "Root directory:"+root_dir
converted_dir = root_dir+"/converted/"

#store the converted histories in this directory
hist_dir = root_dir+"/histories/"

#number of seconds to wait in between processing batches
sleep_time = 5



#===============================================================================
def main():
    replay_dir = get_replay_dir()
    if not replay_dir:
        die("Unable to find the instant replay directory")
    
    #make directory to move processed hands to if it doesn't already exist
    print "Looking for processed hand directory "+converted_dir
    if not os.path.isdir(converted_dir):
        "\tConverted directory not found. Trying to create now...",        
        try:
            os.mkdir(converted_dir)
        except:
            die("failed")
        else:
            print "success"

    else:
        print "\tAlready exists"
        
    #make directory to store converted hand history file
    if not os.path.isdir(hist_dir):
        try:
            os.mkdir(hist_dir)
        except:
            die("failed to make hand history directory")

    stop = False

    print "="*80
    print "Starting to convert hand histories"
    print "hit 'q' at any time to stop import"
    print "="*80

    ttl_hand_count = 0
    hand_counter=0
    out_file = None
    os.chdir(replay_dir)

    while not stop:

        if kbhit() and getch() == 'q': stop = True
        
        dirList=os.listdir(os.getcwd())

        for fname in dirList:
            if fname.find('.dat')!=-1:

                #get a new file to write to if the old one already contains
                #the max num of histories or an output file doesn't yet exist
#                if hand_counter ==  max_hands_per_file or not out_file:
#                    hand_counter = 0
#                    if isinstance(out_file,file):
#                        out_file.close()

#                    out_file = get_new_file_object()

                #extrat history and move/delete the .dat file
                if add_to_file(fname):
                    
                    handle_converted_file(fname)
        
                    hand_counter += 1
                    ttl_hand_count += 1
                    sys.stdout.write("\rTotal Hands Written: " + str(ttl_hand_count)) 
                    sys.stdout.flush()
           

        if not stop: time.sleep(sleep_time)

    if out_file:
        out_file.close()
    raw_input("\nSuccesfully Finished Execution. Press enter key to quit.")

    
#-------------------------------------------------------------------------------
#Extract the hh from the .dat file
def add_to_file(fname):
    try:
        infile = open(fname,'r')
        
        dat = infile.readlines()
        table = dat[1].partition("=")[2].strip()


        for i,line in enumerate(dat):
            dat[i] = dat[i].strip()
        infile.close()
    
        first = dat.index("[IHH]")
        dat = dat[first+1:len(dat)-1]
        hh = ''
        for line in dat:
            nxt_line = line.partition('=')[2]
            hh += nxt_line+'\n'
 
        f = open(get_output_file_name(table),'w')       
        f.write(hh)
        f.close()
    except:
        return False

    return True

#-------------------------------------------------------------------------------
#remove or delete the converted .dat files
def handle_converted_file(fname):
    try:
        if del_converted:
            os.remove(fname)
        else:
            # removing duplicate file if file exists
            pathToFile = converted_dir+fname
            if os.path.exists(pathToFile):
                os.remove(pathToFile)
            shutil.move(fname,converted_dir)
    except:
        pass
#-------------------------------------------------------------------------------
#iterate over the list of replay directories and return the first one that exists
def get_replay_dir():

    replayf = open(replay_dir_file,'r')
    dat = replayf.readlines()
    replayf.close()
    dirs = []
    for line in dat:
        dirs.append(line.strip())

    idx = 0
    print "Looking for Instant Replay directory...."
    for rdir in dirs:
        print "\tChecking "+rdir,
        if os.path.isdir(rdir):
            print "found"
            return rdir
        else:
            print "doesn't exist"

    return False
#-------------------------------------------------------------------------------
#generic exit point on errors
def die(msg = None):
    if msg: print msg
    raw_input("Press enter key to exit")
    os._exit(99)
#-------------------------------------------------------------------------------
#returns the next batch file name
def get_output_file_name(prefix):

    suf = get_file_suffix()
    num=suf.next()
    while os.path.exists(hist_dir+"IHH"+prefix+"_batch_"+str(num)+'.txt'):
        num  = suf.next()
    fname = hist_dir+"IHH"+prefix+"_batch_"+str(num)+'.txt'

    return fname

#-------------------------------------------------------------------------------
#batch file suffix generator
def get_file_suffix():
    k = 0
    while True:
        k+=1
        yield k
#-------------------------------------------------------------------------------
#returns a new file object to write a batch of histories to
def get_new_file_object():
           
    try:
        out_file = open(get_output_file_name(),'w')
        return out_file
    except:
        die("Unable to create new output file "+fname)

#===============================================================================
if __name__ == '__main__': 
    try:
        main()
    except:
        print ""
        print "An unhandled exception occured."
        traceback.print_exc()
        raw_input("press enter key to exit")
Free script to Datamine UB Quote
07-29-2009 , 12:20 PM
I didn't realize I had the right script on my laptop so here is an executable now, rather than friday:
http://www.mediafire.com/?sharekey=c...4e75f6e8ebb871
Free script to Datamine UB Quote
07-29-2009 , 06:24 PM
Thanks Neko. Not to push my luck, as I realize you are busy, but what do I change to get it to work with AP, I noticed you changed the way the replay folder is found.

EDIT: Never mind, didn't notice you included "replay_dirs.txt", I'm an idiot.
Free script to Datamine UB Quote
07-29-2009 , 07:00 PM
The HUD layovers still aren't working for tables I'm observing while ub_mine is running, but they do work on tables I'm seated at.
Free script to Datamine UB Quote
07-29-2009 , 08:19 PM
what version of HM are you using?

Looks like 1.09 is the newest and I was using 1.08 so I will upgrade to that and try again.
Free script to Datamine UB Quote
07-29-2009 , 08:57 PM
ok, here it is again, hopefully this will fix it. It is working with 1.09 beta 20 now for me. Note that it's kinda crappy since every history is written to its own file now so there are going to be a tonne of hand history files. I'll fix that up when I get a chance.

Executable:

http://www.mediafire.com/file/2wlzfyqolez/UBmine.zip

Script:

Code:
#ub_mine.py v1.4 Feb 16th 2009
#written by Neko (2+2 handle)
#This code is released under the WTF licence. That means you can
#do W.hatever T.he F.uck you feel like with it.
#If you would like to make a small donation via UB or Absolute p.m. me on 2+2
#or email me neko2p2@gmail.com

import os,shutil,sys,string,time,traceback
from msvcrt import kbhit,getch

#maximum number of hands to store in one batch file
max_hands_per_file = 100

#if True converted .dat files will be deleted otherwise they will be moved
del_converted = True

root_dir=os.path.dirname(sys.argv[0])

#list of locations to look for AP instant replay data files
replay_dir_file = root_dir+"/replay_dirs.txt"

#move instant replay files to this directory after processing

print "Root directory:"+root_dir
converted_dir = root_dir+"/converted/"

#store the converted histories in this directory
hist_dir = root_dir+"/histories/"

#number of seconds to wait in between processing batches
sleep_time = 5



#===============================================================================
def main():
    replay_dir = get_replay_dir()
    if not replay_dir:
        die("Unable to find the instant replay directory")
    
    #make directory to move processed hands to if it doesn't already exist
    print "Looking for processed hand directory "+converted_dir
    if not os.path.isdir(converted_dir):
        "\tConverted directory not found. Trying to create now...",        
        try:
            os.mkdir(converted_dir)
        except:
            die("failed")
        else:
            print "success"

    else:
        print "\tAlready exists"
        
    #make directory to store converted hand history file
    if not os.path.isdir(hist_dir):
        try:
            os.mkdir(hist_dir)
        except:
            die("failed to make hand history directory")

    stop = False

    print "="*80
    print "Starting to convert hand histories"
    print "hit 'q' at any time to stop import"
    print "="*80

    ttl_hand_count = 0
    hand_counter=0
    out_file = None
    os.chdir(replay_dir)

    while not stop:

        if kbhit() and getch() == 'q': stop = True
        
        dirList=os.listdir(os.getcwd())

        for fname in dirList:
            if fname.find('.dat')!=-1:

                #get a new file to write to if the old one already contains
                #the max num of histories or an output file doesn't yet exist
#                if hand_counter ==  max_hands_per_file or not out_file:
#                    hand_counter = 0
#                    if isinstance(out_file,file):
#                        out_file.close()

#                    out_file = get_new_file_object()

                #extrat history and move/delete the .dat file
                if add_to_file(fname):
                    
                    handle_converted_file(fname)
        
                    hand_counter += 1
                    ttl_hand_count += 1
                    sys.stdout.write("\rTotal Hands Written: " + str(ttl_hand_count)) 
                    sys.stdout.flush()
           

        if not stop: time.sleep(sleep_time)

    if out_file:
        out_file.close()
    raw_input("\nSuccesfully Finished Execution. Press enter key to quit.")

    
#-------------------------------------------------------------------------------
#Extract the hh from the .dat file
def add_to_file(fname):
    try:
        infile = open(fname,'r')
        
        dat = infile.readlines()
        table = dat[1].partition("=")[2].strip()


        for i,line in enumerate(dat):
            dat[i] = dat[i].strip()
        infile.close()
    
        first = dat.index("[IHH]")
        dat = dat[first+1:len(dat)-1]
        hh = ''
        for line in dat:
            nxt_line = line.partition('=')[2]
            hh += nxt_line+'\n'
 
        f = open(get_output_file_name(table),'w')       
        f.write(hh)
        f.close()
    except:
        return False

    return True

#-------------------------------------------------------------------------------
#remove or delete the converted .dat files
def handle_converted_file(fname):
    try:
        if del_converted:
            os.remove(fname)
        else:
            # removing duplicate file if file exists
            pathToFile = converted_dir+fname
            if os.path.exists(pathToFile):
                os.remove(pathToFile)
            shutil.move(fname,converted_dir)
    except:
        pass
#-------------------------------------------------------------------------------
#iterate over the list of replay directories and return the first one that exists
def get_replay_dir():

    replayf = open(replay_dir_file,'r')
    dat = replayf.readlines()
    replayf.close()
    dirs = []
    for line in dat:
        dirs.append(line.strip())

    idx = 0
    print "Looking for Instant Replay directory...."
    for rdir in dirs:
        print "\tChecking "+rdir,
        if os.path.isdir(rdir):
            print "found"
            return rdir
        else:
            print "doesn't exist"

    return False
#-------------------------------------------------------------------------------
#generic exit point on errors
def die(msg = None):
    if msg: print msg
    raw_input("Press enter key to exit")
    os._exit(99)
#-------------------------------------------------------------------------------
#returns the next batch file name
def get_output_file_name(table):

    suf = get_file_suffix()
    num=suf.next()
    while os.path.exists(hist_dir+"IHH"+str(num)+"_Table "+table+'.txt'):
        num  = suf.next()
    fname = hist_dir+"IHH"+str(num)+"_Table "+table+'.txt'
  
    return fname

#-------------------------------------------------------------------------------
#batch file suffix generator
def get_file_suffix():
    k = 0
    while True:
        k+=1
        yield k
#-------------------------------------------------------------------------------
#returns a new file object to write a batch of histories to
def get_new_file_object():
           
    try:
        out_file = open(get_output_file_name(),'w')
        return out_file
    except:
        die("Unable to create new output file "+fname)

#===============================================================================
if __name__ == '__main__': 
    try:
        main()
    except:
        print ""
        print "An unhandled exception occured."
        traceback.print_exc()
        raw_input("press enter key to exit")
Free script to Datamine UB Quote

      
m