Open Side Menu Go to the Top
Register
New script: PartySNGHelper New script: PartySNGHelper

05-31-2008 , 10:02 AM
Quote:
Originally Posted by jukofyork
IIRC, somebody made a post about making a pay-ware one for Stars (about 2-3 months ago) and were asking what features people wanted.

Juk
oh right, i think that was sence. i'll ask him about it, but i'm guessing the project was given up.

do you think i could use your PSNGH code to build a stars compatible version ? i have no experience with ahk, but it looks like fairly basic code.
New script: PartySNGHelper Quote
05-31-2008 , 10:23 AM
Quote:
Originally Posted by holy32
do you think i could use your PSNGH code to build a stars compatible version ? i have no experience with ahk, but it looks like fairly basic code.
I think it'll be harder for Stars because they don't use standard widgets like Party do - you'll end up having to do lots of image matching, etc.

Juk
New script: PartySNGHelper Quote
07-31-2008 , 01:45 AM
What about fulltilt? Any chance to port psngh to work at fulltilt? Basically, I need only right-click check/fold, whell up/down bet sizing and all-in by wheel click.
New script: PartySNGHelper Quote
07-31-2008 , 07:46 AM
Quote:
Originally Posted by Flynn
What about fulltilt? Any chance to port psngh to work at fulltilt? Basically, I need only right-click check/fold, whell up/down bet sizing and all-in by wheel click.
I'm afraid I don't play at FT and have no idea about their software, but you can probably use _dave_'s BetPot script to do these three things.

Juk
New script: PartySNGHelper Quote
07-31-2008 , 08:06 AM
Ок, I'll try. Anyway, big thanks for party script. It helped me to play beyond my usual number of tables Those easy check/folds and all-ins are awesome
New script: PartySNGHelper Quote
08-31-2008 , 09:38 AM
Ok, so I was gonna think about re-designing PartySNGHelper after seeing what HighSteaks has done with his cash game tool, but after the recent announcement that Party is likely to be fiddling about with stuff soon I think I'll wait and see what they do first.

The main thing I want to fix is the F11 method of opening tables. This used to work fine when I played just one limit and there were less regulars about, but it's no longer all that useful for me.

From now on (when I'm finally fully rested from the "Free Ride" torture...) I plan to be playing 3-4 limits at the same time and will probably be rejecting about 40-50% of all registering tables I open. This is where the current F11 method falls down.

Ideally for the times when you want to reject a table, it would be nice to somehow remember the "Tournament ID" of every table you open along with the time it was last opened and make sure you don't reopen the table too soon after rejecting it. Party does reuse the IDs, but I'm sure a pause of 5-10 minutes would do the trick. I could also add a modified version (something like Ctrl+F11) which ignores the recently opened tables and will force them to be reopened (ie: the current method)... Can anybody see any huge problems with this?

Assuming I implement the code above then I think the current method of sorting the tables (via Party's own listboxes) using the limit as the secondary key and the number of players registered as the primary key will still be OK. I'm sure there will still be times that this won't be ideal (a juicy "reg-free" 55 with 7 registered gets opened after an 11 with 8 registered, etc). Can anybody think of another way to do this? How about a linear formula allowing you to weight the number of players registered and the limit to rank the tables?

Finally, I noticed that the list of players seated now updates much faster than it used to. This might make it possible to then have a text file containing a list of all regulars you want to avoid and then insist that a table never gets opened if more than a certain amount of regulars are seated (too dangerous to close tables when they sit after you though). Since I only use the "notes.txt" file to mark every regular then I could use this just as easily, but obviously this isn't suitable for everybody. This will be the last change I'll try (after the above two).

Any other ideas?

Juk
New script: PartySNGHelper Quote
09-02-2008 , 05:41 AM
Sounds awesome! I face the exact same problems...

A feature to make table selection easier, would be awesome. It is not a problem when I am starting up, but if I have 15 games running, I dont have much time to devote to it.

For tagging regulars, I use the "disable chat", since I some times like to make notes (especially on regulars) - and always run the clock chat thing in PartySngHelper anyway. These players with "disabled chat" are also stored in a clear text file. Not sure if it is a good solution for you, but thought I would mention it, if you were not aware of it.

Keep up the good work! I look forward to doing a video about new features!
New script: PartySNGHelper Quote
09-23-2008 , 01:18 PM
Using classic view this script still works surprisingly well after the update.

Laundry list for bugs introduced in new client

Hide chat and pointless buttons broken
Auto close full/busted tables broken
I think that's it!
New script: PartySNGHelper Quote
09-23-2008 , 02:02 PM
Quote:
Originally Posted by _Towelie_
Using classic view this script still works surprisingly well after the update.

Laundry list for bugs introduced in new client

Hide chat and pointless buttons broken
Auto close full/busted tables broken
I think that's it!
Yep, it's been pretty easy to fix (very surprised!). So long as you use "classic" view then it'll be easy to fix (no idea how hard new view will be though, but I prolly wont be using it anyway).

I'm gonna get some tea now, but here is a test version:

Code:
;----------------------------------------------------------
;----------------- Party SNG Helper v1.18 -----------------
;----------------------------------------------------------
; AutoHotkey Version: 1.x
; Language:         English
; Platform:         Win9x/NT
; Original Author:  jukofyork (reused code and thanks to: _dave_, Roland and HighSteaks!)
; Improvements:     fenixguy (FenixOnTilt) added v1.11b improvements.

; Features:
; =========
; 1. Push with/without AutoBet using middle mouse mutton.
; 2. Check or fold (ie: check if we can, else fold) using right mouse button.
; 3. Scroll wheel moved bet amount up/down in big bets.
; 4. Auto-confirm and check the buying box so all that will be needed is to click on an empty seat to join a SNG.
; 5. Auto-timebank clicker.
; 6. Auto-confirm the "Would you like a summary sent" box after being knocked out of a SNG.

; New for v1.01:
; ==============
; 1. Now will click Check/Fold checkbox if visible.
; 2. Pressing F12 over a player's name will simulate a right mouse click so we can takes notes, etc.
; 3. Have made it so that AlterAmount amount can take another argument to increment in 0.5BB amounts.
; 4. Have made it so we will close finished SNGs.
; 5. Have changed the timings to be 1000ms rather than 500ms to try to save on CPU time.

; New for v1.02:
; ==============
; 1. Have tried to make the finished SNG closer work more stably by trying for 5 times over 2.5 seconds
;    and testing if each time agrees.

; New for v1.03:
; ==============
; 1. Have removed the code which closed the finished SNGs - wasn't working properly and was unsafe...

; New for v1.04:
; ==============
; 1. Fixed the problem where when using half size BB increments I was rounding the value to 1dp (no
;    need to do this, as always gonna be whole number if only ever playing SNGs...).

; New for v1.05:
; ==============
; 1. Added a nice GUI to make setting the settings much easier.
; 2. Merged the code with the old EmpireLobbyFilter AHK script as is also useful on Party.
; 3. Have tried to further bullet-proof the table opening code, but still not 100% sure it will work.
; 4. Have added a button to hide the lobby and another to show the lobby. This is useful when we just want
;    to use our own listview and/or the F10/F11 hotkeys for joining SNGs and the lobby is not needed.

; New for v1.06:
; ==============
; 1. Now have two different versions of OpenTable(). One works fine on Empire and is fast but won't work always on
;    Party. The other works fine on Party, but is very slow to open tables if the list isn't filtered.
;    - Both seem to work fine now even if the lobby is hidden using the hide button.
; 2. Have made it so that the fold and push commands will only be send when the mouse button is released. This
;    give you a chance to cancel by moving the mouse off the tables (like you can with the button clicks).

; New for v1.07:
; ==============
; 1. Have removed all critical section in the code as they seem to cause an unexplained deadlock occationally.
;    - Re-checked the code and there should be no reason for this as all code paths release them...
;    - Seems that the sections like OpenTables, etc seem to work fine anyway (better than a deadlock anyway...).
; 2. Have made it so that you have to uncomment a line to use "act on mouse release" now, as it can be unsafe
;    at times of high CPU usage and cause folds/pushes on other tables by accident (default = off now).

; New for v1.08:
; ==============
; 1. Have added 3 pixels to the list-box width to correct for change after update.
; 2. Have fixed the problem where AutoBet and IncrementHalfBigBet were not being set properly from the GUI.
; 3. Have fixed the problem from the latest update which caused numbers with commas in to mess up (eg: "1,000").

; New for v1.09:
; ==============
; 1. Have set the priority for the Push and Check/Fold hotkeys to be higher and have gone back to using
;    "action on release" as should be safe with higher priority now.
; 2. Have made it so that the timer bank clicker thread is higher priority than all but the important hotkeys.
; 3. Have made it so "Auto-Request summary" also gets rid of the "You are the champion..." popup.

; New for v1.10:
; ==============
; 1. Changed the string to match the "would you like to join another SNG..." pop-up so it now closes ones where
;    you didn't win also.

; New for v1.11:
; ==============
; 1. Have fixed the "Would you like to play in another Sit & Go" dialog closer.
; 2. Have made it so that if we press push and there is no raise button, we now will click on "All-In" instead.

; New for v1.11b - imrovements by fenixguy (FenixOnTilt):
; =======================================================
; 1. Changed the string to match the "would you like to join another SNG..." pop-up once more, because the ampersand caused some problems.
; 2. Reworked the "Auto-Request Summary" Checkbox so that it now actually does what it says and clicks YES or NO depending on your choice
;    Works only if "Auto-Close Bustout Popups" is activated.
; 3. Added an "Auto-Close Bustout Popups" Checkbox to take over the function the Summary Button did before.
; 4. Added an "Auto-Close Finished SNGs" Checkbox which actually closes every active PartyPoker table you don't sit at. (Yet to be tested on Empire)

; New for 1.12:
; =============
; 1. Have made it so that the scroll wheel should also work for european style decimal seperators (eg: 1,000 and 1.000).
; 2. Have made it so that we no longer open tables with 9 players allready seated as they are usually just filling as we sit and we have to close them.
; 3. Have fixed problem with setting the RequestSummary checkbox (should work now).

; New for 1.13:
; =============
; 1. Have made it so that we no longer open tables with 9 players allready seated as they are usually just filling as we sit and we have to close them. (redone).
; 2. Have made it so we deafult to using the table closer now (seems 100% safe).
; 3. Have made it so that we deafult to not having summaries sent by email now.
; 4. Have added in a thread to press the "I am Back" button whenever it sees it (useful for crash recovery and time-outs).
; 5. Have added a special "Kill and restart" hotkey: use control+alt+F11 for Empire and control+alt+F12 for Party
; 6. Have made it so that we can now use the scroll wheel in MTTs too.
; 7. Have added an option to enable/disable the use of mouse hotkeys (MMB push, scrollwheel inc/dec and RMB fold).
; 8. Have made it so that "AutoBet" and "Increment 1/2 BB" option get shosted if mouse hotkets disabled.
; 9. Have added the ability to reset the lobby to (0,0) to fix the "mini-lobby bug" from within this script too.

; New for 1.14:
; =============
; 1. Fixed the bug where the scroll wheel would stop working because of the "value added" popup.


; New for 1.15:
; =============
; 1. Have added an option to get rid of the chat-realted stuff.
; 2. Have added an option to get rid of the 3 pointless buttons from the bottom right corner.
; 3. Have fixed a tiny slowdown bug in the automatic pressing of "I am Back" button where we kept
;    returning uneccessarily.
; 4. Have altered the UI to work look slightly better and work better with non-Win98 style windows by
;    putting the listbox below the other options.

; New for 1.16:
; =============
; 1. Have tidied up the code a bit to make it easier for people to see where to change the default settings and timings.
; 2. Have added the ability to auto-change to 16bit colour when using the script.
; 3. Have fixed some problems introduced in the 28/03/08 update:
;    - Static control for reading the blinds is now Static5 (was Static6 before).
;    - Editbox for entering bet amounts is now Edit2 (was Edit3 before).
; 4. Have merged the code to remove spaces in a number.

; New for 1.16b:
; ==============
; 1. Have fixed the problem with the auto-timebank clicker not working after 28/03/08 update.
; 2. Have fixed a bug introduced in v1.16 where we wern't removing spaces from numbers properly.
; 3. Have re-written the ato-close finished SNGs function to use a loop so it can close all windows at the same time now.

; New for 1.17:
; =============
; 1. Have reverted the AutoCloseFinished procedure to use the old code as it seemed to work much more safely.
; 2. Have increased the priority of the press "I am back" code so as to sit back ASAP now.
; 3. Have increased the priority of the scroll wheel handler as sometimes could "stall" while busy with other stuff.
; 4. Have re-arrange the controls on the GUI to accomodate the "Auto-Hide MTT Popups" option and seperate "Auto-Update Speed SNG List".

; New for 1.18:
; =============
; 1. Have merged the table opener code so we now use the old Empire opener for both now.
;    - The old Party-specific method would be far too slow and error prone now that we have so many things in the list...
;    - To open tables from the filtered list you *MUST* have exactly the same column headers in as the classic list view.
; 2. Have added some rudamentary filtering capabilty to allow us to filter the listbox to display certain limits only.
;    - Very hacky and required editing of the code atm - add somthing to the GUI later...
; 3. Had to replace all "Buy-in." with "Buy-in" - this fixed most problems (timebank, chatboc hider, buttons hider, etc).
; 4. Had to change "This Hand" to "This hand" and "Auto Post Blind" to "Auto-post blind" to get the table closer function to work.
; 

#Persistent
#SingleInstance, Force
#NoEnv

SendMode Input

DetectHiddenText, off

SetTitleMatchMode 2

; For BPP reset purposes.
OnExit, ExitSub

; Add the first group of controls.
Gui, Add, GroupBox, x10 y-2 w358 h52
Gui, Add, Checkbox, vEnableMouseShortcuts gEnableMouseShortcuts x15 y10, Enable Mouse Shortcuts
Gui, Add, Button, vHideLobbyBtn gHideLobbyBtn x15 y27 w44 h17, Hide
Gui, Add, Button, vShowLobbyBtn gShowLobbyBtn x63 y27 w44 h17, Show
Gui, Add, Button, vResetLobbyBtn gResetLobbyBtn x111 y27 w44 h17, Reset
Gui, Add, Checkbox, vAutoBet gAutoBet x163 y10, Auto-Bet
Gui, Add, Checkbox, vBuyin gBuyin x163 y30, Auto-Buyin
Gui, Add, Checkbox, vIncrementHalfBigBet gIncrementHalfBigBet x241 y10, Increment Half BBs 
Gui, Add, Checkbox, vClickTimeBank gClickTimeBank x241 y30, Auto-Click Time Bank

; Add the second group of controls.
Gui, Add, GroupBox, x10 y48 w358 h90
Gui, Add, Checkbox, vCloseFinished gCloseFinished x15 y60, Auto-Close Finished SNGs
Gui, Add, Checkbox, vCloseNonNLSpeeds gCloseNonNLSpeeds x183 y60, Auto-Close Non-NL-Speed SNGs
Gui, Add, Checkbox, vHideTourneyPopups gHideTourneyPopups x183 y80, Auto-Hide MTT Popups
Gui, Add, Checkbox, vPressIAmBack gPressIAmBack x15 y80, Auto-Click "I am Back" Button
Gui, Add, Checkbox, vClosePopups gClosePopups x15 y100, Auto-Close Bustout Popups
Gui, Add, Checkbox, vRequestSummary gRequestSummary x183 y100, Auto-Request Summary (via email)
Gui, Add, Checkbox, vHideChat gHideChat x15 y120, Auto-Hide Chat Boxes
Gui, Add, Checkbox, vHideButtons gHideButtons x183 y120, Auto-Hide "Pointless" Buttons

; Add the second group of controls.
Gui, Add, GroupBox, x10 y136 w358 h29
Gui, Add, Checkbox, vUpadteSNGList gUpadteSNGList x15 y147, Auto-Update Speed SNG List  (can cause slowdowns - use with care)

; Add the Speed-SNG-specific listbox.
Gui, Add, ListView, r4 w359 x10 y169 gMyListView, ID|Name|Game|Buy-in|Plrs/Sts|Status

; Set to "always on top" and change the title to include the version number.
Gui +AlwaysOnTop
Gui, Show, , PartySNGHelper v1.18

;Get this script's PID and set our own priority (thanks to _dave_ for this!).
pid := DllCall("GetCurrentProcessId")
Process, Priority, %pid%, AboveNormal

; ####################################################################################################################
; ############ CHANGE THESE VALUES TO MAKE THE SCRIPT START UP WITH DIFFERENT DEFAULT/START-UP SETTINGS! #############
; ####################################################################################################################
GuiControl, , AutoBet,              1 ; Do we want to actually hit raise after we set the edit box to all-in?        #
GuiControl, , IncrementHalfBigBet,  1 ; Set this to use 0.5BB increments with the scroll wheel, rather than 1BB.     #
GuiControl, , ClickTimeBank,        1 ; This will auto-click the timebank button for you when it sees it.            #
GuiControl, , Buyin,                1 ; This will let you just click on a empty seat to join a SNG.                  #
GuiControl, , RequestSummary,       0 ; This will auto-request a summary when it see the dialog at the end of a SNG. #
GuiControl, , UpadteSNGList,        0 ; This will auto-update the SNG list (lots of CPU used - F10/F11 better...).   #
GuiControl, , CloseNonNLSpeeds,     0 ; This will close any non-NL/non-Speed SNG opened by accident.                 #
GuiControl, , CloseFinished,        1 ; This will auto-close every running SNG you are not sitting in                #
GuiControl, , ClosePopups,          1 ; This will auto-close the "Play another" and "Summary" Popups                 #
GuiControl, , PressIAmBack,         1 ; This will auto-click the "I am Back" button.                                 #
GuiControl, , EnableMouseShortcuts, 1 ; This will turn on the mouse shortcuts.                                       #
GuiControl, , HideChat,             0 ; This will turn off chat hiding.                                              #
GuiControl, , HideButtons,          0 ; This will turn off pointless button hiding.                                  #
GuiControl, , HideTourneyPopups,    0 ; This will turn off the tournament popups.
; ------------------------------------------------------------------------------------------------------------------ #
AutoSwitch16bitColour :=            0 ; Set this to 1 to have the client automatically switch to using 16bit colour. #
; ####################################################################################################################

; Set the BPP to 16bit colour, as Party seems to work better using it.
if (AutoSwitch16bitColour = 1)
  SetBPP(16)

; @@@ Since we can't figure out a way to hide the MTT popups (yet) lets disable it and grey it out.
GuiControl, , HideTourneyPopups, 0
GuiControl, Disable, HideTourneyPopups

; Start the timers (depends on the default checkbox setting as to if they start or not).
GoSub, AutoBet
GoSub, IncrementHalfBigBet
SetTimer, AutoClickTimeBank,     1000, ,1 ; Higher priority so as not to lag and miss the timebank...
GoSub, ClickTimeBank
SetTimer, AutoBuyin,             500
GoSub, Buyin
SetTimer, AutoUpdateSNGList,     5000
GoSub, UpadteSNGList
SetTimer, AutoCloseNonNLSpeeds,  1000
GoSub, CloseNonNLSpeeds
SetTimer, AutoCloseFinished,     1000
GoSub, CloseFinished
SetTimer, AutoClosePopups,       500
GoSub, ClosePopups
SetTimer, AutoSitBackIn,         500, ,1 ; Higher priority so as to sit back ASAP.
GoSub, PressIAmBack
SetTimer, AutoHideChat,          1000
GoSub, HideChat
SetTimer, AutoHideButtons,       1000
GoSub, HideButtons
SetTimer, AutoHideTourneyPopups, 500
GoSub, HideTourneyPopups


; Set the priority of the important hotkeys.
Hotkey, ~RButton, , P2
Hotkey, ~MButton, , P2
Hotkey, ~WheelUp, , P2
Hotkey, ~WheelDown, , P2

return

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; Pressing F10 will manually update the SNG list.
F10::
  gosub, FocusLooby
  gosub, AutoUpdateSNGList
return

; ---------------------------------------------------------------------------------------------------------------

; Pressing F11 will manually update the SNG list *AND* open the first SNG in the list.
F11::
  gosub, FocusLooby
  gosub, AutoUpdateSNGList
  LV_GetText(TableName,1,1)
  if (TableName <> "") 
    OpenTable(TableName)
return

; ---------------------------------------------------------------------------------------------------------------

; Pressing F12 simulates a right mouse click over a player's name (so we can take notes and still use RMB for check/fold).
F12::
id := ""
MouseGetPos, x, y, id
if (id <> "")
  PostRightClick(x, y, id)
return

; ---------------------------------------------------------------------------------------------------------------

; Pressing control+alt+F11 will make the Empire client restart.
^!F11::
  Process, Close, EmpirePokerMaster.exe
  Process, WaitClose, EmpirePokerMaster.exe
  Sleep, 1
  Process, WaitClose, EmpirePokerMaster.exe
  Sleep, 1
  run, C:\Program Files\EmpirePokerMaster\EmpirePoker\RunEPoker.exe
return

; ---------------------------------------------------------------------------------------------------------------

; Pressing control+alt+F12 will make the Party client restart.
^!F12::
  Process, Close, partygaming.exe
  Process, WaitClose, partygaming.exe
  Sleep, 1
  Process, WaitClose, partygaming.exe
  Sleep, 1
  run, C:\Program Files\PartyGaming\PartyPoker\RunApp.exe
return

; ---------------------------------------------------------------------------------------------------------------

; Right mouse click = check/fold.
~RButton::
if (EnableMouseShortcuts)
  CheckFold(getid())
return

; ---------------------------------------------------------------------------------------------------------------

; Middle mouse click = push all-in.
~MButton::
if (EnableMouseShortcuts)
  Push(getid(),AutoBet)
return

; ---------------------------------------------------------------------------------------------------------------

; Mouse-wheel up = Increment bet amount.
~WheelUp::
if (EnableMouseShortcuts)
  AlterAmount(getid(),"up",IncrementHalfBigBet)
return

; ---------------------------------------------------------------------------------------------------------------

; Mouse-wheel down = Decrement bet amount.
~WheelDown::
if (EnableMouseShortcuts)
  AlterAmount(getid(),"down",IncrementHalfBigBet)
return

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

AutoBet:
  Gui, Submit, NoHide
return

; ---------------------------------------------------------------------------------------------------------------

IncrementHalfBigBet:
  Gui, Submit, NoHide
return

; ---------------------------------------------------------------------------------------------------------------

RequestSummary:
  Gui, Submit, NoHide
return

; ---------------------------------------------------------------------------------------------------------------

UpadteSNGList:
  Gui, Submit, NoHide
  if (UpadteSNGList)
    SetTimer, AutoUpdateSNGList, On
  else
    SetTimer, AutoUpdateSNGList, Off
return

; ---------------------------------------------------------------------------------------------------------------

CloseNonNLSpeeds:
  Gui, Submit, NoHide
  if (CloseNonNLSpeeds)
    SetTimer, AutoCloseNonNLSpeeds, On
  else
    SetTimer, AutoCloseNonNLSpeeds, Off
return


; ---------------------------------------------------------------------------------------------------------------

ClickTimeBank:
  Gui, Submit, NoHide
  if (ClickTimeBank)
    SetTimer, AutoClickTimeBank, On
  else
    SetTimer, AutoClickTimeBank, Off
return


; ---------------------------------------------------------------------------------------------------------------

Buyin:
  Gui, Submit, NoHide
  if (Buyin)
    SetTimer, AutoBuyin, On
  else
    SetTimer, AutoBuyin, Off
return


; ---------------------------------------------------------------------------------------------------------------

CloseFinished:
  Gui, Submit, NoHide
  if (CloseFinished)
    SetTimer, AutoCloseFinished, On
  else
    SetTimer, AutoCloseFinished, Off
return

; ---------------------------------------------------------------------------------------------------------------

HideChat:
  Gui, Submit, NoHide
  if (HideChat)
    SetTimer, AutoHideChat, On
  else
    SetTimer, AutoHideChat, Off
return

; ---------------------------------------------------------------------------------------------------------------

HideButtons:
  Gui, Submit, NoHide
  if (HideButtons)
    SetTimer, AutoHideButtons, On
  else
    SetTimer, AutoHideButtons, Off
return

; ---------------------------------------------------------------------------------------------------------------

HideTourneyPopups:
  Gui, Submit, NoHide
  if (HideTourneyPopups)
    SetTimer, AutoHideTourneyPopups, On
  else
    SetTimer, AutoHideTourneyPopups, Off
return

; ---------------------------------------------------------------------------------------------------------------

ClosePopups:
  Gui, Submit, NoHide
  if (ClosePopups)
  {
    SetTimer, AutoClosePopups, On
    GuiControl, Enable, RequestSummary
  }
  else
  {
    SetTimer, AutoClosePopups, Off
    GuiControl, Disable, RequestSummary
  }
return

; ---------------------------------------------------------------------------------------------------------------

PressIAmBack:
  Gui, Submit, NoHide
  if (PressIAmBack)
    SetTimer, AutoSitBackIn, On
  else
    SetTimer, AutoSitBackIn, Off
return

; ---------------------------------------------------------------------------------------------------------------

EnableMouseShortcuts:
  Gui, Submit, NoHide
  if (EnableMouseShortcuts)
  {
    GuiControl, Enable, AutoBet
    GuiControl, Enable, IncrementHalfBigBet
  }
  else
  {
    GuiControl, Disable, AutoBet
    GuiControl, Disable, IncrementHalfBigBet
  }

return

; ---------------------------------------------------------------------------------------------------------------

HideLobbyBtn:
  SetTitleMatchMode, 2
  WinMove, Poker Lobby, , , , 1, 1
return

; ---------------------------------------------------------------------------------------------------------------

ShowLobbyBtn:
  SetTitleMatchMode, 2
  WinMove, Poker Lobby, , , , 786, 566
return

; ---------------------------------------------------------------------------------------------------------------

; Reset the Party lobby to top left and correct dimentions.
ResetLobbyBtn:
  SetTitleMatchMode, 2
  WinMove, Poker Lobby, , 0, 0, 786, 566
return

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


AutoClickTimeBank:

  checkfield = AfxWnd42u34 ; AfxWnd42u34 is timebank control
  LobbyWindowTitle = Poker Lobby ; identify poker lobby substring
  TableWindowTitle = Buy-in ; identify pokertable substring

  WinGet, lobbyID, ID, %LobbyWindowTitle%

  WinGet, pid, PID, ahk_id%lobbyID%
  WinGet, rlist, LIST, %TableWindowTitle% ahk_pid%pid%
  Loop %rlist%
  {
    this_id := rlist%a_index%
    If this_id != %lobbyID%
    {
      WinGetTitle, name, ahk_id%this_id%
      ControlGet, result, Visible, , %checkfield%, ahk_id%this_id%
      if (result)
      {
        ControlClick %checkfield%, ahk_id%this_id% ;Click timebank
      }
    }
  }

return

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

AutoBuyin:

  IfWinExist, ahk_class #32770, Tournament Buy-in
  {
    WinGet, idList, List, ahk_class #32770, Tournament Buy-in
    Loop, %idList%
    {
      winID := idList%a_index%
      ControlSend, Button2, {SPACE}, ahk_id%winID%
      Sleep, 40
      ControlSend, Button5, {SPACE}, ahk_id%winID%
    }
  }

return

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

AutoClosePopups:
  
  IfWinExist, ahk_class #32770, Would you like a tournament summary
  {
    WinGet, idList, List, ahk_class #32770, Would you like a tournament summary 
    Loop, %idList%
    {
      winID := idList%a_index%
      if (RequestSummary)                                    ; Request Summary if activated
        ControlSend, Button1, {ENTER}, ahk_id%winID%
      else
        ControlSend, Button2, {ESC}, ahk_id%winID%
    }
  }

  ; Lets get rid of the champion of the tournament window.
  IfWinExist, ahk_class #32770, Would you like to play in another Sit
  {
    WinGet, idList, List, ahk_class #32770, Would you like to play in another Sit
     Loop, %idList%
     {
      winID := idList%a_index%
      ControlSend, Button2, {ESC}, ahk_id%winID% ; Click NO always.
     }
   }

return

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

MyListView:
if A_GuiEvent = DoubleClick
{
  ;___ A_EventInfo contains the focused row number; insert the correct comlumn number 
  LV_GetText(TableName, A_EventInfo, 1)
  if (TableName <> "")
    OpenTable(TableName)
}
return

GuiClose:  ; Indicate that the script should exit automatically when the window is closed.
ExitApp

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

getid()
{
  id := ""
  MouseGetPos, , , id
  return id
}

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

PostRightClick(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, 0x204, 0x0001, ((y<<16)^x), , ahk_id%table_id%
PostMessage, 0x205 , 0, ((y<<16)^x), , ahk_id%table_id%
}

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; This will set the edit box to the maximum amount.
Push(id, AutoBet=0)
{
    pot := 10000000
    ControlSetText, Edit2, %pot%, ahk_id%id%
    Sleep -1
    Sleep 50
    WinSet, Redraw,, ahk_id%id%
    If(AutoBet)
    {

      ; Lets see if we can see the "All-In" button.
      ControlGet, v, Visible, , AfxWnd42u18, ahk_id%id%
      if (v)
      {
        ControlGetText, text, AfxWnd42u18, ahk_id%id%
        IfInString, text, All-In
        {
          ControlFocus, AfxWnd42u18, ahk_id%id%
          Sleep, -1
          ControlClick, AfxWnd42u18, ahk_id%id%
          return
        }
      }

      ; Click raise instead then.
      ControlClick, AfxWnd42u19, ahk_id%id% ; Raise.

    }
}

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; Clicks Check/Fold-in-turn or fold-in-turn button if sees it, else clicks check if sees 
; it, else clicks fold.
CheckFold(id)
{

  ; Check/Fold checkbox.
  ControlGet, v, Visible, , AfxWnd42u23, ahk_id%id%
  if (v)
  {
    ControlFocus, AfxWnd42u23, ahk_id%id%
    Sleep, -1
    ControlClick, AfxWnd42u23, ahk_id%id%
    return
  }

  ; Fold checkbox.
  ControlGet, v, Visible, , AfxWnd42u22, ahk_id%id%
  if (v)
  {
    ControlFocus, AfxWnd42u22, ahk_id%id%
    Sleep, -1
    ControlClick, AfxWnd42u22, ahk_id%id%
    return
  }

  ; Lets see if we can see the check button.
  ControlGet, v, Visible, , AfxWnd42u18, ahk_id%id%
  if (v)
  {
    ControlGetText, text, AfxWnd42u18, ahk_id%id%
    IfInString, text, Check
    {
      ControlFocus, AfxWnd42u18, ahk_id%id%
      Sleep, -1
      ControlClick, AfxWnd42u18, ahk_id%id%
      return
    }
  }

  ; Lets try for fold then.
  ControlGet, v, Visible, , AfxWnd42u17, ahk_id%id%
  if (v)
  {
    ControlFocus, AfxWnd42u17, ahk_id%id%
    Sleep, -1
    ControlClick, AfxWnd42u17, ahk_id%id%
  }

}

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; Removes any comma in number and returns the result.
; ### JUK: Now tries to remove any european style decimal seperators too.
RemoveCommaInNumber(n)
{
  ; This should remove any spaces in the number.
  StringReplace, n, n, %A_Space%,, All

  If (InStr(n, ".") <> 0)
  {
    n := n*1000
  }
  If (InStr(n, ",") <> 0)
  {
    StringReplace, n, n, `,, .
    n := n*1000
  }
  return n
}

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

AlterAmount(id, dir="",IncrementHalfBigBet=1)
{
  WinGetTitle, title, ahk_id%id%
  amount := 0

  ; Get the current BB amount.
  if (InStr(title, "NL") <> 0 AND (InStr(title, "Buy-in") <> 0 OR InStr(title, "Table #") <> 0))
  {

    ; ### Fixed the problem where empire stopped working sometimes. ###
    ControlGetText, text, Static5, ahk_id%id%
    IfNotInString, text, Blinds
      ControlGetText, text, Static6, ahk_id%id%
    IfNotInString, text, Blinds
      ControlGetText, text, Static7, ahk_id%id%
    ; msgbox, %text%

    IfNotInString, text, Blinds-Antes
    {
      StringMid, bb, text, InStr(text, "/") + 1, InStr(text, ")") - InStr(text, "/") - 1
    }
    else
    {
      StringMid, bb, text, InStr(text, "/") + 1, InStr(text, "-","",InStr(text, "/")) - InStr(text, "/") - 1
    }
    bb := RemoveCommaInNumber(bb)
    ; msgbox, %bb%
  }

  ; Do we want to increment by a whole or a half BB?
  if (IncrementHalfBigBet = 1)
    amount := bb / 2
  else
    amount := bb

  if (dir="down")
  {
    amount := amount - (2*amount)
  }

  ; Get the text and turn back into a number without commas (eg: 1,000 -> 1000).
  ControlGetText, t, Edit2, ahk_id%id%
  t := RemoveCommaInNumber(t)
  ;msgbox, %t%

  t := t + amount
  if (t < 0)
  {
    t := 0
  }

  ; Lets round to 0dp.
  t := Round(t, 0)
  
  ; Alter the edit-box.
  ControlSetText, Edit2, %t%, ahk_id%id%
  ;WinSet, Redraw,, ahk_id%id%

}

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

OpenTable(TableName)
{
  ; Lets see if the Party lobby is up?
  WinGet, lobby_id, ID, PartyPoker.com: Poker Lobby

  ; Lets try and get the Empire lobby then.
  if (not lobby_id)
    WinGet, lobby_id, ID, EmpirePoker.com: Poker Lobby


  ; We now use the same method for both Party and Empire.
  if (lobby_id)
  {

    ;___ Now we want to focus that table in the PartyListView
    WinActivate, ahk_id%lobby_id%
    WinwaitActive, ahk_id%lobby_id%

    Loop ;__ see below... 
    { 

      ; Lets makes sure we have the correct listview in focus.
      ControlFocus, SysListView321, ahk_id%lobby_id% 
      ControlClick, SysListView321, ahk_id%lobby_id% ;___ I've had ControlFocus fail here, but this always works

      ; ### Using ControlSendraw was causing the Party problems: use ControlSend instead.
      ControlSend, SysListView321, %TableName%, ahk_id%lobby_id% ;___ this wasn't so hard, huh?  FPRIVATE "TYPE=PICT;ALT=" Just send the name, that should focus the table 

      ;___ now I'm guessing you'll want to open it; since the above method sometimes fails, we double-check: 
      ControlGet, row, List, Fosused, SysListView321, ahk_id%lobby_id% 
      IfInString, row, %TableName% 
        break ;__ terminate the loop; else we'd send the name all over again

      ;__ but maybe there's some other problem, so it's better we only try, say, three times 
      If a_index = 3
        return

    }

    ControlSend, SysListView321, {Enter}, ahk_id%lobby_id% ;___open the table 

  }

}


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

FocusLooby:

  WinGet, lobby_id, ID, PartyPoker.com: Poker Lobby
  if (lobby_id)
  {
    WinActivate, ahk_id%lobby_id%
    WinwaitActive, ahk_id%lobby_id%
    return
  }

  WinGet, lobby_id, ID, EmpirePoker.com: Poker Lobby
  if (lobby_id)
  {
    WinActivate, ahk_id%lobby_id%
    WinwaitActive, ahk_id%lobby_id%
  }

return

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; ### v1.18: As of the new update on 23/09/08 this will only work if you make sure that the filtered listbox has the same
;            fields as the unfiltered listbox (ie: ID, name, Game, Buy-in, Plrs/Sts and Status).
AutoUpdateSNGList:

  ; Depends on if we have Party or empire loaded.
  WinGet, id, ID, EmpirePoker.com: Poker Lobby
  if (id)
    ControlGet, List, List, , SysListView321, EmpirePoker.com: Poker Lobby
  else
    ControlGet, List, List, , SysListView321, PartyPoker.com: Poker Lobby

  ; Clear it ready to start again.
  LV_Delete()

  RowNumber := 1
  Loop, Parse, List, `n  ; Rows are delimited by linefeeds (`n).
  {

    ; See if we find what we are looking for.
    Found := 0
    Loop, Parse, A_LoopField, %A_Tab%
    {

       ; Now check it's the correct type.
       if (A_Index = 2)
       {
         if (InStr(A_LoopField, "Speed") <> 0)
             Found := Found + 1
         else
             break
       }  
       if (A_Index = 3)
       {
         if (A_LoopField = "NL Hold'em")
           Found := Found + 1
         else
             break
       }  
       if (A_Index = 4)
       {
         ; ### v1.18: To filter by SNG level then comment out this line.
         Found := Found + 1               ; No filter applied / all limits will be listed.

         ; ### v1.18: ... and uncomment/edit these lines to suit your needs.
         ; if (A_LoopField = "$11")
         ;   Found := Found + 1           ; Is a $11 SNG, so we want to list this.
         ; else if (A_LoopField = "$22")
         ;   Found := Found + 1           ; Is a $22 SNG, so we want to list this.
         ; else if (A_LoopField = "$33")
         ;   Found := Found + 1           ; Is a $33 SNG, so we want to list this.
         ; else
         ;   break                        ; Not a desired limit so lets ignore it.

       }  
       if (A_Index = 5)
       {
         if (A_LoopField <> "10/10")
           Found := Found + 1
         else
             break
         if (A_LoopField <> "9/10") ; Ignore 9/10 tables as they usually just fill as we sit...
           Found := Found + 1
         else
             break
       }  
       if (A_Index = 6)
       {
         if (A_LoopField = "Registering")
           Found := Found + 1
         else
             break
       }  
    }
    if (Found <> 6)
      continue

    ; See if the table is open allready.
    Found := 0
    Loop, Parse, A_LoopField, %A_Tab%
    {

       ; Now check it's the correct type.
       if (A_Index = 2)
       {
         if (InStr(A_LoopField, "Speed") <> 0)
           IfWinNotExist, %A_LoopField%
           {
             Found := 1
             break
           }
       }  
    }
    if (Found <> 1)
      continue

    LV_Add(RowNumber)
    Loop, Parse, A_LoopField, %A_Tab%   ; Fields (columns) in each row are delimited by tabs (A_Tab).
    {
      LV_Modify(RowNumber, "Col"A_Index , A_LoopField)
    }

    RowNumber := RowNumber + 1
  }

  if (RowNumber > 1)
    LV_ModifyCol()  ; Auto-size each column to fit its contents.

return

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; Call this to make sure we never open a non-speed NL table by accident.
AutoCloseNonNLSpeeds:

  LobbyWindowTitle = Poker Lobby ; identify poker lobby substring
  TableWindowTitle = Buy-in ; identify pokertable substring

  WinGet, lobbyID, ID, %LobbyWindowTitle%

  WinGet, pid, PID, ahk_id%lobbyID%
  WinGet, rlist, LIST, %TableWindowTitle% ahk_pid%pid%
  Loop %rlist%
  {
    this_id := rlist%a_index%
    If this_id != %lobbyID%
    {
      WinGetTitle, name, ahk_id%this_id%
      if (InStr(name, "Speed") = 0 OR InStr(name, "NL") = 0 OR InStr(name, "Hold'em") = 0)
        WinClose, ahk_id%this_id%
    }
  }

return

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; Call this to close all the running SNGs we are not sitting in.
; ### v1.17: Have reverted to the old code as the new code didn't work 100% and sometimes tried to close wrong table.
; ### v1.18: Had to change "This Hand" to "This hand" and "Auto Post Blind" to "Auto-post blind" to get working after the 23/09/08 update.
AutoCloseFinished:

  WinClose, ahk_class #32770, This hand, , , Auto-post blind
  IfWinExist, ahk_class #32770, will not be refunded and your blinds will continue to be posted
  {
    WinGet, idList, List, ahk_class #32770, will not be refunded and your blinds will continue to be posted
    Loop, %idList%
    {
      winID := idList%a_index%
      ControlSend, Button2, {ESC}, ahk_id%winID% ; Click Cancel always.
    }
  }

return

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; Call this to make sure we never end up sitting out.
AutoSitBackIn:

  LobbyWindowTitle = Poker Lobby ; identify poker lobby substring
  TableWindowTitle = Buy-in ; identify pokertable substring

  WinGet, lobbyID, ID, %LobbyWindowTitle%

  WinGet, pid, PID, ahk_id%lobbyID%
  WinGet, rlist, LIST, %TableWindowTitle% ahk_pid%pid%
  Loop %rlist%
  {
    this_id := rlist%a_index%
    If this_id != %lobbyID%
    {
      ; Lets see if we can see the check button.
      ControlGet, v, Visible, , AfxWnd42u17, ahk_id%this_id%
      if (v)
      {
        ControlGetText, text, AfxWnd42u17, ahk_id%this_id%
        IfInString, text, I am Back
        {
          ControlFocus, AfxWnd42u17, ahk_id%this_id%
          Sleep, -1
          ControlClick, AfxWnd42u17, ahk_id%this_id%
        }
      }

    }
  }

return

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; Call this to make sure all chat boxes are hidden.
AutoHideChat:

  LobbyWindowTitle = Poker Lobby ; identify poker lobby substring
  TableWindowTitle = Buy-in ; identify pokertable substring

  WinGet, lobbyID, ID, %LobbyWindowTitle%

  WinGet, pid, PID, ahk_id%lobbyID%
  WinGet, rlist, LIST, %TableWindowTitle% ahk_pid%pid%
  Loop %rlist%
  {
    this_id := rlist%a_index%
    If this_id != %lobbyID%
    {
      ; Lets see if we can see the chat box.
      ControlGet, v, Visible, , RichEdit20W1, ahk_id%this_id%
      if (v)
        Control, Hide, , RichEdit20W1, ahk_id%this_id%

      ; Lets see if we can see the combo box.
      ControlGet, v, Visible, , ComboBox1, ahk_id%this_id%
      if (v)
        Control, Hide, , ComboBox1, ahk_id%this_id%

      ; Lets see if we can see the Edit box.
      ControlGet, v, Visible, , Edit1, ahk_id%this_id%
      if (v)
        Control, Hide, , Edit1, ahk_id%this_id%      
    }
  }

return

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; Call this to make sure all pointless buttons are hidden.
AutoHideButtons:

  LobbyWindowTitle = Poker Lobby ; identify poker lobby substring
  TableWindowTitle = Buy-in ; identify pokertable substring

  WinGet, lobbyID, ID, %LobbyWindowTitle%

  WinGet, pid, PID, ahk_id%lobbyID%
  WinGet, rlist, LIST, %TableWindowTitle% ahk_pid%pid%
  Loop %rlist%
  {
    this_id := rlist%a_index%
    If this_id != %lobbyID%
    {
      ; Lets hide the useless "Cashier","Lobby" and "Leave Table" buttons.
      ControlGet, v, Visible, , AfxWnd42u1, ahk_id%this_id%
      if (v)
        Control, Hide, , AfxWnd42u1, ahk_id%this_id%
      ControlGet, v, Visible, , AfxWnd42u2, ahk_id%this_id%
      if (v)
        Control, Hide, , AfxWnd42u2, ahk_id%this_id%
      ControlGet, v, Visible, , AfxWnd42u3, ahk_id%this_id%
      if (v)
        Control, Hide, , AfxWnd42u3, ahk_id%this_id%
      

    }
  }

return

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

AutoHideTourneyPopups:

  LobbyWindowTitle = Poker Lobby ; identify poker lobby substring
  TableWindowTitle = Buy-in ; identify pokertable substring

  WinGet, lobbyID, ID, %LobbyWindowTitle%

  WinGet, pid, PID, ahk_id%lobbyID%
  WinGet, rlist, LIST, %TableWindowTitle% ahk_pid%pid%
  Loop %rlist%
  {
    this_id := rlist%a_index%
    If this_id != %lobbyID%
    {
      ControlGet, v, Visible, , Static1, ahk_id%this_id%
      if (v)
      {
        ControlGet, control_id, Hwnd, , Static1, ahk_id%this_id%
        WinHide, ahk_id%control_id%                               ; Hide it.
        WinMove, ahk_id%control_id%, , 0, 0, 1, 1                 ; Shrink it.
        WinSet, Transparent, 0, ahk_id%control_id%                ; Make it transparent.
        ; MsgBox, %control_id%
        
        PostMessage, 0x10, 0, 0, Static1, ahk_id%this_id%         ; WM_CLOSE
        PostMessage, 0x112, 0xf060, 0, Static1, ahk_id%this_id%   ; WM_SYSCOMMAND+SC_CLOSE.
      }
    }
  }

return

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; Pass in 16 or 32 to set the BPP for all monitors.
SetBPP(BPP)
{
  ; Loop through each display device and if it is a real monitor change it's state.
  Loop
  { 
    if ! EnumDisplayDevices(A_Index, DeviceName, StateFlags) 
      break
    if (StateFlags & 4)
    {
      RetVal:=ChangeDisplaySettingsEx( DeviceName, BPP, -1, -1, -1 ) ; Primary device.
      ;MsgBox, Returned: %RetVal%
    }
    else if (StateFlags & 1) {
      RetVal:=ChangeDisplaySettingsEx( DeviceName, BPP, -1, -1, -1 ) ; The desktop extends onto this device.
      ;MsgBox, Returned: %RetVal%
    }
  } 
}

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; DllCall wrapper for calls to EnumDisplayDevices().
EnumDisplayDevices(Index, ByRef DeviceName, ByRef StateFlags="", ByRef DeviceKey="") 
{ 
    ; DISPLAY_DEVICE DisplayDevice 
    VarSetCapacity(DisplayDevice, 424) 
    ; lpDisplayDevice.cb := sizeof(DISPLAY_DEVICE) 
    NumPut(424, DisplayDevice, 0) 
    
    VarSetCapacity(DeviceName, 32, 0) 
    VarSetCapacity(DeviceKey, 128, 0) 
    ; For consistency, clear StateFlags in case of failure. 
    StateFlags = 0 
    
    if ! DllCall("EnumDisplayDevices" 
        , "UInt", 0 
        , "UInt", Index-1 
        , "UInt", &DisplayDevice 
        , "UInt", 0) 
        return false 
    
    StateFlags := NumGet(DisplayDevice, 164) 
    DllCall("lstrcpynA", "Str", DeviceName, "UInt", &DisplayDevice+4,   "int", 32) 
    DllCall("lstrcpynA", "Str", DeviceKey,  "UInt", &DisplayDevice+296, "int", 128) 
    if (SubStr(DeviceKey,1,18)="\Registry\Machine\") 
        DeviceKey := SubStr(DeviceKey,19) 
    return true 
}

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; DllCall wrapper for calls to ChangeDisplaySettingsEx().
; NOTE: Pass in -1 for any value you don't wish to alter.
ChangeDisplaySettingsEx(DeviceName, cD, sW, sH, rR)
{

  ; Lets get a copy of the DEVMODE struct.
  VarSetCapacity(dM,156,0), NumPut(156,2,&dM,36)
  DllCall( "EnumDisplaySettings", UInt,0, UInt,-1, UInt,&dM)

  ; Lets work out which device settings we want to change.
  BitString:=0
  if (cD!=-1)
  {
    BitString|=0x040000 ; DM_BITSPERPEL
    NumPut(cD,dM,104)
  }
  if (sW!=-1 && sH!=-1)
  {
    BitString|=0x080000 ; DM_PELSWIDTH
    BitString|=0x100000 ; DM_PELSHEIGHT
    NumPut(sW,dM,108)
    NumPut(sH,dM,112)
  }
  if (rR!=-1)
  {
    BitString|=0x400000 ; DM_DISPLAYFREQUENCY
    NumPut(rR,dM,120)
  }
  NumPut(BitString,dM,40)

  ; Lets alter it then.
  ; NOTE: dwflags needs to be set to CDS_UPDATEREGISTRY (1) for this to change perminantly.
  Return DllCall( "ChangeDisplaySettingsEx", Str, DeviceName, UInt,&dM, UInt,0, UInt,1, UInt,0)

}

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; This subroutine is called automatically when the script exits for any reason.
ExitSub:
if (AutoSwitch16bitColour = 1)
  SetBPP(32) ; Set BPP back to using 32bit colour.
ExitApp

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
I have now fixed:

* Hide chat and pointless buttons broken
* Auto close full/busted tables broken
* Auto timebank clicker.
* F11 list/opener now works in both list views so long as you make sure you have the same fields in the filtered version.

I need confirmation these are still working:

* Auto-close bustout popups
* Auto-request summaries (via Email)

^ --- Please tell me if these are broken in the test code above and tell me about anything else that is no longer working.

I'm planning on adding something to let you filter the limits like you could using the old "favorites" - this will be in the next version though: v1.18 is just about fixing broken stuff.

If all is well then I'll upload this to the Wiki later, but please leave feedback here so I know it's working...

Juk
New script: PartySNGHelper Quote
09-23-2008 , 04:14 PM
I have now fixed a couple more very minor things:

* The Hide/Show/Reset button now resize the lobby back the correct dimensions.
* The "Auto-Hide 'Pointless' Buttons" option now also hides the "New Table" button displayed at the top of each table.

I won't bother posting another version here, but these fixes will be in the version I upload to the Wiki later tonight.

Juk
New script: PartySNGHelper Quote
09-23-2008 , 04:22 PM
Thx Juk!! Haven't tested yet but I will once HM releases a patch.
New script: PartySNGHelper Quote
09-23-2008 , 04:55 PM
Quote:
Originally Posted by _Towelie_
Thx Juk!! Haven't tested yet but I will once HM releases a patch.
Have you any idea what changed in the HH format today? Roy and Josh both made posts about it changing, but I can't for the life of me see any difference...

I'm currently just playing a SNG to test the bustout popup closing code and I think if that works then hopefully it should be good enough to post on the Wiki (everything else so far seems to be working fine).

I'd still love to know what's changed in the HH format though, as it could severely effect my SNG luck code if a bug goes by unnoticed...

Juk

PS: Just busted, so all seems to be working fine.
New script: PartySNGHelper Quote
09-23-2008 , 05:01 PM
Quote:
the changes are:

"all-in" instead of "all-In"

"Big Blind" instead of "big blind"
"Small Blind" instead of "small blind"

if i change this manually i can import allin hands too..


http://208.109.95.123/forum/showthread.php?t=2472
New script: PartySNGHelper Quote
09-23-2008 , 05:46 PM
Quote:
Originally Posted by _Towelie_
Thanks man! I looked at the hand for ages, but somehow managed to not see the "all-in" thing. I'm guessing the "Small Blind"/"Small Blind" thing is to do with the line it prints when you have a dead SB (don't have an example of this yet, but hopefully preempted it now).

Juk
New script: PartySNGHelper Quote
09-23-2008 , 05:53 PM
I've just tested the last few bits and it all seems to be working fine now. Just make sure you only use the "classic" view and if you are going to use the F10/F11 hotkeys with the filtered listbox then make sure the filtered version has the same fields (ie: column titles) as the unfiltered one does (ie: ID, name, Game, Buy-in, Plrs/Sts and Status).

New for 1.17:
1. Have reverted the AutoCloseFinished procedure to use the old code as it seemed to work much more safely.
2. Have increased the priority of the press "I am back" code so as to sit back ASAP now.
3. Have increased the priority of the scroll wheel handler as sometimes could "stall" while busy with other stuff.
4. Have re-arrange the controls on the GUI to accommodate the "Auto-Hide MTT Popups" option and separate "Auto-Update Speed SNG List".

New for 1.18:
1. Have merged the table opener code so we now use the old Empire opener for both now. The old Party-specific method would be far too slow and error prone now that we have so many things in the list... To open tables from the filtered list you *MUST* have exactly the same column headers in as the classic list view.
2. Have added some rudimentary filtering capability to allow us to filter the listbox to display certain limits only. Very hacky and required editing of the code atm - add something to the GUI later...
3. Had to replace all "Buy-in." with "Buy-in" - this fixed most problems (timebank, chatbox hider, buttons hider, etc).
4. Had to change "This Hand" to "This hand" and "Auto Post Blind" to "Auto-post blind" to get the table closer function to work.

New for 1.18b:
1. Have fixed the Hide/Show/Reset buttons to now resize the lobby to the correct dimensions (the new lobby is not the same as the old).
2. Have made it so that "Auto-Hide 'Pointless' Buttons" option also hides the "New table" button displayed at the top of each table.

As always the code can be found here.

Juk
New script: PartySNGHelper Quote
09-24-2008 , 02:02 PM
I think there's a problem with auto-buyin now. It only works a small percentage of the time for me, the other times it just seems to close the dialog box before clicking 'ok'.
New script: PartySNGHelper Quote
09-24-2008 , 02:34 PM
Weird I thought maybe the co-ordinates for the ok button had changed but I see you use space and return to control the checkbox and ok button. If I do this manually I can still use space and return to check and click ok, but when the script does it party doesn't like it for some reason.
New script: PartySNGHelper Quote
09-24-2008 , 04:33 PM
So should I just copy and paste that into the current party sng helper thing on my desktop, or can i download a completely new file?

Juk, i would like to send you some money for this please - pm me.
New script: PartySNGHelper Quote
09-24-2008 , 05:00 PM
Quote:
Originally Posted by _Towelie_
I think there's a problem with auto-buyin now. It only works a small percentage of the time for me, the other times it just seems to close the dialog box before clicking 'ok'.
Yep, I have this fixed in my version but just not put it on the Wiki yet (basically AutoCloseNonNLSpeeds was getting mixed up and seeing the word "Buy-in" in the title of the "Tournament Buy-in" dialog and trying to close it before AutoBuyin could click it...).

You just need to replace the current AutoCloseNonNLSpeeds procedure with this one:
Code:
; Call this to make sure we never open a non-speed NL table by accident.
AutoCloseNonNLSpeeds:

  LobbyWindowTitle = Poker Lobby ; identify poker lobby substring
  TableWindowTitle = Buy-in ; identify pokertable substring

  WinGet, lobbyID, ID, %LobbyWindowTitle%

  WinGet, pid, PID, ahk_id%lobbyID%
  WinGet, rlist, LIST, %TableWindowTitle% ahk_pid%pid%
  Loop %rlist%
  {
    this_id := rlist%a_index%
    If this_id != %lobbyID%
    {
      WinGetTitle, name, ahk_id%this_id%
      if (InStr(name, "Tournament Buy-in") = 0)
      {
        ; @@@ Use this to make sure you don't open the wrong limit by accident.
         if (InStr(name, "Speed") = 0 OR InStr(name, "NL") = 0 OR InStr(name, "Hold'em") = 0)
          WinClose, ahk_id%this_id%
      }
    }
  }

return
I'll upload the fixed version later (I'm on my last day to clear my bonus and need ~3 hours to finish it).

Juk
New script: PartySNGHelper Quote
09-24-2008 , 05:03 PM
Quote:
Originally Posted by Scotty_12
So should I just copy and paste that into the current party sng helper thing on my desktop, or can i download a completely new file?
Yep, just download the version from the overcards Wiki and use it instead of your old version (the Wiki should always have the latest "stable" versions - the version I post in this thread are usually just test versions).

Quote:
Juk, i would like to send you some money for this please - pm me.
Hey, it's OK I would have had to fix it for me to be able to play anyway so it's no more work to do it for everybody.

Juk
New script: PartySNGHelper Quote
09-24-2008 , 07:14 PM
Hey Juk no rush obv but the updated code above makes autobuyin hang for me. It won't activate the checkbox. I don't know how to explain it better than that .
New script: PartySNGHelper Quote
09-24-2008 , 09:26 PM
Quote:
Originally Posted by _Towelie_
Hey Juk no rush obv but the updated code above makes autobuyin hang for me. It won't activate the checkbox. I don't know how to explain it better than that .
It's probably just me who has messed up editing the code (in my version I have some hacky filter added in to stop me accidentally opening the wrong limits) as the problem also effected me to start with and was definitely those two functions fighting with each other.

I'll post what I have on overcards now.

EDIT: It's their now - give it a try and tell us how you get on.

Juk

Last edited by jukofyork; 09-24-2008 at 09:33 PM.
New script: PartySNGHelper Quote
09-25-2008 , 06:33 PM
Thanks a lot Juk everything is working again!
New script: PartySNGHelper Quote
01-05-2009 , 10:27 AM
New for 1.18e:
1. Fixed the "deadlock" problem when opening tables with F11 by adding a 3 second timeout to all WinWaitActive calls.
2. Have removed the ghosted "remove MTT popups" option, as it looks like we will never find an AHK method round these.
3. Have added a "Quick-Leave Non-Started SNGs" option that saves you from pressing OK on the dialog box when you want to exit a SNG that hasn't started yet. This should be used carefully, especially if there are already 9 players seated...
4. Have made it so that the push() function now double checks that the bet-amount edit box has actually been changed and if it hasn't then it's redoes it (this is done to fix the occasional times it min-raises instead of pushes all-in...).
5. We now make sure that the "raise" button gets the focus before it gets clicked (2p2er "sence" reported that sometimes it would fail to click the button for him - this may have been the reason...).
6. Have improved the FocusLooby() procedure so as to make sure the table list get focus before we do anything else.
7. Have increased the priority of the middle mouse button hotkey to try to fix the "minraise bug".

The "minraise instead of push" bug should be fixed now.

I still haven't worked out a fix for the F11 hotkey opening "old" tables (the listbox isn't updating as fast after a client update), but I have tried to mitigate it in the new code by adding some delays (the best way round it is to first press F10 to refresh the list, then wait 2-3 seconds and then press F11 to open a new table).

I've also just been told that the auto-timebank clicker isn't working postflop, but have yet to confirm or look into it.

As always, the script is posted here.

Juk
New script: PartySNGHelper Quote
01-05-2009 , 06:33 PM
Ok I haven't played on Party for a couple years and was just wondering whether stacking tables works with their current software, i.e do the tables pop up correctly or do they get lost in the stack and/or pop up at random?
New script: PartySNGHelper Quote

      
m