Two Plus Two Publishing LLC Two Plus Two Publishing LLC
 

Go Back   Two Plus Two Poker Forums > Internet Poker > Software

Notices

Software Discussions about gambling-related and poker software.

Reply
 
Thread Tools Display Modes
Old 02-18-2009, 10:19 AM   #1
Pooh-Bah
 
Hood's Avatar
 
Join Date: Apr 2004
Location: 99 problems but a TT+ just ship pf
Posts: 5,238
Post AHK: Check for registered tournies not loaded - Pokerstars

Edit: damn it forgot "pokerstars" in thread title, sorry this for stars only, but i think FTP has a similar setting so could be modified for that i guess, but the issue is with stars really

Honestly I'm not sure if this is much use to anyone, but i thought i would throw it out there. when I played a few sets of stars recently, i would sometimes get tournaments not loading up. not sure if this was my screwup or stars, i know there's sometimes an issue with stars with games not loading (something to do with stars lobbies getting closed down too fast?). Anywho that would lead to paranoia that i'm missing tables and me constantly counting how many games are loaded up.

So what this script does is automated the process. Hit ctrl-alt-t and it will fire a "Registered in tournaments" request to stars. For each table in that list, if it has "running" in the title, it will check that a table matching that ID is loaded. If it's not, it'll warn you with a message box - click Yes (or wait 3 seconds for the timeout) and the script will then try and launch that table window - by doing Find a Tourney > Enter in ID > Wait for lobby > click "Take my seat" > wait for table > shut down lobby.

It's a pretty long process but it works quite smoothly. i dont actually have money on stars to test this out whilst actually multitabling a set, so i dont know how useful this will be when there's a real case of "missing sng", but it will at least reduce my paranoia and table counting if nothing else.

Code:
;Script configuration
#NoEnv
#SingleInstance force
#Include %a_scriptDir%
Process, priority, , High
SendMode Input
SetWorkingDir %a_scriptDir%

GroupAdd StarsTables, ahk_class PokerStarsTableFrameClass
return

^!t::
checkTournies()
return

checkTournies() {
    SetKeyDelay, 0
    WinGet, lobbyID, id, PokerStars Lobby
    if (!lobbyID) {
        msgbox Stars lobby not found!
        return
    }
    
    ; Send ctrl-r to the lobby - this will work even if it's minimized, inactive etc
    WinMenuSelectItem, ahk_id %lobbyID%, , Requests, Registered In Tournaments
    
    ; Wait for the registered tourney popup
    WinWait Registered In Tournaments, , 4
    if (ErrorLevel) {
        msgbox Failed to launch a 'Registered in Tournaments' request.
        return
    }
    
    ; Get contents of list box, then send escape to cancel
    ControlGet, listdata, List,, ListBox1
    ControlSend, , {ESC}, Registered In Tournaments
    
    
    Loop, Parse, listdata, `n
    {
        tourneyline = %A_LoopField%
        if (instr(tourneyline, "running")) {
            tourneyid := SubStr(tourneyline, 1, instr(tourneyline, " ") - 1)
            
            ; Do we have this table open?
            WinGet tableid, id, Tournament %tourneyid% ahk_group StarsTables
            if (!tableid) {
                MsgBox, 4, , Tournament %tourneyid% not found! Try and launch it?, 3  ; 5-second timeout.
                IfMsgBox, No
                    ; For a no, continue to the next table
                    continue
                    
                ; Otherwise (this includes a timeout, or a Yes, launch table
                launchTourney(lobbyID, tourneyid)
            }
        }
    }
}

; Launch a 'find a tournament' window
launchTourney(lobbyID, tourneyid) {
    WinMenuSelectItem, ahk_id %lobbyID%, , Requests, Find A Tournament...
    WinWait Find a Tournament, , 2
    if (ErrorLevel) {
        msgbox Failed to launch the 'Find a Tournament' request.
        return 
    }
    
    ; Enter in the tournament ID
    ControlSetText Edit1, %tourneyid%, Find a Tournament
    Sleep, 10
    ControlSend, , {Enter}, Find a Tournament
    
    ; Wait for tourney lobby
    lobbytitle = Tournament %tourneyid% Lobby
    WinWait %lobbytitle%, , 6
    if (ErrorLevel) {
        msgbox Failed to find tournament lobby '%lobbytitle%'
        return
    }
    ControlClick PokerStarsButtonClass7, %lobbytitle%
    WinWait Tournament %tourneyid% ahk_group StarsTables, , 10
    if (ErrorLevel) {
        msgbox Failed to bring up table.
        return
    }
    WinClose %lobbytitle%
    WinWaitClose %lobbytitle%, , 10
}

Last edited by Beerocrat; 02-18-2009 at 06:38 PM.
Hood is offline   Reply With Quote
Old 02-18-2009, 10:30 AM   #2
journeyman
 
RandomRange's Avatar
 
Join Date: Apr 2008
Location: Finland
Posts: 388
Re: AHK: Check for registered tournies not loaded

Sweet! I was planning to implement this myself, but you saved the trouble from me. Thank you very much!
RandomRange is offline   Reply With Quote
Old 02-18-2009, 10:31 AM   #3
Carpal \'Tunnel
 
jurrasstoil's Avatar
 
Join Date: Sep 2007
Location: ❤σ²
Posts: 8,595
Re: AHK: Check for registered tournies not loaded

i guess spacegravy and many others will name their firstborn after you

PS: Too edit the thread title just double click next to it in the forum view.
jurrasstoil is online now   Reply With Quote
Old 02-18-2009, 11:06 AM   #4
Pooh-Bah
 
Hood's Avatar
 
Join Date: Apr 2004
Location: 99 problems but a TT+ just ship pf
Posts: 5,238
Re: AHK: Check for registered tournies not loaded

Quote:
Originally Posted by jurrasstoil View Post
PS: Too edit the thread title just double click next to it in the forum view.
be say the what now?

update to use some sexy balloon tips instead of message boxes, with a summary at the end with a count of all tournaments and running tournaments.

Code:
;Script configuration
#NoEnv
#SingleInstance force
#Include %a_scriptDir%
Process, priority, , High
SendMode Input
SetWorkingDir %a_scriptDir%

GroupAdd StarsTables, ahk_class PokerStarsTableFrameClass
return

^!t::
checkTournies()
return

RemoveTrayTip:
SetTimer, RemoveTrayTip, Off
TrayTip
return

setTrayTip(text, seconds=5, options=1) {
    ms := seconds * 1000
    TrayTip, Stars Tourney Checker, %text%, , %options%
    SetTimer RemoveTrayTip, %ms%
    return
}

checkTournies() {
    SetKeyDelay, 0
    WinGet, lobbyID, id, PokerStars Lobby
    if (!lobbyID) {
        setTrayTip("Stars lobby not found!", 3, 1)
        return
    }
    
    ; Send ctrl-r to the lobby - this will work even if it's minimized, inactive etc
    WinMenuSelectItem, ahk_id %lobbyID%, , Requests, Registered In Tournaments
    
    ; Wait for the registered tourney popup
    WinWait Registered In Tournaments, , 4
    if (ErrorLevel) {
        setTrayTip("Failed to launch the 'registered in tournaments' request.", 3, 3)
        return
    }
    
    ; Get contents of list box, then send escape to cancel
    ControlGet, listdata, List,, ListBox1
    ControlSend, , {ESC}, Registered In Tournaments
    
    tall := 0
    trunning := 0
    tnotfound := 0
    failure := false
    Loop, Parse, listdata, `n
    {
        tourneyline = %A_LoopField%
        if (instr(tourneyline, "running")) {
            tourneyid := SubStr(tourneyline, 1, instr(tourneyline, " ") - 1)
            
            ; Do we have this table open?
            WinGet tableid, id, Tournament %tourneyid% ahk_group StarsTables
            if (!tableid) {
                setTrayTip("Tourney " . tourneyid . " not found.`nTrying to launch...", 3, 2)
                 if (!launchTourney(lobbyID, tourneyid)) {
                    ; if there's a failure, quit the loop
                    failure := true
                    break
                 }
                tnotfound := tnotfound + 1
            }
            trunning := trunning + 1
        }
        tall := tall + 1
    }
                
    ; Set a summary tooltip
    if (!failure) {
        if (tall == 0) {
            tiptext := "No registered tournies found."
            
        } else if (tnotfound == 0) {
            tiptext := "All running tournies are open.`n`n"
            tiptext := tiptext . "Tournies registered: " . tall . "`n"
            tiptext := tiptext . "Total running: " . trunning . "`n"
            
        } else {
            tiptext := tiptext . "Successfully launched " . tnotfound . " tournament(s)`n`n"
            tiptext := tiptext . "Tournies registered: " . tall . "`n"
            tiptext := tiptext . "Total running: " . trunning . "`n"
            
        }
        setTrayTip(tiptext, 5, 1)
    }

}

; Launch a 'find a tournament' window
launchTourney(lobbyID, tourneyid) {
    WinMenuSelectItem, ahk_id %lobbyID%, , Requests, Find A Tournament...
    WinWait Find a Tournament, , 2
    if (ErrorLevel) {
        setTrayTip("Failed to launch the 'Find a Tournament' request.", 3, 3)
        return false
    }
    
    ; Enter in the tournament ID
    ControlSetText Edit1, %tourneyid%, Find a Tournament
    Sleep, 10
    ControlSend, , {Enter}, Find a Tournament
    
    ; Wait for tourney lobby
    lobbytitle = Tournament %tourneyid% Lobby
    WinWait %lobbytitle%, , 6
    if (ErrorLevel) {
        setTrayTip("Failed to find tournament lobby '" . lobbytitle . "'", 3, 3)
        return false
    }
    ControlClick PokerStarsButtonClass7, %lobbytitle%
    WinWait Tournament %tourneyid% ahk_group StarsTables, , 10
    if (ErrorLevel) {
        setTrayTip("Failed to bring up table.", 3, 3)
        return false
    }
    WinClose %lobbytitle%
    WinWaitClose %lobbytitle%, , 10
    return true
}
Hood is offline   Reply With Quote
Old 02-18-2009, 11:16 AM   #5
Pooh-Bah
 
MegaFossil's Avatar
 
Join Date: Feb 2007
Location: Blog updated 4/21, link in profile
Posts: 4,608
Re: AHK: Check for registered tournies not loaded

Not sure if anyone has this problem, but when you stack and play continuously, it will happen where a new tourney opens at the exact moment I'm trying to close a completed one, so I close the wrong one and the completed tourney remains open. Then I'll have to go thru and locate the fresh tourney and manually open it. Probably happens about 2 times out of 100, and it's possible some tournies may slip thru the cracks, so to speak.

If this program works well, I'll probably ship the creator a modest donation.

Also, can anyone tell me if debustifier is worthwhile or not. I think I need to update my AHK scripts.
MegaFossil is offline   Reply With Quote
Old 02-18-2009, 11:19 AM   #6
Pooh-Bah
 
Hood's Avatar
 
Join Date: Apr 2004
Location: 99 problems but a TT+ just ship pf
Posts: 5,238
Re: AHK: Check for registered tournies not loaded

donations to hood34 on stars gogoogo one time etc
issue should fix exactly your problem

however yeah stars debustifier works a charm for me, no reason not to use it.
Hood is offline   Reply With Quote
Old 02-18-2009, 11:27 AM   #7
Pooh-Bah
 
MegaFossil's Avatar
 
Join Date: Feb 2007
Location: Blog updated 4/21, link in profile
Posts: 4,608
Re: AHK: Check for registered tournies not loaded

Meh, I was gonna ship a donation every week for the rest of this year, but since you said 'one time', I'll just do one. Hehe j/k.

Thanks again man, any little bit helps when you're 30-38 tabling.
MegaFossil is offline   Reply With Quote
Old 02-18-2009, 12:14 PM   #8
Carpal \'Tunnel
 
TruFloridaGator's Avatar
 
Join Date: Feb 2005
Location: in the Poker Rights' Trenches
Posts: 22,335
Re: AHK: Check for registered tournies not loaded

If I use this at all, definitely donating. In the mean time, welcome to the jungle..err the FAQ(tools, links thread)
TruFloridaGator is offline   Reply With Quote
Old 02-18-2009, 12:33 PM   #9
Carpal \'Tunnel
 
EnglishLad72's Avatar
 
Join Date: Dec 2007
Posts: 6,686
Re: AHK: Check for registered tournies not loaded

Since the first time I experienced this problem last week, I maniacally check how many tournaments I have registered for, and how many have opened..

Then I keep checking, like Rain Man

thanks!
EnglishLad72 is offline   Reply With Quote
Old 02-18-2009, 02:53 PM   #10
Pooh-Bah
 
Sly Caveat's Avatar
 
Join Date: Aug 2007
Posts: 5,295
Re: AHK: Check for registered tournies not loaded

Thanks, I will def. try this out. I have this happen about once a day. I leave my lobbies open, so that doesn't always help. At the end of the day I request a tournament summary from stars and check the number of tourney folders on my computer against it. It's off by one or two quite often and I have to go through and painstakingly find the one I didn't play and request a refund. Stars needs to get on the ball and help us with this. I have given them numerous suggestions.
Sly Caveat is offline   Reply With Quote
Old 02-18-2009, 06:36 PM   #11
Pooh-Bah
 
Sly Caveat's Avatar
 
Join Date: Aug 2007
Posts: 5,295
Re: AHK: Check for registered tournies not loaded

Hood- Works great. The only problem is having to constantly remember to check. Any way you can set a timer on it to check repeatedly while you're loading a set?
Sly Caveat is offline   Reply With Quote
Old 02-19-2009, 09:34 AM   #12
old hand
 
#1ThunderFan's Avatar
 
Join Date: Feb 2009
Location: In your face!
Posts: 1,827
Re: AHK: Check for registered tournies not loaded - Pokerstars

Awesome script. Tried it out last night and worked like a charm.
#1ThunderFan is offline   Reply With Quote
Old 02-19-2009, 12:17 PM   #13
Pooh-Bah
 
Hood's Avatar
 
Join Date: Apr 2004
Location: 99 problems but a TT+ just ship pf
Posts: 5,238
Re: AHK: Check for registered tournies not loaded

Quote:
Originally Posted by Sly Caveat View Post
Hood- Works great. The only problem is having to constantly remember to check. Any way you can set a timer on it to check repeatedly while you're loading a set?
Yes it would be pretty easy to do, but honestly i dont think you'd want it. Problem is the script needs to take control of windows activity for a second or two each time it checks but requesting windows to pop up. this happening every minute whilst you're trying to multitable will be frustrating, lead to misclicks, etc.

I would just load your set, wait a minute, then run it once a few tables have loaded, then again when they're all up.
Hood is offline   Reply With Quote
Old 02-19-2009, 01:27 PM   #14
Pooh-Bah
 
Sly Caveat's Avatar
 
Join Date: Aug 2007
Posts: 5,295
Re: AHK: Check for registered tournies not loaded

Quote:
Originally Posted by Hood View Post
Yes it would be pretty easy to do, but honestly i dont think you'd want it. Problem is the script needs to take control of windows activity for a second or two each time it checks but requesting windows to pop up. this happening every minute whilst you're trying to multitable will be frustrating, lead to misclicks, etc.

I would just load your set, wait a minute, then run it once a few tables have loaded, then again when they're all up.
What about a reminder feature where the balloon pops up every two minutes until you turn it off or something? I have found already that once my set gets frantic it's easy to forget to run it after they are all open.
Sly Caveat is offline   Reply With Quote
Old 02-25-2009, 05:42 PM   #15
Carpal \'Tunnel
 
TruFloridaGator's Avatar
 
Join Date: Feb 2005
Location: in the Poker Rights' Trenches
Posts: 22,335
Re: AHK: Check for registered tournies not loaded - Pokerstars

donated btw
TruFloridaGator is offline   Reply With Quote

Reply
      

Thread Tools
Display Modes

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -4. The time now is 02:27 PM.


Powered by vBulletin®
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.6.0 ©2011, Crawlability, Inc.
Copyright © 2008-2010, Two Plus Two Interactive