![]() |
#1
|
|||
|
|||
![]()
Hi, just got a new monitor and trying to lay tables out over 2 monitors while multitabling isn't so easy (I've got AllSnap, but missing PartyPlanner...). Just wondered if anybody has made a AHK script to help laying out tables (a bit like PartyPlanner, but not just for Party/Empire?).
I just checked the list of scripts at overcards and couldn't see one which did this. If anybody has anything like this handy (or any code snippets which might help) then it would save me from having to write it from scratch and I'd be very grateful [img]/images/graemlins/smile.gif[/img] Juk [img]/images/graemlins/smile.gif[/img] |
#2
|
|||
|
|||
![]()
This might help:
SysGet, sw, 78 ;SM_CXVIRTUALSCREEN SysGet, sh, 79 ;SM_CYVIRTUALSCREEN |
#3
|
|||
|
|||
![]()
[ QUOTE ]
This might help: SysGet, sw, 78 ;SM_CXVIRTUALSCREEN SysGet, sh, 79 ;SM_CYVIRTUALSCREEN [/ QUOTE ] Cool, I seen a function like this using Win32 API in the MSDN docs, but wasn't sure how to do in AHK. My plan is to try to make it as simple as possible though, as I don't need to resize the tables and I can maybe just make a list of 'slots' for positioning the top left of each window (and hard code these in to the script via constants). I then just check each window is in a slot position by comparing it's top left to all the slot coords, and if it's not in a slot position, I move it to the first available one. Not sure if it will this easy yet, but gonna give it a try. Juk [img]/images/graemlins/smile.gif[/img] PS: On another note, whats the magic command to minimize a window to the tray (for an app which is setup to do this on it's own). If I send WinMinimize to the type of apps it doesn't work, and I remember you once posted the AHK for this, but couldn't find in a search. |
#4
|
|||
|
|||
![]()
Should be easy enough.
[ QUOTE ] On another note, whats the magic command to minimize a window to the tray (for an app which is setup to do this on it's own). [/ QUOTE ] PostMessage, 0x112, 0xF020 |
#5
|
|||
|
|||
![]()
[ QUOTE ]
[ QUOTE ] On another note, whats the magic command to minimize a window to the tray (for an app which is setup to do this on it's own). [/ QUOTE ] PostMessage, 0x112, 0xF020 [/ QUOTE ] Thanks (I did try searching but forgot it was a postmessage!). Juk [img]/images/graemlins/smile.gif[/img] |
#6
|
|||
|
|||
![]()
I have a few variations on the following. I wrote them when PP's memory leak was stressing me badly, and PartyPlanner 'seemed' to be making it worse.
Since then I've been using the Black.zip table mod, and that's helped quite a lot, so I'm back to using PartyPlanner. This may be of some use to you (note, the "xxxxxx" in the TitleBarContains variable, is your user name): <font class="small">Code:</font><hr /><pre> ; ; Minimises non-played tables; Maximises and arranges played tables (ideally only 4 of them) ; ; Runs continually ; CycleTime = 5000 ; How many milliseconds between checks of table positions SetTitleMatchMode = 2 ; Contains TitleBarContains := "Good Luck xxxxxxxx!" ; This text is unique to tables (excludes the lobby too). LobbyTitle := "PartyPoker.com: Poker Lobby" PosX1 = 0 PosY1 = 0 PosX2 = 800 PosY2 = 0 PosX3 = 0 PosY3 = 580 PosX4 = 800 PosY4 = 580 PosX5 = 1600 PosY5 = 0 PosX6 = 1620 PosY6 = 20 PosX7 = 1640 PosY7 = 40 Loop { id = WinGet, id, list,,, Program Manager Counter=0 ; How many played tables found so far List = Loop, %id% { StringTrimRight, this_id, id%a_index%, 0 WinGetTitle, this_title, ahk_id %this_id% IfNotInString, this_title, %TitleBarContains% continue ; Have found a table, so either minimise it or arrange it. ControlGet, ControlFound, Visible, , Auto Post Blind, %this_title% If ControlFound = 1 { Counter := Counter + 1 List = %List%%this_title%`n } else { WinMinimize, %this_title% } } WinRestore, %LobbyTitle% If Counter > 0 { Sort, List Loop, Parse, List, `n { this_title = %A_LoopField% WinMaximize, %this_title% WinMove, %this_title%,, PosX%A_Index%, PosY%A_Index% } } Sleep, %CycleTime% } </pre><hr /> |
#7
|
|||
|
|||
![]()
[ QUOTE ]
I have a few variations on the following. I wrote them when PP's memory leak was stressing me badly, and PartyPlanner 'seemed' to be making it worse. Since then I've been using the Black.zip table mod, and that's helped quite a lot, so I'm back to using PartyPlanner. This may be of some use to you (note, the "xxxxxx" in the TitleBarContains variable, is your user name): <font class="small">Code:</font><hr /><pre> ; ; Minimises non-played tables; Maximises and arranges played tables (ideally only 4 of them) ; ; Runs continually ; CycleTime = 5000 ; How many milliseconds between checks of table positions SetTitleMatchMode = 2 ; Contains TitleBarContains := "Good Luck xxxxxxxx!" ; This text is unique to tables (excludes the lobby too). LobbyTitle := "PartyPoker.com: Poker Lobby" PosX1 = 0 PosY1 = 0 PosX2 = 800 PosY2 = 0 PosX3 = 0 PosY3 = 580 PosX4 = 800 PosY4 = 580 PosX5 = 1600 PosY5 = 0 PosX6 = 1620 PosY6 = 20 PosX7 = 1640 PosY7 = 40 Loop { id = WinGet, id, list,,, Program Manager Counter=0 ; How many played tables found so far List = Loop, %id% { StringTrimRight, this_id, id%a_index%, 0 WinGetTitle, this_title, ahk_id %this_id% IfNotInString, this_title, %TitleBarContains% continue ; Have found a table, so either minimise it or arrange it. ControlGet, ControlFound, Visible, , Auto Post Blind, %this_title% If ControlFound = 1 { Counter := Counter + 1 List = %List%%this_title%`n } else { WinMinimize, %this_title% } } WinRestore, %LobbyTitle% If Counter > 0 { Sort, List Loop, Parse, List, `n { this_title = %A_LoopField% WinMaximize, %this_title% WinMove, %this_title%,, PosX%A_Index%, PosY%A_Index% } } Sleep, %CycleTime% } </pre><hr /> [/ QUOTE ] Hey, thanks (this looks pretty much what I need and should be able to adapt it quite quickly). Juk [img]/images/graemlins/smile.gif[/img] |
#8
|
|||
|
|||
![]()
[ QUOTE ]
[ QUOTE ] I have a few variations on the following. I wrote them when PP's memory leak was stressing me badly, and PartyPlanner 'seemed' to be making it worse. Since then I've been using the Black.zip table mod, and that's helped quite a lot, so I'm back to using PartyPlanner. This may be of some use to you (note, the "xxxxxx" in the TitleBarContains variable, is your user name): <font class="small">Code:</font><hr /><pre> ; ; Minimises non-played tables; Maximises and arranges played tables (ideally only 4 of them) ; ; Runs continually ; CycleTime = 5000 ; How many milliseconds between checks of table positions SetTitleMatchMode = 2 ; Contains TitleBarContains := "Good Luck xxxxxxxx!" ; This text is unique to tables (excludes the lobby too). LobbyTitle := "PartyPoker.com: Poker Lobby" PosX1 = 0 PosY1 = 0 PosX2 = 800 PosY2 = 0 PosX3 = 0 PosY3 = 580 PosX4 = 800 PosY4 = 580 PosX5 = 1600 PosY5 = 0 PosX6 = 1620 PosY6 = 20 PosX7 = 1640 PosY7 = 40 Loop { id = WinGet, id, list,,, Program Manager Counter=0 ; How many played tables found so far List = Loop, %id% { StringTrimRight, this_id, id%a_index%, 0 WinGetTitle, this_title, ahk_id %this_id% IfNotInString, this_title, %TitleBarContains% continue ; Have found a table, so either minimise it or arrange it. ControlGet, ControlFound, Visible, , Auto Post Blind, %this_title% If ControlFound = 1 { Counter := Counter + 1 List = %List%%this_title%`n } else { WinMinimize, %this_title% } } WinRestore, %LobbyTitle% If Counter > 0 { Sort, List Loop, Parse, List, `n { this_title = %A_LoopField% WinMaximize, %this_title% WinMove, %this_title%,, PosX%A_Index%, PosY%A_Index% } } Sleep, %CycleTime% } </pre><hr /> [/ QUOTE ] Hey, thanks (this looks pretty much what I need and should be able to adapt it quite quickly). Juk [img]/images/graemlins/smile.gif[/img] [/ QUOTE ] Just to say thanks for posting this script. I managed to addapt it pretty easily (saving me alot of time!) and it works sweet! Thanks again - Juk [img]/images/graemlins/smile.gif[/img] |
#9
|
|||
|
|||
![]()
Just an FYI (not to be picky) but you should really use SetTimer rather than an infinite loop and sleeps. It'll be much more efficient...
|
#10
|
|||
|
|||
![]()
[ QUOTE ]
Just an FYI (not to be picky) but you should really use SetTimer rather than an infinite loop and sleeps. It'll be much more efficient... [/ QUOTE ] On a related question: If you just have a single thread like this, and you call SetTimer in the init part of the AHK script, how do you stop the init part of the script from falling through and exiting? I was hoping something like "Sleep 0" might do a pause forever, but no luck. Juk [img]/images/graemlins/smile.gif[/img] |
![]() |
|
|