Quote:
Originally Posted by Deuce2Seven
Does any1 know where I can get a program to grab HH's off poker stars?
thanks in advance
-deuce
At the risk of getting yelled at that datamining at Stars is illegal....
Code:
#NoEnv
#Persistent
SendMode Input
SetWorkingDir %A_ScriptDir%
DetectHiddenWindows, on
SetTitleMatchMode, 2
GuiWinTitle := "Stars Terms and Conditions and Prohibited Programs list.pdf - Adobe Acrobat Reader"
Gui, Show, W550 H300 Center, %GuiWinTitle%
Gui, Add, Edit, W300 vFolderTextBox, PokerStars Hand History Folder (with username folder)
Gui, Add, Button, , Browse
Gui, Add, Edit, W75 vHowManyHands
Gui, Add, Checkbox, vHandsCheckBox Checked0 gLookAtCheckBox, Hands in IHH
Gui, Add, Edit, w50 x110 y62 vDiffHands
GuiControl, Hide, DiffHands
Gui, Add, Button, x10 y113, Single Grab
Gui, Add, Edit, W50 vTimerBox
Gui, Add, Button, , Timer On
HotKey, IfWinExist, Instant Hand History
HotKey, Escape, EscapeSub, On
HotKey, IfWinNotExist, Instant Hand History
HotKey, Escape, ExitSub, On
Return
EscapeSub:
{
WinActivate, %GuiWinTitle%
GuiControl, Text, Button4, Timer On
Gui, Submit, Nohide
SetTimer, HandGrabber, Off
WinClose, Instant Hand History
Return
}
LookAtCheckBox:
{
Gui, Submit, NoHide
If HandsCheckBox = 1
{
GuiControl, Show, DiffHands
}
If HandsCheckBox = 0
{
GuiControl, Hide, DiffHands
}
}
Return
ButtonBrowse:
{
FileSelectFolder, HHFolder, C:\Program Files\PokerStars\HandHistory, 3
GuiControl, , FolderTextBox, %HHFolder%
}
Return
ButtonTimerOn:
{
Gui, Submit, Nohide
GuiControlGet, TimerButtonText, , Button4
If TimerButtonText = Timer On
{
GuiControl, Text, Button4, Timer Off
Gui, Submit, Nohide
If HandsCheckBox = 1
{
PGDNnumber := DiffHands//18 + 1
}
If HandsCheckBox = 0
{
PGDNnumber=100
}
HowLongTimer := TimerBox*1000//1
SetTimer, HandGrabber, %HowLongTimer%
Gosub, HandGrabber
}
Else
{
SetTimer, HandGrabber, Off
GuiControl, Text, Button4, Timer On
Gui, Submit, Nohide
}
Return
}
ButtonSingleGrab:
{
Gui, Submit, Nohide
SetTimer, HandGrabber, Off
If HandsCheckBox = 1
{
PGDNnumber := DiffHands//18 + 1
}
If HandsCheckBox = 0
{
PGDNnumber := HowManyHands//18 + 1
}
Gosub, HandGrabber
Return
}
Return
HandGrabber:
{
FormatTime, FileTime2, , MM-dd-yyyy_hh-mm-sstt
FileTime = %FileTime2%
FileAppend, , Stars-Hand-History_%FileTime%.txt
FileMove, Stars-Hand-History_%FileTime%.txt, %FolderTextBox%
IfWinExist, PokerStars Lobby
{
WinShow, PokerStars Lobby
WinActivate, PokerStars Lobby
WinMenuSelectItem, PokerStars Lobby, , Requests, Display Instant Hand History
WinMinimize, PokerStars Lobby
}
IfWinNotExist, PokerStars Lobby
{
WinGetTitle, StarsWinTitle, No Limit Hold'em ahk_class PokerStarsTableFrameClass, , Lobby
WinActivate, %StarsWinTitle%
WinWait, %StarsWinTitle%
SetMouseDelay, 0
MouseGetPos, CurrXZ, CurrYZ
Send {Click 60,42}
MouseMove, %CurrXZ%, %CurrYZ%
WinMinimize, %StarsWinTitle%
StarsWinTitle=""
}
WinWait, Instant Hand History
WinActivate, Instant Hand History
SetMouseDelay, 0
MouseGetPos, CurrX, CurrY
MouseMove, 81, 76
MouseGetPos, , , , AllTablesClass
SetMouseDelay, 0
MouseMove, 250, 250
MouseGetPos, , , , TableListClass
SetMouseDelay, 0
MouseMove, 88, 364
MouseGetPos, , , , HHBoxClass
MouseMove, %CurrX%, %CurrY%
WinMinimize, %GuiWinTitle%
WinMinimize, Instant Hand History
ControlSend, %AllTablesClass%, {PGUP 6}, Instant Hand History,
ControlSend, %TableListClass%, {PGDN %PGDNnumber%}, Instant Hand History,
Loop, %HowManyHands%
{
ControlGet, HHClass, HWND, , %HHBoxClass%, Instant Hand History
ControlGetText, HHText, , ahk_id %HHClass%,
FileAppend, %HHText%`r`n`r`n`r`n, %FolderTextBox%\Stars-Hand-History_%FileTime%.txt
ControlSend, %TableListClass%, {UP}, Instant Hand History,
}
WinClose, Instant Hand History
WinRestore, %GuiWinTitle%
WinActivate, %GuiWinTitle%
}
Return
GuiClose:
GoSub, ExitSub
Return
ExitSub:
{
ExitApp
Return
}
Return
In order to use that script, you must download AutoHotKey....
This is what I have so far. When you run it, a window will appear with three boxes. The first one is obvious, just click browse and find your hand history directory. If it's not in the normal folder, you can type the path. The middle box is where you type the number of hands you want to get. If the checkbox just underneath is not checked, the program will also use that figure to find out how far down to scroll. That is, if there are 100 hands in the instant hand history window but you type 5 in the middle box of my program, it will just grab the five hands without scrolling down, whereas if you type 100 it will scroll down and grab them all. It does this by simply dividing the number of hands you enter by 18 and then using the answer as the number of times it hits the "page down" button in the hand history window before grabbing the hands.
If you check the checkbox another box will appear. Let's say you want to grab five hands, but you want the last five hands and there are 200 or so in the hand history window. Then you type 5 in the first box and 200 in the box next to it. This second box serves the same "page down" function as I just mentioned, but is useful if you want to only grab the last few hands. You can type a large number, like 2000 in the second box, and the program will just keep trying to scroll down for another second or two even after it hits the bottom (since it is hitting the page down button in the hand history window more than necessary). I have found that the hand history window never displays more than 1500 or so hands, so when I have my program running at night, I just type 1600 or 1700 in that second box and grab 300 or 400 at a time (in the first box).
At this point, you can just hit "single grab" and it will go get the number of hands, or you can use the timer function which is the bottom box. In that you type how ever many seconds you want in between hand grabbing. The program will then perform a "single grab" over and over every [whatever number you input] seconds. The countdown is running while the hand-grabbing is going on, so be sure to allow for enough time to finish the hand-grabbing before it attempts to start over or else the program will have problems. As a rule, I would use 100 plus 60 seconds per every hundred hands you are grabbing. So for 300 hands, I would use 280 seconds (100 + 3*60 = 100 + 180 = 280). When I run it at night, I usually have 300 in the first middle box, 1600 in the second middle box, and 280 in the bottom timer box.
At any point, you can hit the escape button and if it is hand-grabbing, it will stop and close the IHH window, and if it is just the program up, the program will exit. If you hit escape to stop hand-grabbing, be aware that you will have to restart the script because for some reason escaping out of the hand-grabbing screws it up and the "single grab" and "timer" buttons no longer work after you hit escape.
My program also uses the mouse in order to find the ClassNN numbers for the various parts of the hand history window, so if you have a weird screen size or have resized the hand history window or something, it is possible that it won't work correctly. If that is the case, or if you have any other problems with it, just let me know. There are many redundant hands in each the file it creates, but I'd rather that than miss some hands.
Hope you find the program useful.