This should fix all the problems I know of.
with the PokerStars log files (PokerStars.log.*). It will automatically look through all the log files it finds in that folder. It shouldn't let you select a folder that doesn't have at least one PokerStars.log.* file.
- The method it uses to scan for finished tournaments works at least 10x faster than the older version.
. Install it then save the code below as something like Debustifier.ahk and run it.
As I said I don't play that much any more so I haven't tested this with more than four tables going but it should well.
Code:
; DebustifierAHK v0.7 by Entropic on the 2p2 forums (http://forumserver.twoplustwo.com/)
; If you'd like to donate a few bucks my name on PokerStars is DrunkElf3141
; Hope you enjoy
IfNotExist, debustifier.ini ;if no settings are stored
{
If A_OSVersion in WIN_VISTA ;if it's vista the default path is in AppData
IniWrite, %A_AppData%\Pokerstars\, debustifier.ini, LogFolder, Path
Else ;if it's xp/2k/ME/98 it's in program files so use that as the default path
IniWrite, %ProgramFiles%\Pokerstars\, debustifier.ini, LogFolder, Path
}
IniRead, LogFolderPath, debustifier.ini, LogFolder, Path, %A_ProgramFiles%\Pokerstars\
IniRead, DelayTime, debustifier.ini, LogFolder, DelayTime, 1
If (LogFolderPath = "")
{
IniWrite, %ProgramFiles%\Pokerstars\, debustifier.ini, LogFolder, Path
LogFolderPath = %ProgramFiles%\Pokerstars\
}
Gui, Add, Text, Path to PokerStars Log File
Gui, Add, Edit, x5 y5 w230 -Wrap r1 vLogFolderPath, %LogFolderPath%
Gui, Add, Button, x235 y5 w20 gFolderSelect vFolderSelect, `.`.`.
Gui, Add, Edit, x5 y33 w50 vDelayTime
Gui, Add, UpDown, vMyUpDown Range0-20, %DelayTime%
Gui, Add, Text, x61 y37, Second delay before closing tournament
Gui, Add, Button, x5 w225 gEnableButton vEnableButton, Enable
Gui, Add, Button, x235 y60 gAbout, ?
Menu, Tray, NoStandard
Menu, Tray, Add, Reload, Reload
Menu, Tray, Add, Restore, Restore
Menu, Tray, Add, Exit, GuiClose
Gui, Submit
Gui, Show,, DebustifierAHK v0.7
KickMessage = MSG_TABLE_SIT_KICK ;This is the line we're looking for in the log file
hwnd = ;Handle of the window we're trying to Close
CurrentlyEnabled = 0
SetTimer, FileCheck, 5000
SetTimer, FileCheck, Off
return ;This is the end of the auto-execute section
EnableButton:
If (CurrentlyEnabled = 0) ;If it's disabled enable it
{
Gui, Submit, NoHide
IniWrite, %LogFolderPath%, debustifier.ini, LogFolder, Path ;Rewrite the path in the INI in case the user changed anything
SetTimer, FileCheck, On ;We use a timer to read the file as it changes
GuiControl, Text, EnableButton, Disable
CurrentlyEnabled = 1
}
Else
{
SetTimer, FileCheck, Off
GuiControl, Text, EnableButton, Enable
CurrentlyEnabled = 0
}
Return
Reload:
Reload
return
;--------------
Debustify()
{
global LogFolderPath, KickMessage, LogFolderPath, hwnd, DelayTime
static HwndList
SetBatchLines -1
;The string we're looking for looks something like this
;MSG_TABLE_SIT_KICK 005C043C ''
;We check each each of the lines we pull from the file
Loop, %LogFolderPath%\PokerStars.log.*,
{
Loop Read, %A_LoopFileFullPath%
{
hwnd =
If (InStr(A_LoopReadLine, KickMessage)) ;If we find the kick message a tourney has ended
{
hwnd := "0x" . SubStr(A_LoopReadLine, 20, 8) ;Put it in autoHotkey format, like "0x000F1939"
IfNotInString, HwndList, %hwnd% ;If we haven't found this tourney before continue
{
;add the handle to the comma separated list
HwndList .= hwnd ","
SleepTime := DelayTime * 1000
Sleep, %SleepTime% ;Sleep for however long the user desires before closing the tourney
WinKill, ahk_id %hwnd%,, 5
;PostMessage, 0x10, 0, 0,, ahk_id %hwnd% ;Close the window
}
}
}
}
}
;--------------
;This function/label compares the size of the file now to the last time it was checked
;If they're different the file has been updated and we need to scan for finished tournaments again
FileCheck:
TempSize = 0
Loop, %LogFolderPath%\PokerStars.log.*
TempSize += %A_LoopFileSize%
If (LastSize >= TempSize)
return
LastSize = %TempSize%
Debustify()
Return
;--------------
GuiClose: ;Store settings and exit
Gui, Submit
IniWrite, %LogFolderPath%, debustifier.ini, LogFolder, Path
IniWrite, %DelayTime%, debustifier.ini, LogFolder, DelayTime
ExitApp
Return
;--------------
GuiSize: ;Minimize the GUI to the System Tray
If (A_EventInfo = 1) ;Check if they clicked the minimize button (1=Yes)
{
GuiWidth:=A_GuiWidth
GuiHeight:=A_GuiHeight
WinGetPos, GuiX, GuiY, , , Debustifier, , ,
If (GuiWidth = 0) && If (GuiHeight = 0) && If (GuiX = -32000) && If (GuiY = -32000)
Gui, 1:Hide
}
Return
;--------------
Restore: ;Label for the 'Restore' item in the system tray context menu
Gui, 1:Show
Return
;--------------
FolderSelect:
SetTimer, FileCheck, Off
GuiControl, Text, EnableButton, Enable
CurrentlyEnabled = 0
If A_OSVersion in WIN_VISTA
FileSelectFolder, SelectedFolder, *%A_AppData%\Pokerstars\,, Select the folder with the Pokerstars.log.* files
Else
FileSelectFolder, SelectedFolder, *%ProgramFiles%\Pokerstars\,, Select the folder with the Pokerstars.log.* files
Folder := RegExReplace(Folder, "\\$") ; Removes the trailing backslash, if present.
If SelectedFolder <> ;the user selected a folder
{
IfExist, %SelectedFolder%\PokerStars.log.*
{
GuiControl,, LogFolderPath, %SelectedFolder%
LogFolderPath := SelectedFolder
}
}
Gui, Submit, NoHide
return
About:
Msgbox,, About,
(
If you like this program please consider donating a few dollars to DrunkElf3141 on PokerStars.
Donations keep me motivated to provide support and fixes. If you have any problems or find any bugs
message me. I'm Entropic on the www.twoplustwo.com forums.
Using this program is simple:
- The selected folder won't change unless it contains a PokerStars log file (PokerStars.log.*)
- Set the delay before closing a tournament to whatever you like
- Click "Enable" and it will begin working
If you don't know where the PokerStars log files are go to Start->Search and search your hard drive for PokerStars.log.* files
)
return