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

07-31-2009 , 02:10 PM
Let me ask you and hopefully you all will be able to help me out. When I open the ub_mine, it opens for a few seconds but will not remain open. Am I doing something wrong? Any help would be great, if this works I would LOVE IT.

Thanks

Nevermind, I finally checked the end of this posting and downloaded the one that you had already updated for us on your last post, and SURE ENOUGH, it is WORKING! Thanks man, you definately are some kind of genius and you will be receiving a donation from me as soon as I can get my bankroll up a bit! Thanks again!

Last edited by Allinmucker; 07-31-2009 at 02:23 PM.
Free script to Datamine UB Quote
07-31-2009 , 02:22 PM
Hey Allin,

Did you download the latest version from the post above yours?

In the folder that contains the ub_mine.exe there is a file called replay_dirs.txt . Can you confirm that a) that file exists and that b) when you open it, it contains the correct directory where ub is storing your hand histories.

If that doesn't work open up a command prompt and try to run the script from their and see what error messages it prints (I can walk you through that if you need).
Free script to Datamine UB Quote
08-27-2009 , 02:27 AM
Does this work with Omaha? Will Omaha Manager then import these observed Omaha hands?
Free script to Datamine UB Quote
08-27-2009 , 02:03 PM
I haven't tried it yet, but I think it should work fine for omaha as well.
Free script to Datamine UB Quote
08-28-2009 , 01:34 AM
/hijack

what other scripts do u guys use on UB?

/hijack
Free script to Datamine UB Quote
09-21-2009 , 12:57 PM
First off, thank you for this!!!! After some tweaking around I got it to working great!!!!!!

One thing did pop up for me though....while running this app I lose the ability to see the "Replay" on previous hands while this is running for my current tables. I can still see the hand history, but not the actual replayer. Any thoughts?
Free script to Datamine UB Quote
09-21-2009 , 02:12 PM
Unfortunately I think that is a necessary problem since the script moves the files for the instant replay out of the instant replay directory so they won't be converted twice. You'll have to use HEM/PT3s replayers instead.
Free script to Datamine UB Quote
10-09-2009 , 11:48 PM
Hi Neko,

I have tried both the script and the .exe and have the same issue with both. The miner works great in terms of getting the hands but it doesn't seem to be converting them. The converted folder stays empty. They are both able to find the converted folder but don't send anything to it. My UAC is turned off.

Any suggestions? Would be very appreciative if I could get this working.
Free script to Datamine UB Quote
11-03-2009 , 01:54 PM
Bump for new upload since Media Fire seems fond of deleting the file after a month or so.

http://www.filefactory.com/file/a087b3f/n/UBmine_zip


Kneecapper,

Are you sure you had the latest version? I just tried on Windows 7 and XP and it works ok for me when running as administrator.

Make sure the directory that your poker client is writing to is at the top of the replay_dirs.txt file.
Free script to Datamine UB Quote
11-03-2009 , 02:27 PM
Are you able to re-host the file for AP datamining as well?
Free script to Datamine UB Quote
11-03-2009 , 02:51 PM
it works for both AP and UB

Make sure the directory that your poker client is writing to is at the top of the replay_dirs.txt file.
Free script to Datamine UB Quote
11-03-2009 , 04:58 PM
Thanks Neko this works great
Free script to Datamine UB Quote
12-05-2009 , 06:05 PM
Alright I need to use this for Vista, will this also work for AbsolutePoker, I downloaded the python 2.6.4 windows installer and installed Python, can you please give me step by step instructions in laymens terms what I need to do to get my observed hands into PT3? Thanks a lot it is much appreciated.
Free script to Datamine UB Quote
12-05-2009 , 06:11 PM
Yes, it works with Absolute.
There is not need to install python - there is a compiled version of the script IIRC, if you read back through the thread.
Free script to Datamine UB Quote
12-05-2009 , 06:19 PM
Can you spell this out for me WhiteRider, exactly everything I need to do? That would be great.
Free script to Datamine UB Quote
12-05-2009 , 06:23 PM
Is this what I'm looking for?

Quote:
Originally Posted by Neko
Hey Guys,

Here is another version that will allow people with non-standard installations to get this working. This executable should work for UB and ABS.

http://www.mediafire.com/file/kytmm1mfndm/UB_mine.zip

There is now a file called replay_dirs.txt in the same directory that looks like this:

Code:
C:\Program Files\UltimateBet\InstantReplay
C:\Poker Application\UltimateBet\InstantReplay
C:\Program Files\Absolute Poker\InstantReplay
C:\Poker Application\Absolute Poker\InstantReplay
If you have UB or ABS installed in a different location just add the InstantReplay directory to the top of the file.

Here is the script for those of you who are using it.

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

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

#move instant replay files to this directory after processing
root_dir=os.path.dirname(sys.argv[0])
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(out_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(f,fname):
    try:
        infile = open(fname,'r')
        
        dat = infile.readlines()
        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.write(hh)
        f.flush()
    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():

    suf = get_file_suffix()
    num=suf.next()
    while os.path.exists(hist_dir+"batch_"+str(num)+'.txt'):
        num  = suf.next()

    return hist_dir+"batch_"+str(num)+'.txt'

#-------------------------------------------------------------------------------
#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")
ciao,
Neko
Or this one?

Quote:
Originally Posted by Neko
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")

Last edited by NoMeansNo; 12-05-2009 at 06:29 PM.
Free script to Datamine UB Quote
12-05-2009 , 06:33 PM
It sounds likely to be the first one, but I would tend to suggest getting the latest version, whichever that is.
It's a long time since I installed this script but I did it from the directions in this thread, so assuming the links are still live it should be fine.
If you have problems I'm sure the author will help you out, I don't really know much about how this script works, except that it does.
Free script to Datamine UB Quote
12-05-2009 , 06:44 PM
Ok, I don't have a clue what to do.
Free script to Datamine UB Quote
12-05-2009 , 08:04 PM
Quote:
Originally Posted by Neko
Bump for new upload since Media Fire seems fond of deleting the file after a month or so.

http://www.filefactory.com/file/a087b3f/n/UBmine_zip


Kneecapper,

Are you sure you had the latest version? I just tried on Windows 7 and XP and it works ok for me when running as administrator.

Make sure the directory that your poker client is writing to is at the top of the replay_dirs.txt file.
Quote:
Originally Posted by NoMeansNo
Ok, I don't have a clue what to do.
Use the filefactory link above (scroll down that page, there is a "download now" button) to download the latest version.

Unzip the file somewhere. Edit the replay_dirs.txt file so that the location of the InstantReplay directory of your client (this is C:\Poker Application\Absolute Poker\InstantReplay for Abs on Win 7 and Vista) is the top (or only) line in that file. Right click the ub_mine.exe file and select Run as Administrator.
Free script to Datamine UB Quote
12-05-2009 , 10:43 PM
So do I just leave this program open when I am running AP? it's working just got 1 hand!

So when I want them in PT3 all I do is use the "histories" file?

Earlier I was obseving 14 tables, why does it limit me at ovserving 10 tables now? I will be able to play 14 tables on this site right? Support told me I would be able to...

Last edited by NoMeansNo; 12-05-2009 at 10:52 PM.
Free script to Datamine UB Quote
12-06-2009 , 03:06 AM
Thanks a lot op, I'm datamining at AP for like 4K hands so far and it's such a small field of players, I will have 98% at this stakes within a week.
Free script to Datamine UB Quote
12-06-2009 , 03:21 AM
It seems to have stopped working now...It is auto-importing and shows the hands importing, and when I stop and start the auto import it shows the next 30 or so hands that have been played, but when I pick one player at a table and find him in PT3 his hands played doesn't increase?
Free script to Datamine UB Quote
12-06-2009 , 03:57 AM
Ya the auto import won't work anymore, in PT3 it shows the hands as being imported but they don't register in the cash games section, manual import works fine, though, I hope I didn't mess up my auto-import for tables I'm playing at...
Free script to Datamine UB Quote
12-06-2009 , 05:32 AM
You need to add the new folder that the observed HH files are being written to in Auto Import > Cereus Configuration.
You need to click Refresh to see the new hands in PT3.
Free script to Datamine UB Quote
12-06-2009 , 06:16 AM
I'd already imported like 2500 hands or so that showed up, I had about 1500 more after that that wouldn't, I clicked refresh like 90 times, closed and opened PT3 a couple of times, and restarted my computer, none of it worked.

I purged my PT3 data and checked pokerstars when I did it, it left all of the Absolute Poker stuff, but when I would import more all of the hands would show up in the import box on the auto-import tab, but they wouldn't ever register in the cash games section, I refreshed a lot of times and restarted computer even.

I ended up just purging everything agian because I am ******ed, they are coming in through the manuel import so I'm just using that.

What happens when you import duplicate files, they don't mess up the stats or anything right? Are they just discarded? It's not moving them from the UBmine histories through manuel import like it does in auto-import, it's like it's just copying them instead.

Thanks WhiteRider.

Last edited by NoMeansNo; 12-06-2009 at 06:21 AM.
Free script to Datamine UB Quote

      
m