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 05-01-2006, 04:58 AM
Sandra Bullett Sandra Bullett is offline
Senior Member
 
Join Date: Mar 2006
Posts: 135
Default Compacting Party Planner Slots

I like PartyPlanner, but I wish it had what I call "Compaction". Basically moving tables into earlier empty slots. Furthermore, I like to have all the tables that I am playing on appear in the early slots, then those tables I am waitlisted on, then any other dross tables that I am just observing (Mogobu called this "Bubbling").

In the absence of this feature (yet!) in PartyPlanner, I have written a small AHK program. It is not a great program (slow, intermittently fails, somewhat intrusive in that it moves the mouse), but it basically does work. When it does sometimes fail (due to Windows not being responsive enough), simply pressing the hotkey again usually does the job (ie. no harm is done).

With those caveats, here's the code. Feel free to enjoy, improve, and beat up Mogobu to put something FAR more efficient into his program.

<font class="small">Code:</font><hr /><pre>

;
; Compacts the PartyPlayer Slots, 'Bubbling' Playing tables ahead of Waitlisted, ahead of just Observed tables, ahead of Empty Slots.
; Originally by: Sandra Bullett, April 2006
; Version 1.0
; No rights reserved.

; Compacts Party Poker's tables only, ie. does not touch the lobby.
; Compacts tables I am Playing on to the first slots (numerically, by their Fill Order number), then Waitlisted tables, then Observed (ie. all others).
; I call these "Modes", ie. Playing mode, Waitlisted mode, Observed mode and Empty Slot mode.

; Within each Mode, table sequences are maintained, ie. if before Compaction Play Table A is in a lower slot number than Play Table B,
; then it will still be so after Compaction. This applies within all Modes.

; This is only the 4th AHK script I've written; no doubt experienced AHK'ers could improve upon it. At least it works! (mostly)

; The secondary purpose of this script is to shame Mogobu into adding this functionality to PartyPlanner itself (where it could be done FAR more efficiently).

; WARNINGS:
; This script moves the mouse - so HANDS OFF while executing it
; (I suggest you use a hotkey that'll be pressed by your mouse hand, eg. F12 if you're right-handed).
; Requires all the tables to be visible (eg. not Minimised nor covered with other windows).


;----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
; START OF USER-CONFIGURABLE VARIABLES
;----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

F12:: ; Triggered by an F12 hotkey.


; If your machine is slow &amp;/or over-loaded, mouse actions (movements and drag/drops) might 'miss', and the Compaction won't be completed properly.
; Increase the delays below to increase reliability (by slowing the mouse down). For the first two delays, 0 is fastest (no delay), 10 is sedate, 20 is slow.
; If a single Compaction doesn't work properly, just press the hotkey again. It'll eventually get it right (a failed Compaction doesn't cause any harm).

MoveDelay := 1 ; How quickly the mouse moves from window to window. The least likely to need changing of these three delays.
DragDelay := 4 ; How quickly the mouse drags windows.
SetMouseDelay, 50 ; In milliseconds, the sleep time after each mouse action, to give the operating system time to react before doing the next.


; Following are the hard-coded slot coordinates for MY normal playing configuration. Change them if yours are different (as they're very likely to be).
; You can find out your coordinates by having 10 tables open, &lt;ctrl-PrintScreen&gt;, paste into Paint, which tells you the coordinates of the mouse as you move it.
; Use approximately the position of the 2nd or 3rd letter of table name on title bar (as the mouse has to be able to drag and drop the windows).

; The slot numbers in this script are numbered from 1 to 10, regardless of the Fill Numbers you assigned in PartyPlanner (merely sequenced with).

SlotX1 := 45 ; These are the coordinates for your lowest Fill Order slot (ie. the first slot filled). Subsequent coordinates are they successively later filled slots.
SlotY1 := 13

SlotX2 := 550
SlotY2 := 13

SlotX3 := 1060
SlotY3 := 13

SlotX4 := 45
SlotY4 := 392

SlotX5 := 550
SlotY5 := 392

SlotX6 := 1060
SlotY6 := 392

SlotX7 := 45
SlotY7 := 769

SlotX8 := 550
SlotY8 := 769

SlotX9 := 1060
SlotY9 := 769

SlotX10 := 1628
SlotY10 := 8

;----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
; END OF USER CONFIGURABLE VARIABLES
;
; If you wish to change the Bubbling sequence (eg. so Playing tables go in the last slots, or so Waitlisted and Observed are the same Mode),
; that is fairly easy. But I haven't bothered parameterising these as I'm happy enough with the existing sequence.
; (and I'm hoping Mobobu will SHORTLY be rendering this script obsolete by providing a "Compact" function within PartyPlanner)
;----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


CoordMode, Mouse, Screen
GoodLuck := "Good Luck" ; all PartyPoker tables contain this is their title bar (needed to detect empty slots).
LobbyTitle := "PartyPoker.com:"

MouseGetPos, OriginalMousePosX, OriginalMousePosY ; Stores the original mouse position, to restore it to afterwards.

Loop, 10 ; Initialise array. Empty slots don't have controls to test against, and repeated executions of this script need variables re-initialised..
{
SlotTitle%A_Index% := "Empty Slot"
SlotMode%A_Index% := 9
SlotToMoveTo%A_Index% =
}

Loop, 10
{
; Get the name of each table in each slot.
MouseClick, left, SlotX%A_Index%, SlotY%A_Index%,1,%MoveDelay%
WinGetActiveTitle, SlotTitle%A_Index%
Title := SlotTitle%A_Index%
StringGetPos, Pos, Title, %GoodLuck%
If Pos = -1
{
Title := "Empty Slot"
SlotTitle%A_Index% := Title
SlotMode%A_Index% := 9
continue
}

; and whether it is in Monitoring, Waitlisted or Playing modes.
; Playing = Mode 1, Waitlisted = 2, Observing = 3 (and already Empty = 9)
; This is the sort sequence, ie. Playing tables first, then Waiting, then Observed, and Empty end up last.

SlotMode%A_Index% := 3 ; There is a table, so at least Observing mode

ControlGet, ControlFound, Visible, , Unjoin Wait List, %Title%
If ControlFound = 1
SlotMode%A_Index% := 2 ; on Wait List mode
; Small warning: Party's software can take several seconds to toggle the Join/Unjoin Wait List button. Time your Compactions carefully.

ControlGet, ControlFound, Visible, , Auto Post Blind, %Title%
If ControlFound = 1
SlotMode%A_Index% := 1 ; in Playing mode.
}

; Now have the list of every table, its title and mode
; Calculate which slot every table should be moved into.

Destination := 1
ProcessMode(1) ; Assign Destination Slots to each successive Play table.
ProcessMode(2) ; Assign Destination Slots to each successive Waitlisted table.
ProcessMode(3) ; Assign Destination Slots to each successive Observed table.

Loop, 9 ; Find the table to move into each of the 10 Destination slots (if the first 9 are in their correct slot, number 10 must be too).
{
Destination = %A_Index% ; Look for the table that wants to go to this Destination
; MsgBox Looking for the table to move to destination %Destination%
Source := Destination - 1 ; Search for which table should be in the Destination from the Destination until found (always will be).
Loop
{
Source := Source + 1
If Source &gt; 10
break

SlotToMoveTo := SlotToMoveTo%Source%
If SlotToMoveTo is not integer ; Means source slot is currently empty, so doesn't want to move anywhere.
continue ; Look at next source slot.

If Destination = %SlotToMoveTo% ; Have found the table we want to move into this Destination.
{
; MsgBox Source %Source% wants to move to slot %SlotToMoveTo%
If Source = %Destination% ; Nothing to do
break

SourceX := SlotX%Source%
SourceY := SlotY%Source%

DestinationX := SlotX%Destination%
DestinationY := SlotY%Destination%

SourceTitle := SlotTitle%Source%
SourceMode := SlotMode%Source%
SourceSlotToMoveTo := SlotToMoveTo%Source%

DestinationTitle := SlotTitle%Destination%
DestinationMode := SlotMode%Destination%
DestinationSlotToMoveTo := SlotToMoveTo%Destination%

; Do the swop
WinActivate, %LobbyTitle% ; AHK won't drag a window if it is already the active one, so activate the main lobby.
MouseMove, 0, 30, %MoveDelay%, R
; AHK seems to dislike dragging if the mouse was already on the place to start dragging from, so have to move it away first.
Sleep, 25 ; Windows really does seem to need help getting ready to do a simple drag.
MouseClickDrag, Left, %SourceX%,%SourceY%,%DestinationX%,%DestinationY%, %DragDelay%
SlotTitle%Source% := DestinationTitle
SlotMode%Source% := DestinationMode
SlotToMoveTo%Source% := DestinationSlotToMoveTo
SlotTitle%Destination% := SourceTitle
SlotMode%Destination% := SourceMode
SlotToMoveTo%Destination% := SourceSlotToMoveTo
break
}
}
}

MouseMove, %OriginalMousePosX%, %OriginalMousePosY% ; Restore the mouse position to before the script was executed.
exit

ProcessMode(DoingMode)
{
global

; Look for the first slot with a table mode = DoingMode, and give it the current Destination slot.
Loop, 10
{
Source = %A_Index%
If SlotMode%Source% = %DoingMode%
{
SlotToMoveTo%Source% = %Destination% ; This table should move to the current Destination slot.
Destination := Destination +1 ; The next table found will go into the next Destination slot.
}
}
}

</pre><hr />
Reply With Quote
  #2  
Old 05-01-2006, 07:39 PM
Mogobu The Fool Mogobu The Fool is offline
Senior Member
 
Join Date: Sep 2005
Location: On teh internets.
Posts: 617
Default Re: Compacting Party Planner Slots

I feel duly clubbed over the head, but I've got VIP bonus I'd like to try to hit. . . I promise to start coding again after Midnight on next Wednesday, OK?
Reply With Quote
  #3  
Old 05-01-2006, 10:09 PM
Sandra Bullett Sandra Bullett is offline
Senior Member
 
Join Date: Mar 2006
Posts: 135
Default Re: Compacting Party Planner Slots

You'd think that with all the money I paid for PartyPlanner I could expect instant software upgrades! Wait a minute....

Take you time, earn your bonus, rest up, then back to coding.
Reply With Quote
  #4  
Old 05-02-2006, 02:54 AM
sui generis sui generis is offline
Senior Member
 
Join Date: Dec 2005
Posts: 511
Default Re: Compacting Party Planner Slots

pfftt poker.

-eric
Reply With Quote
  #5  
Old 05-02-2006, 05:13 AM
Sandra Bullett Sandra Bullett is offline
Senior Member
 
Join Date: Mar 2006
Posts: 135
Default Re: Compacting Party Planner Slots

[ QUOTE ]
pfftt poker

[/ QUOTE ]

?
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 08:59 PM.


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