Dave or anyone smart...
I'm learning AHK and have been playing around with some scripts to make 30+ tabling STTs easier.
I've put together the following script to select between two preset saved custom stars table layouts... I use these instead of table navigator because I want to move windows around myself (often), and navigator locks the tables in place. I've also modified Quetzos script (thank you man) to auto-sort tables by blind level, so that I can hit Ctrl-Middle Mouse Button and sort between low and high blind tables. I'm thinking it would be great to be able to toggle the stars auto-pop tables setting so that the focus isn't stolen when I take notes.
My questions are:
1) Is there a better way to enable/disable stars auto pop-up than {pseudo-code}...?
- Activate Stars Lobby
- send Alt-O, {up}{up}{up}{enter} (which selects advanced multitabling options)
- send click to the coords of the little checkbox
- send a {tab} till OK is selected and then send {enter}
and
2) Can I lock user input and stop anything from stealing focus until the script has finished running? Sometimes using "send" along with the {alt} key and then sending keyboard shortcuts doesn't bring up the menu and then the script is clicking somewhere that it shouldn't. is there a better way to guarantee that the proper menus have been brought up before sending mouseclicks?
Code:
;; Clicks custom layout 7 from stars layout menu-- adjust coords. for your layout of choice
^LButton::
IfWinExist PokerStars Lobby
{
mousegetpos XCheese, YCheese
WinActivate
sleep, 10
send {Ctrl Up}
send {alt}
sleep, 10
send V
sleep, 10
send {click 355,226}
mousemove XCheese, YCheese
return
}
IfWinNotExist Pokerstars Lobby - Logged in as CheeseMoney
msgbox Can't find Pokerstars
return
;; ctrl-right mouse button clicks layout #1 from stars layout menu
^RButton::
IfWinExist PokerStars Lobby
{
mousegetpos XCheese, YCheese
WinActivate
sleep, 10
send {Ctrl Up}
send {alt}
sleep, 10
send V
send {click 355,131}
mousemove XCheese, YCheese
return
}
IfWinNotExist Pokerstars Lobby - Logged in as CheeseMoney
msgbox Can't find Pokerstars
return
;; Thanks Quetzo
;; Control Middle Button Stacks tables in top left and moves tables of bb400 to top right
^MButton::
BB20 = 0,0
BB30 = 0,0
BB50 = 0,0
BB100 = 0,0
BB150 = 0,0
BB200 = 0,0
BB225 = 0,0
BB400 = 800,0
BB600 = 800,0
BB800 = 800,0
BB1200 = 800,0
Loop, 1
{
WinGet, tableList, List, ahk_class PokerStarsTableFrameClass
Loop, %tableList%
{
id := tableList%A_Index%
WinGetTitle, title, ahk_id %id%
StringMid, starsBB, title, InStr(title,"/")+2, InStr(title,"/")-InStr(title,"Blinds")-7
StringReplace, starsBB, StarsBB, %A_Space%,,All
if (starsBB = 200)
{
IfInString, title, Ante
{
starsBB := 225
}
}
StringSplit, coordinatesArray, BB%starsBB%, `,
WinGetPos, posX, posY,,, ahk_id %id%
if (posX != coordinatesArray1 OR posY != coordinatesArray2)
{
WinMove, ahk_id %id%,, %coordinatesArray1%, %coordinatesArray2%
}
}
Sleep, 1000
}
return