Two Plus Two Newer Archives  

Go Back   Two Plus Two Newer Archives > Internet Gambling > Software
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 09-04-2006, 03:27 PM
jukofyork jukofyork is offline
Senior Member
 
Join Date: Sep 2004
Location: Leeds, UK.
Posts: 2,551
Default Anybody have Table Layout AHK script?

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]
Reply With Quote
  #2  
Old 09-04-2006, 04:14 PM
Roland Roland is offline
Senior Member
 
Join Date: Mar 2005
Location: Norwich, UK
Posts: 2,703
Default Re: Anybody have Table Layout AHK script?

This might help:

SysGet, sw, 78 ;SM_CXVIRTUALSCREEN
SysGet, sh, 79 ;SM_CYVIRTUALSCREEN
Reply With Quote
  #3  
Old 09-04-2006, 04:48 PM
jukofyork jukofyork is offline
Senior Member
 
Join Date: Sep 2004
Location: Leeds, UK.
Posts: 2,551
Default Re: Anybody have Table Layout AHK script?

[ 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.
Reply With Quote
  #4  
Old 09-04-2006, 05:31 PM
Roland Roland is offline
Senior Member
 
Join Date: Mar 2005
Location: Norwich, UK
Posts: 2,703
Default Re: Anybody have Table Layout AHK script?

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
Reply With Quote
  #5  
Old 09-04-2006, 05:43 PM
jukofyork jukofyork is offline
Senior Member
 
Join Date: Sep 2004
Location: Leeds, UK.
Posts: 2,551
Default Re: Anybody have Table Layout AHK script?

[ 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]
Reply With Quote
  #6  
Old 09-04-2006, 06:45 PM
Sandra Bullett Sandra Bullett is offline
Senior Member
 
Join Date: Mar 2006
Posts: 135
Default Re: Anybody have Table Layout AHK script?

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 &gt; 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 />
Reply With Quote
  #7  
Old 09-04-2006, 09:18 PM
jukofyork jukofyork is offline
Senior Member
 
Join Date: Sep 2004
Location: Leeds, UK.
Posts: 2,551
Default Re: Anybody have Table Layout AHK script?

[ 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 &gt; 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]
Reply With Quote
  #8  
Old 09-05-2006, 02:07 PM
jukofyork jukofyork is offline
Senior Member
 
Join Date: Sep 2004
Location: Leeds, UK.
Posts: 2,551
Default Re: Anybody have Table Layout AHK script?

[ 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 &gt; 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]
Reply With Quote
  #9  
Old 09-05-2006, 02:12 PM
APerfect10 APerfect10 is offline
Senior Member
 
Join Date: Jan 2005
Location: PokerTracker 3
Posts: 979
Default Re: Anybody have Table Layout AHK script?

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...
Reply With Quote
  #10  
Old 09-05-2006, 02:17 PM
jukofyork jukofyork is offline
Senior Member
 
Join Date: Sep 2004
Location: Leeds, UK.
Posts: 2,551
Default Re: Anybody have Table Layout AHK script?

[ 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]
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:29 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.