View Single Post
  #1  
Old 03-11-2007, 04:17 PM
MSPChris MSPChris is offline
Member
 
Join Date: Mar 2005
Posts: 70
Default PStars Grabber (New AHK script)

Here's a script that writes the hands from an Instant Hand History window to your History file. From there you can import it into PokerTracker or whatever you want.

I read some of the posts about Stars and gathering data on your opponents, and I saw some people charging 20$??? for a program that mines.

Yellowbluebus posted a quick and dirty script to grab scripts, and he invited people to modify it. That's what I did. If you are interested, his original AutoIt script is here.

Mine's free -- but I warn you you're getting what you pay for haha.

Anyone with comments or suggestions, feel free to either post them or PM me.

---START SCRIPT---

/*
################
################
###
### PStars Hand Grabber 0.9
### --by MSPChris (2+2 n00b, AHK n00b)
###
### Credit to Yellowbluebus 2+2er who posted the original PS Helper
### AutoIt3 script.
###
### Credit also to the [censored] who try to charge for this stuff.
###
###
### This AHK script grabs PStars histories and puts them into a
### history file. From there the histories could be imported into PTH
### or PO.
###
### The best way to use this script is to observe tables and choose which
### ones to play on. There are other uses, but other uses are not
### intended nor are they recommended since they violate of PStars TOS.
###
### Run this script once you open Stars, but before you actually log on.
###
### Do not run this script while you're playing. It doesn't work. IF
### you decide to try it while you're playing, you won't be able to take
### any actions on your tables or you'll [censored] it up.
###
### You can use the computer while the script is not running, but when
### it starts you should not do anything until the IHH windows disappears.
### Once it disappears you can go back to what you were doing before!
###
### OPERATING INSTRUCTIONS:
###
### 1) For the variable cFileName, use your own PStars Screen Name
### 2) Set cSleep for how often you want to run the grabber to run.
### I've found that even with 40 tables or so open, the Instant Hand
### History will hold between 30-45 minutes worth of hands right now
### the script is set to run every 10 minutes.
### 3) Save the script after you've customized it.
### 4) Open PStars.
### 5) Open the IHH Window.
### 6) IF you want to use the PC while this utility runs, you may want to
### resize/move the IHH window to someplace where you can see most of
### the screen.
### 7) Open the tables that you are interested in.
### 8) You may want to start PT or PO to process your hands while the
### script runs.
###
### I'm still playing with this code -- if you know a lot about AHK you can
### see that I don't! haha
###
### Tips, Tricks, Hints, and Suggestions for improvement are welcome.
###
### I may post this script elsewhere, like the AHK pages, later on but I
### want to refine it more and add some cooler [censored].
###
### Enjoy!!
###
###
### --MSPChris
###
################
################
*/



; auto-execute

cIHH = Instant Hand History
cPSTable = Afx:400000:28:10011:0:01 ;table of hands in the IHH window
cSrch = `'
cFileName = C:\Program Files\PokerStars\HandHistory\YOURPSTARSACCOUNTNAME \CurrData
cSleep = 600000 ;set to 10 min -- change the time interval here
lastGameID = 0


; start IHH grabber loop

loop
{
prevTableName:=
prevGameID:=
WinActivate, %cIHH%
Control,Choose,1,ComboBox1,%cIHH%
ControlFocus, %cPSTable%,%cIHH%
If (lastGameID = 0)
{
Send {PgUp 10}
}
else
{
GoSub FindLastGameID
}
FileID := A_Index
Loop
{
WinActivate, %cIHH%
ControlGetText,History,Edit2,%cIHH%
Loop, Parse, History, `n
{
IfEqual, A_Index,3, break
aHistData%A_Index% = %A_LoopField%
}
Pos := InStr(aHistData2,cSrch,0,0)
StringMid,TableName,aHistData2,8,(Pos-8)
StringMid,GameID,aHistData1,18,10
If (TableName = prevTableName) and (GameID = prevGameID)
break
prevTableName:= TableName
prevGameID:= GameID
FileAppend,
(
%History%
),%cFileName%%FileID%.txt
WinActivate, %cIHH%
ControlFocus, %cPSTable%,%cIHH%
Send {Down}
}
lastGameID := (prevGameID - 10000)
WinMinimizeAll
Sleep, %cSleep%

}
return



; Finds last hand from previous loop
FindLastGameID:
ControlGetText,History,Edit2,%cIHH%
StringMid,GameID,History,18,10
Loop
{
If (GameID > lastGameID)
{
Send {PgUp 4}
break
}
else
{
Send {PgDn 2}
ControlGetText,History,Edit2,%cIHH%
StringMid,GameID,History,18,10
}
}
return

--- END SCRIPT ---
Reply With Quote