Thois TableOpener for PokerStars
Opens new cash game tables from the lobby every x seconds (if there are less tables opened than your predefined setting). It starts with the top table of of the lobby (so it respects you table sorting order) and then goes all the way down the list dependable on how many tables are needed. Your mouse cursor is not affected (simulated clicks thanks to Yuk's PostLeftClick function), so no annoyances. A great tool for multi-tablers.
Customizable variables:
- Number of tables to keep open, default = 18
- Text size of the lobby, default = medium
- How often the script should do a recheck (and open new tables if needed), default = 10 seconds
Hotkeys (disabled, remove the ';' marks to re-enable):
These work great, To me, they are essential. I disabled them because they aren't really a part of the script's main goal and they might interfere with other hotkeys in other scripts that you have in use.
- Bottom thumb mouse button: Endlessly cycle between all tables in the table stack the cursor is pointing at (moves the front table to the back).
- Top thumb mouse button: Closes the table the mouse is pointing at (also clicks the OK warning button).
Pausing the script:
Sometimes you want to temporarily stop the script from opening new tables, in the future I will add a GUI with a button that does this (pause button). In the meantime you will have to right-click the script's icon in your taskbar and press 'Pause script'.
Opening tables that are already opened:
Sometimes it takes a while for the script to finally reach your table goal, because it might try to open tables that are already open (for example: when the lobby's sorting order suddenly changes while opening tables). I will try to come up with a solution for this, maybe you have an idea.
Extra information:
I have beta-tested the script, and evaluated it as strong enough for release, I like it. I would like to hear about your experiences with this script. I might add some extra features in the future, if you think you can improve the script, please do so. 'Thois' on PS for donations
Code:
; Thois TableOpener for PokerStars v0.90
; Opens new cash game tables from the lobby every x seconds (if there are less tables opened than your predefined settings). A great tool for multi-tablers.
; Customize the variables below (between the lines)
; 'Thois' on PS for donations
; Customizable variables (between the lines)
;------------------------------------------
numberoftablestokeepopen := 18 ;How many tables do you want to play?
rowheight := 13 ;In the PokerStars lobby go to View > Text Size: For Medium & smaller:13, For smallest:12, For Larger:15, For Largest:17
recheck := 50 ;How often the script should open up new tables (if needed), 50=10seconds, 25=5seconds etc... Try not to set this too low for CPU performance issues
;------------------------------------------
numberofloopinstances := recheck - 1
Loop
{
SendMessage, 0x115, 0, 0, PokerStarsListClass1, PokerStars Lobby
numberofloopinstances := numberofloopinstances + 1
if (numberofloopinstances = recheck)
{
numberofloopinstances := 0
WinGet, numberofwindows, Count, ahk_class PokerStarsTableFrameClass,,Lobby
beffen := numberoftablestokeepopen - numberofwindows
if (beffen > 0)
{
Loop, %beffen%
{
ControlGet, tablesinthelobby, Hwnd, , PokerStarsListClass1, PokerStars Lobby
yclick := 1 + (rowheight * A_Index) - rowheight
PostLeftClick(1, yclick, tablesinthelobby)
ControlClick, PokerStarsButtonClass10, PokerStars Lobby
Sleep, 500
}
}
}
Sleep, 200
}
; Hotkeys (disabled)
;~Xbutton1:: ;Endlessly cycles between all tables in the stack the cursor is pointing at (brings the front table to the back), disabled (remove ; marks to enable)
;MouseGetPos,,,tableID
;WinGetClass, classoftableid, ahk_id %tableID%
;if (classoftableid = "PokerStarsTableFrameClass")
; {
; WinSet, Bottom,, ahk_id %tableID%
; }
;return
;~Xbutton2:: ;Closes the table the mouse is pointing at (also clicks the OK warning button), disabled (remove ; marks to enable)
;MouseGetPos,,,tableID
;WinGetClass, classoftableid, ahk_id %tableID%
;if (classoftableid = "PokerStarsTableFrameClass");
; {
; WinClose, ahk_id %tableID%
; Sleep,20
; ControlClick, Button1, Table, OK
; }
;return
;Juks rocks - I deactivated WinActivate so that the Lobby doesnt steal focus
PostLeftClick(x, y, table_id, activate=1) {
; ### JUK: Send the down left click, then the mouse-up messages.
; NOTE: This is relative to the top left of the client area and NOT the top left of the
; window (ie: It *doesn't* include the title-bar like AHK's MouseClick does!!!).
If activate
; WinActivate, ahk_id%table_id%
PostMessage, 0x201, 0x0001, ((y<<16)^x), , ahk_id%table_id%
PostMessage, 0x202 , 0, ((y<<16)^x), , ahk_id%table_id%
}
Last edited by Thois; 11-09-2009 at 01:34 AM.