![]() |
|
#1
|
|||
|
|||
|
Okay, it seems to work (after almost crashing my computer when I got something wrong and it endlessly closed and re-opened all the tables [img]/images/graemlins/smile.gif[/img]). Wouldn't surprise me if there are a ton of bugs though (I told Sam he could optimize it [img]/images/graemlins/tongue.gif[/img]).
#Persistent SetTitleMatchMode, 2 ;____i forget why I used this, but don't want to break anything [img]/images/graemlins/smile.gif[/img] WinGet, lobby_id, ID, PartyPoker.com GroupAdd, tables, Good Luck ahk_class #32770 ;____used to minimize all the tables later game_type = full ;_____change this to "6max" if you want mine 6max ;_____chnage these to whatever you want: players_min_6max = 5 players_min_full = 10 players_max_6max = 6 players_max_full = 10 Gosub, OpenTables ;_____open the 10 tables SetTimer, CheckTables, 30000 ;______I figured it makes more sense to wait if somebody takes an open seat or whatever, thus 30 seconds return ;_____end of auto-execute section______ OpenTables: Critical ;______we don't want the CheckTables subroutine messing anything up table_number := id ;_____this will be blank the first time around; later it contains the number of tables already open ControlFocus, SysListView321, ahk_id%lobby_id% ;set focus to the ListView ControlGet, count, List, Count, SysListView321, ahk_id%lobby_id% ;____used below to break if we reach the end of the list before we find 10 tables ControlGet, focused, List, Count Focused, SysListView321, ahk_id%lobby_id% ;____we want to select the topmost row, ;_____so we just send %focused% amount of UP keystrokes: Loop, %focused% ControlSend, SysListView321, {UP}, ahk_id%lobby_id% Loop { ControlGet, players, List, Focused Col3, SysListView321, ahk_id%lobby_id% ;retrieve the contents of the 3rd column in the focused row (looks like 7/10 or whatever) StringRight, is_6max, players, 1 ;___if this is a 6max table this character will be "6" StringLeft, players, players, 2 ;____the two character from the left; will be either "10" or something like 9/ IfInString, players, / ;if the table isn't full we have to get rid of the "/" StringTrimRight, players, players, 1 ;_____using the number of players / game_type we just retrieved and the min/max player numbers definded in the auto-execute section, ;_____ we check if we want this table: If (((game_type = "6max") AND (is_6max = 6 AND players >= players_min_6max AND players <= players_max_6max)) OR ((game_type = "full") AND (is_6max <> 6 AND players >= players_min_full AND players <= players_max_full))) { ControlSend, SysListView321, {Enter}, ahk_id%lobby_id% ;_____if yes, send an enter keystroke to open it If ErrorLevel = 0 ;_____if we could open it, increase table_number by 1 (used below to break) table_number++ } ControlSend, SysListView321, {DOWN}, ahk_id%lobby_id% ;_____move to the next table If (table_number >= 10 OR a_index > count) ;____if we reach 10 tables or the end of the list, break break } WinMinimize, ahk_group tables ;_____minimize all the tables (mine get (censored) up if I leave them all maximised for too long) return CheckTables: ;_____check if we still like the tables id = 0 ;_____not sure about this array here but just in case... WinGet, id, List, Good Luck ahk_class #32770, , PartyPoker.com ;_____make a list of all the party tables, excluding Lobby If id < 10 ;_____if we have less then 10, open some (table_number in the OpenTables thread is set to %id% { Gosub, OpenTables return } Loop, %id% ;if we have 10 open, check them { StringTrimRight, this_id, id%a_index%, 0 ;_____access array WinGetTitle, title, ahk_id%this_id% ;_____retrieve the name of this table as shown in the lobby StringGetPos, pos, title, - StringLeft, title, title, %pos% StringTrimRight, title, title, 2 ControlGet, list, List, , SysListView321, ahk_id%lobby_id% ;______probably not the most elegant way to do it, but what the hell; just get all the info and parse it Loop, Parse, List, `n ;____(each row ends in a linefeed) { IfInString, a_loopfield, %title% { StringGetPos, pos_tab3, a_loopfield, %A_Tab%, L3 ;____if we find the title, retrieve the number of players StringGetPos, pos_tab2, a_loopfield, %A_Tab%, L2 StringLeft, players, a_loopfield, %pos_tab3% StringTrimLeft, players, players, % pos_tab2+1 StringLeft, players, players, 2 IfInString, players, / StringTrimRight, players, players, 1 ;______kinda like reversing the expression in the other thread; now we're checking if it DOESN'T suit us If (((game_type = "6max") AND (players < players_min_6max OR players > players_max_6max)) OR ((game_type = "full") AND (players < players_min_full OR players > players_max_full))) { WinClose, ahk_id%this_id% ;_____if we don't like it, close it { WinWaitClose, ahk_id%this_id% ;_____wait till it has closed id = 9 ;____since we got this far, we have to have 9 tables open (after closing number 10); another "just in case" or whatever Gosub, OpenTables ;____open a new table } } } } } return edit: Changed title to reflect new (goofy) name. -Sam |
|
|