View Single Post
  #38  
Old 10-26-2007, 05:54 PM
erazorXP erazorXP is offline
Junior Member
 
Join Date: Oct 2007
Posts: 12
Default Re: PStars Grabber (New AHK script)

I´ve modified the script a bit, and it seems that everything is working fine now, especially the "find last game" feature.

try this and tell me if works out for you.


[ QUOTE ]

; auto-execute

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


; start IHH grabber loop

Process, priority, , High
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}
SetKeyDelay, 1
}
lastGameID := (prevGameID - 100)
WinMinimize, %cIHH%
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 3}
break
}
else
{
Send {PgDn 2}
ControlGetText,History,Edit2,%cIHH%
StringMid,GameID,History,18,10
}
}
return



[/ QUOTE ]
Reply With Quote