Open Side Menu Go to the Top
Register
PokerStars Debustifier 0.7 (Donationware) PokerStars Debustifier 0.7 (Donationware)

03-29-2009 , 12:56 AM
This should fix all the problems I know of.

Please donate a few dollars to DrunkElf3141 if you'd like to support this program. It helps motivate me to keep it updated since I haven't been playing poker much in the last few months.
Thank you so much to all of you who donated!!


Changes:
- Now you just select the folder 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.
- If you never used this before you need AutoHotKey. 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
PokerStars Debustifier 0.7 (Donationware) Quote
03-29-2009 , 11:12 AM


Can't tell you how much I appreciate your work, been using this since the 1st release. I'll give it a whirl with 20 tables once I get back from the morning run.
PokerStars Debustifier 0.7 (Donationware) Quote
03-30-2009 , 08:21 PM
can you explain why does "loop, read" style work so much faster than the previous method of the tail function? i would assume the former was faster as the message is usually near the end.
PokerStars Debustifier 0.7 (Donationware) Quote
03-30-2009 , 09:45 PM
I did some tests using code similar to this below on a file with 130,000 lines:
Code:
script_begin:
StartTime := A_TickCount  ;Start timer here.

; put your code (or call the subroutine or function) to be timed here

ElapsedTime := A_TickCount - StartTime   ;Monitor timer here
MsgBox,  %ElapsedTime% milliseconds have elapsed.
A_TickCount is accurate to 10ms which was good enough for me, there's also QueryPerformanceCounter() which is more accurate.

The reason that the Loop, read style is faster is it only reads through the file once and doesn't require multiple variable assignments each step. The Tail() function still has to read through the whole file and it requires multiple variable assignments for each step, although Laszlo did use a very clever use of the Mod() function to get the last lines.

With the Loop, read style we read through the whole file but it doesn't require any extra variable assignments if the line doesn't contain something like MSG_TABLE_SIT_KICK 005C043C ''


Also, before it would check for changes to the file every 250ms and if changes were made it would call the Tail() function and then the Debustify() function. Now it just checks every 5 seconds which reduces the the Disk I/O and processor time a lot.

If that wasn't clear let me know, I'm sick and a little out of it from the Nyquil.
PokerStars Debustifier 0.7 (Donationware) Quote
03-30-2009 , 11:29 PM
perfectly clear, thanks for taking the time to respond
PokerStars Debustifier 0.7 (Donationware) Quote
04-02-2009 , 11:00 AM
How can I modify this so that it is Enabled by default once the script is started?
PokerStars Debustifier 0.7 (Donationware) Quote
04-02-2009 , 04:40 PM
Add this line
Code:
GoSub, EnableButton
right after this lines
Code:
SetTimer, FileCheck, Off
So the relevant section should look like this
Code:
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

GoSub, FileCheck                         ;THE NEW LINE

return		;This is the end of the auto-execute section
PokerStars Debustifier 0.7 (Donationware) Quote
04-03-2009 , 07:40 AM
When I copy the code and paste into a text file, none of the formatting stays. I have to go through each line and set it up like you have it listed. Is there something that I'm missing or is this standard?
PokerStars Debustifier 0.7 (Donationware) Quote
04-03-2009 , 08:01 AM
what does this script do?
PokerStars Debustifier 0.7 (Donationware) Quote
04-03-2009 , 08:23 AM
It closes tables when you bust out.
PokerStars Debustifier 0.7 (Donationware) Quote
04-03-2009 , 02:07 PM
Quote:
Originally Posted by Sprayed
When I copy the code and paste into a text file, none of the formatting stays. I have to go through each line and set it up like you have it listed. Is there something that I'm missing or is this standard?
Figured it out. I had to use Internet Explore instead of Firefox in order for it to copy correctly.
PokerStars Debustifier 0.7 (Donationware) Quote
04-03-2009 , 02:08 PM
Is it odd that my PokerStars.log.0 file is in my PokerStars folder under program files instead of anywhere else?
PokerStars Debustifier 0.7 (Donationware) Quote
04-03-2009 , 04:45 PM
Nah that's normal if you're running XP. If you were running Vista in would be in the Users\AppData\ folder.
PokerStars Debustifier 0.7 (Donationware) Quote
04-03-2009 , 10:55 PM
Quote:
Originally Posted by Entropic
Nah that's normal if you're running XP. If you were running Vista in would be in the Users\AppData\ folder.
That's why I was asking. I'm running Vista and this file is in my pokerstars folder and not under Users\etc.
PokerStars Debustifier 0.7 (Donationware) Quote
04-03-2009 , 11:38 PM
Hmm, it might be an option in the Pokerstars installer, or did you do an Upgrade to Vista rather than a format & reinstall?

I haven't seen it in Program Files before but it shouldn't cause any issues aside from maybe having to allow it to write there with Vista's UAC.

Is it working for you?
PokerStars Debustifier 0.7 (Donationware) Quote
04-04-2009 , 07:44 AM
For some reason I can get v0.3 to work fine, but v0.7 wont work...

any ideas?

Quote:
[LogFile]
Path=C:\Users\xxx\AppData\Local\Pokerstars\PokerSt ars.log.0
DelayTime=5
[LogFolder]
Path=C:\Users\xxx\AppData\Local\Pokerstars\
DelayTime=5
PokerStars Debustifier 0.7 (Donationware) Quote
04-04-2009 , 10:36 AM
well you've got a space there in your log file path
PokerStars Debustifier 0.7 (Donationware) Quote
04-04-2009 , 10:40 AM
Quote:
Originally Posted by Hood
well you've got a space there in your log file path
my bad, must have slipped on the keyboard or something while pasting, thats for the 0.3 version that works anyways :/
PokerStars Debustifier 0.7 (Donationware) Quote
04-05-2009 , 01:21 PM
Quote:
Originally Posted by Entropic
Hmm, it might be an option in the Pokerstars installer, or did you do an Upgrade to Vista rather than a format & reinstall?

I haven't seen it in Program Files before but it shouldn't cause any issues aside from maybe having to allow it to write there with Vista's UAC.

Is it working for you?
Yes it works but not when I stack several tables. The table has to be visible and then the table will close.
PokerStars Debustifier 0.7 (Donationware) Quote
04-05-2009 , 05:34 PM
Disregard my last. It works when stacked. Nice script. Thanks!
PokerStars Debustifier 0.7 (Donationware) Quote
04-05-2009 , 06:12 PM
Cool, glad it works! I couldn't think of anything that would cause it to fail only when tables were stacked.
PokerStars Debustifier 0.7 (Donationware) Quote
04-06-2009 , 08:55 PM
I can't get this to work. I just got a new computer, installed some stuff and then pstars and debustifer and with the play money tables I have tried so far it does not work.

[LogFolder]
Path=C:\Users\Alex\appdata\Local\PokerStars\
DelayTime=2

Am I doing something wrong?
PokerStars Debustifier 0.7 (Donationware) Quote
04-06-2009 , 09:19 PM
well now the search feature finally found the log file when I typed in pokerstars.log, and the first attempt since worked.

so, nvm.
PokerStars Debustifier 0.7 (Donationware) Quote
04-06-2009 , 09:32 PM
ok not working again
PokerStars Debustifier 0.7 (Donationware) Quote
04-06-2009 , 10:55 PM
I'm not sure, I just tested it on 3 play money tables and it worked for me. Are you giving it a few seconds to close the tournament? With a 2 second delay it could take up to 7 second to close the table in total.

You just have to specify the folder that has the PokerStars.log.* files. It should be C:\Users\Alex\appdata\Local\PokerStars\ . Maybe the user access controls in vista don't allow the program to read the file? I'm not sure.
PokerStars Debustifier 0.7 (Donationware) Quote

      
m