Open Side Menu Go to the Top
Register
AHK script:Stars Filtered SNG Opener AHK script:Stars Filtered SNG Opener

02-28-2011 , 05:41 PM
Anyone have this working? I tried it out recently and didn't seem to be working.
AHK script:Stars Filtered SNG Opener Quote
02-28-2011 , 06:22 PM
bballwiz, here is the version i use myself, works pretty good (for black lobby theme at least).

Code:
; Author:         Everlong@2p2 Code assembled from misc sources, thanks to _dave_, chris228, finnisher
; v.4.0a
; added: option to atuobuyin if full, hide/show window
; fixed issue with skipping first sng in lobby
; 4.0 version fixed by Max1mums 
#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%
#SingleInstance, Force
SetTitleMatchMode, 2
SetTimer, register, off
SetTimer, safeguard, off
StringTrimRight, thisahk, A_ScriptName, 4

;;;;;;;;;;;SET YOUR PokerStars folder path here;;;;;;;;;;;;;;;
;pspath:="C:\Program Files\PokerStars\"
IniRead, pspath, %thisahk%.ini, Settings, path
logfile:= pspath . "pokerstars.log.0"
IfNotExist %logfile%
{
 If A_OSVersion in WIN_VISTA
{		
IniWrite, %A_AppData%\Pokerstars\, %thisahk%.ini, Settings, path
IniRead, pspath, %thisahk%.ini, Settings, path 
logfile:= pspath . "pokerstars.log.0"
IfNotExist %logfile%
{
 StringGetPos,pos, pspath,Roaming
 StringLeft, pspath, pspath, %pos%
 pspath:=pspath . "Local\Pokerstars\"
 IniWrite, %pspath%, %thisahk%.ini, Settings, path
}
}
 Else							
 IniWrite, %ProgramFiles%\Pokerstars\, %thisahk%.ini, Settings, path
 IniRead, pspath, %thisahk%.ini, Settings, path
}
;==============================================================
tcount=0
tcounter:="tcounter.ini"
IfExist, %tcounter%
FileDelete, %tcounter%
RegSofar=0
OpenTables=0
trows=17
SysGet,mon, MonitorworkArea
fivesec=0
two=0
ddlist4=Off|
ddlist5=Off|
ddlist6=Off|
ddlist7=Off|
LobbyList=Default|Black|
ddlist2:=ddlist2 . 1 . "|"
Loop 100
{
two:=two+2
ddlist3:=ddlist3 . two . "|"
ddlist:=ddlist . A_index . "|"
If (A_index<51)
{
fivesec:=fivesec+5
ddlist2:=ddlist2 . fivesec . "|"
ddlist5:=ddlist5 . fivesec . "|"
ddlist6:=ddlist6 . fivesec . "|"
If (A_index<22)
{
ddlist7:=ddlist7 . A_Index . "|"
If (A_index<16)
{
ddlist4:=ddlist4 . A_index . "|"
}
}
}
}
ddlist3:=ddlist3 . 9999 . "|"
Gosub, BuildGui
Return

BuildGui:
Gui, color, white
Gui, font, cOlive
Gui, add, tab, h340 w240, General|Advanced Settings
Gui, add, text, , Auto-register
Gui, add, Checkbox, yp xp+80 Check3 Checked-1 vRegister
Gui, add, text, yp xp+30, Reg. next if full?
Gui, add, Checkbox, yp xp+80 AutoIfFull VAutoifFull


Gui, add, text,xp-190 yp+30 , Register every (sec):
Gui, add, DropDownList, w50 yp-5 xp+140  vInterval1, %ddlist2%
Gui, add, text, xp-140 yp+30, No of SNG:s to keep open:
Gui, add, DropDownList, w50 yp-5 xp+140 vKeepOpen , %ddlist%
Gui, add, text,xp-140 yp+30, Limit total SNG:s to:
Gui, add, DropDownList, w50 yp-5 xp+140 vTotalLimit , %ddlist3%
Gui, add, text,xp-140 yp+30, Limit total time to (min):
Gui, add, DropDownList, w50 yp-5 xp+140 vTimeLimit , %ddlist5%

Gui, add, text, xp-140 yp+30 cred vcdown w200
Gui, add, text, xp  yp+30 w200 vRegSofar, SNG:s registered so far:
Gui, add, text,  w200 vOpenTables, Tables open/waiting:
Gui, add, text, w200 cRed vStatus, Status: Idle
Gui, add, Button, w68 ggetgui, &Submit+Run
Gui, add, text, xp+72 yp+5, (Autosaves your settings)
Gui, Add, Button, Disabled xp-72 yp+20 w48 h20 Center, &Resume
Gui, Add, Button, Disabled  w45 h20 yp xp+48 Center, &Pause
Gui, Add, Button, w80 h20 yp xp+45 Center globbyrestore, &Lobby restore
Gui, Add, Button, w45 h20 yp xp+80 gDonate, &Donate
Gui, tab, 2

Gui, add, Text, x25 y65 , Lobby Theme:
Gui, add, DropDownList, w65 yp-5 xp+140 vLobby, %LobbyList%
Gui, add, text,xp-140 yp+30 , Close lobbies every (sec):
Gui, add, DropDownList, w50 yp-5 xp+140  vCloseInterv, %ddlist6%
Gui, add, text, xp-140 yp+18 , (manually Close with ctrl+e)
Gui, add, text, yp+30, Disable if no user Input (min):
Gui, add, DropDownList, w50 yp-5 xp+140 vGuardtimer Choose1 , %ddlist4%
Gui, add, text, xp-140 yp+30 ,Batch-register?
Gui, add, Checkbox,yp xp+140 vBatchReg
Gui, add, text, yp+20 xp-140 ,SetReg* mode?
Gui, add, Checkbox,yp xp+140 vSetReg
Gui, add, text, yp+20 xp-140 ,Minimize lobby?
Gui, add, Checkbox,yp xp+140 vMinlob
Gui, add, Text, xp-140 yp+30, Times to scroll down:
Gui, add, DropDownList, w50 yp-5 xp+140 vscrldwn, %ddlist7%
Gui, add, Text, xp-140 yp+25, Always start at top of lobby?
Gui, add, Checkbox, yp xp+140 vTopReturn
/*
Gui, tab, 3
Gui, add, text, , Manually populate list: F11
Gui, Add, ListView,  r%trows%  grid gFindLobby w200 c1, Registered in Tournaments
*/
Gui, show, w256, %thisahk%
WinGetPos, x, y, w, h, SFSO
;x:=monRight-w
;y:=monBottom-h
x:=monLeft
y:=monTop
Gosub, GetIni
Gui, show, x%x% y%y%, %thisahk%
Return

getgui:
GuiControl,, Register, -1
Register = 1
IfExist, %tcounter%
FileDelete, %tcounter%
tcount:=0
Gui, Submit, NoHide
displayedTime=
If (lobby="Default")
{
;regButton:="PokerStarsButtonClass7"
regButton:="PokerStarsButtonClass8"
}
Else If (lobby="Black" or lobby="Custom*")
{
regButton:="PokerStarsButtonClass8"
}
Gosub, TimeLimit
Gosub, MakeIni
GuiControl, Enable, Pause
GuiControl, Disable, Resume
interval:=interval1*1000

If !interval
interval=off

If guardtimer is not Number
{
SetTimer, safeguard, off
}
Else
{
killtime:=guardtimer*60000
SetTimer, safeguard, 1000
}
if CloseInterv is not number
SetTimer, NukeLobbies, off
else
{
lobclose:=CloseInterv*1000
SetTimer, NukeLobbies, %lobclose%
}
register=1
SetTimer, Register, %interval%
Gosub, ButtonResume
Return

Safeguard:
If (A_TimeIdle > killtime)
{
Gosub, ButtonPause
GuiControl, , cdown, Stopped  due to inactivity!!! %displayedTime%
}
Return

TimeLimit:
If TimeLimit is Number
{
allowedMinutes := timeLimit
endTime := A_Now
endTime += %allowedMinutes%, Minutes
SetTimer, CountDown, 1000
}
Else
{
GuiControl, , cdown, Time Limit off
}
Return

Countdown:
remainingTime := endTime
EnvSub remainingTime, %A_Now%, Seconds
m := remainingTime // 60
s := Mod(remainingTime, 60)
displayedTime := Format3Digits(m) ":" Format2Digits(s)
GuiControl, , cdown, Running another (mm:ss): %displayedTime%
If (A_now > endTime)
{
SetTimer, Countdown, off
Gosub, ButtonPause
GuiControl, , cdown, Time Limit reached.
}
Return

GuiClose:
Gui, Submit
Gosub, MakeIni
ExitApp
Return

ButtonResume:
Gui, Submit, NoHide
If PausedTime is Number
{
TimeLimit:=PausedTime
}
Gosub, TimeLimit

GuiControl, Disable, Resume
GuiControl, Enable, Pause
GuiControl, , Register, -1
Register=1
IfExist, %tcounter%
FileDelete, %tcounter%
tcount:=0
Gosub, Register
SetTimer, Register, %Interval%
Return

ButtonPause:
Critical
Gui, Submit, NoHide
PausedTime:=remainingTime/60
Register:=0
SetTimer, Countdown, off
SetTimer, Register, off
GuiControl, Disable, Pause
GuiControl, Enable, Resume
GuiControl, , Register, 0
GuiControl, , cdown, Manually Paused %displayedTime%
GuiControl, , Status, Status: Waiting ;TEST
Return

Register:
SetTitleMatchMode, 2
WinGet, LobbyID, id, PokerStars Lobby

If !LobbyID
{
Gosub, ButtonPause
GuiControl,, Status, Status: PokerStars Lobby not found
Gui, show, NoActivate, %thisahk%
Return
}
If (TopReturn=1)
{
ControlSend, PokerStarsListClass6, {NumpadUp 20}, ahk_id%lobbyid%
}
WinGet, PhysicalTables, list,Table ahk_class PokerStarsTableFrameClass
If PhysicalTables is not Number
PhysicalTables:=0
If (PhysicalTables >= KeepOpen)
{
GuiControl,, Status, Set Full waiting
Gui, show, NoActivate, %thisahk%
Return
}
OpenTables:=CountTourneys()
If OpenTables is not Number
OpenTables=0
GuiControl, , OpenTables, Tables open/waiting: %OpenTables%
GuiControl, , RegSofar, SNG:s registered so far: %RegSofar%
Gui, show, NoActivate, %thisahk%

If (RegSofar >= TotalLimit)
{
Gosub, ButtonPause
GuiControl, , cdown, SNG Total Limit reached
GuiControl, , Status, Status: Idle ;TEST
Return
}
If (OpenTables >= TotalLimit)
{
Gosub, ButtonPause
GuiControl, , cdown, SNG Total Limit reached
GuiControl, , Status, Status: Idle ;TEST
Return
}
If (OpenTables>=KeepOpen)
{
GuiControl, , OpenTables, Tables open/waiting: %OpenTables% (Set full)
GuiControl, , Status, Status: Waiting ;TEST
Return
}
Else
{
If (BatchReg=1)
{
Times:= KeepOpen - OpenTables
RegSNGexec(LobbyID, Times, scrldwn)
}
Else
{
RegSNGexec(LobbyID, 1, scrldwn)
}
}
Return
MakeIni:
IniWrite, %AutoIfFull%, %thisahk%.ini, Settings, AutoIfFull
IniWrite, %TopReturn%, %thisahk%.ini, Settings, TopReturn
IniWrite, %scrldwn%, %thisahk%.ini, Settings, scrldwn
IniWrite, %Lobby%, %thisahk%.ini, Settings, Lobby
IniWrite, %BatchReg%, %thisahk%.ini, Settings, BatchReg
IniWrite, %Setreg%, %thisahk%.ini, Settings, SetReg
IniWrite, %Minlob%, %thisahk%.ini, Settings, MinLob
IniWrite, %Interval1%, %thisahk%.ini, Settings, Interval1
IniWrite, %AutoClose%, %thisahk%.ini, Settings, AutoClose
IniWrite, %CloseInterv%, %thisahk%.ini, Settings, CloseInterv
IniWrite, %KeepOpen%, %thisahk%.ini, Settings, KeepOpen
IniWrite, %TotalLimit%, %thisahk%.ini, Settings, TotalLimit
IniWrite, %GuardTimer%, %thisahk%.ini, Settings, GuardTimer
IniWrite, %TimeLimit%, %thisahk%.ini, Settings, TimeLimit
Return

GetIni:
IfExist, %thisahk%.ini
{
IniRead, AutoIfFull, %thisahk%.ini, Settings, AutoIfFull
IniRead, TopReturn, %thisahk%.ini, Settings, TopReturn,0
IniRead, scrldwn, %thisahk%.ini, Settings, scrldwn
IniRead, Lobby, %thisahk%.ini, Settings, Lobby
IniRead, BatchReg, %thisahk%.ini, Settings, BatchReg
IniRead, SetReg, %thisahk%.ini, Settings, SetReg, 1
IniRead, MinLob, %thisahk%.ini, Settings, MinLob, 0
IniRead, Interval1, %thisahk%.ini, Settings, Interval1
IniRead, CloseInterv, %thisahk%.ini, Settings, CloseInterv
IniRead, AutoClose, %thisahk%.ini, Settings, AutoClose
IniRead, KeepOpen, %thisahk%.ini, Settings, KeepOpen
IniRead, TotalLimit, %thisahk%.ini, Settings, TotalLimit
IniRead, GuardTimer, %thisahk%.ini, Settings, GuardTimer, Off
IniRead, TimeLimit, %thisahk%.ini, Settings, TimeLimit, Off
GuiControl, , AutoIfFull, %AutoIfFull%
StringReplace, ddlist7, ddlist7, %scrldwn%, %scrldwn%|
GuiControl, , scrldwn, |%ddlist7%
StringReplace, LobbyList, LobbyList, %Lobby%, %Lobby%|
GuiControl, , Lobby, |%LobbyList%
GuiControl, , BatchReg, %BatchReg%
GuiControl, , SetReg, %SetReg%
GuiControl, , MinLob, %MinLob%
GuiControl, , TopReturn, %TopReturn%
GuiControl, , AutoClose, %AutoClose%
StringReplace, ddlist2, ddlist2, %interval1%, %Interval1%|
GuiControl, , Interval1, |%ddlist2%
StringReplace, ddlist6, ddlist6, %CloseInterv%, %CloseInterv%|
GuiControl, , CloseInterv, |%ddlist6%
StringReplace, ddlist, ddlist, %KeepOpen%, %KeepOpen%|
GuiControl, , KeepOpen, |%ddlist%
StringReplace, ddlist3, ddlist3, %TotalLimit%, %TotalLimit%|,
GuiControl, , TotalLimit, |%ddlist3%
StringReplace, ddlist4, ddlist4, %GuardTimer%, %GuardTimer%|
GuiControl, , GuardTimer, |%ddlist4%
StringReplace, ddlist5, ddlist5, %TimeLimit%, %TimeLimit%|
GuiControl, , TimeLimit, |%ddlist5%
}
Return
^e::
NukeLobbies:
SetTitleMatchMode, 2
GroupAdd, TLobbies, Lobby,,, PokerStars Lobby
GroupClose, TLobbies, A
Return

#H::
WinHide, %thisahk%
return

#S::
WinShow, %thisahk%
return

F11::
TmpSetReg:=SetReg
SetReg=0
CountTourneys()
SetReg:=TmpSetReg
Return
ManualCount:
CountTourneys()
Return

FindLobby:
If (%A_GuiEvent% = DoubleClick)
{
LV_GetText(TournId,A_EventInfo)
TournID:=SubStr(TournID, 1,10)
WinMenuSelectItem, PokerStars Lobby,, Requests, Find a Tournament
WinWait, Find Tournament ahk_class #32770, , 10
WinGet, fat, id
ControlFocus, Edit1, ahk_id%fat%
Sleep, -1
ControlSend, Edit1, %TournId%, ahk_id%fat%
ControlFocus, Button1, ahk_id%fat%
Sleep, -1
ControlSend, Button1, {Space}, ahk_id%fat%
}
Return

Donate:
donation()
Return

Format2Digits(_val) {
_val += 100
StringRight _val, _val, 2
Return _val
}

Format3Digits(_val) {
_val += 1000
StringRight _val, _val, 3
StringTrimRight, FirstZ, _val, 2
If FirstZ=0
{
StringTrimLeft, _val, _val, 1
}
StringTrimRight, FirstZ, _val, 1
If FirstZ=0
{
StringTrimLeft, _val, _val, 1
}
Return _val
}
LobbyRestore:
WinGet, lobbyid, id, PokerStars Lobby
WinShow, ahk_id%lobbyid%
WinMove, ahk_id%lobbyid%,,0,0
return


RegSNGexec(id, times, scrldwn) {
global RegSofar
global Register
global OpenTables
global KeepOpen
global TotalLimit
global RegButton
global AutoIfFull
Loop %times%
{
;Gosub, ManualCount
;Sleep, 25
;tcount:=0
;tcounter:="tcounter.ini"
;IfExist, %tcounter%
;FileDelete, %tcounter%

ControlSend, PokerStarsListClass6, {NumpadUp 20}, ahk_id%id%

If (OpenTables >= KeepOpen)
Exit
If (OpenTable >= TotalLimit)
Exit
ClickdirectionCount=0
direction=0
GuiControl, , Status, Status: Registering ;TEST
Loop 16
{
If (Register=0)
{
GuiControl, , Status, Status: Idle ;TEST
Exit
}
ControlGet, v, Visible, , %regButton%, ahk_id%id%
If (v = 0)
If (scrldwn!="Off")
{
If (ClickdirectionCount<scrldwn) {
If (direction=0) {
ControlSend, PokerStarsListClass6, {NumpadDown}, ahk_id%id%
} Else {
ControlSend, PokerStarsListClass6, {NumpadUp}, ahk_id%id%
}
ClickdirectionCount:=ClickdirectionCount+1
} Else {
If (direction=0) {
direction:=1
} Else {
direction:=0
}
ClickdirectionCount:=0
}
Sleep 1000
}
If (v = 1)
Break
}

If ( v = 1 ) {
SetTitleMatchMode, 2
ControlFocus, %regButton%, ahk_id%ID%
PostMessage, 0x201, 0x0001,((20<<16)^30),%regButton% , ahk_id%id%
PostMessage, 0x202 , 0,((20<<16)^30),%regButton% , ahk_id%id%
WinWait, Tournament Registration ahk_class #32770, , 3
{
WinGet, regid, id, Tournament Registration
ControlGet, Z, Visible,,Button1, ahk_id%regid%
if Z
{
ControlFocus, Button1, ahk_id%regID%
PostMessage, 0x201, 0x0001,((10<<16)^10),Button1 , ahk_id%id%
PostMessage, 0x202 , 0,((10<<16)^10),Button1 , ahk_id%id%
}

If (AutoIfFull = 1)
{
ControlFocus, Button2, ahk_id%regid%
Sleep, -1
ControlSend, Button2, {Space}, ahk_id%regid%
Sleep, 30
}

Control, Check,,Button3, ahk_id%regid%
ControlFocus, Button3, ahk_id%regid%
PostMessage, 0x201, 0x0001,((10<<16)^10),Button3 , ahk_id%id%
PostMessage, 0x202 , 0,((10<<16)^10),Button3 , ahk_id%id%
;RegSofar++
}

WinWait, Tournament Registration ahk_class #32770, , 3
{
WinGet, regid, id, Tournament Registration
WinGetPos, x, y, w, h, ahk_id%regid%
ControlGetText, ctext, Button1, ahk_id%regid%
If ( cText = "OK" )
{
Control, Check,,Button1, ahk_id%regid%
ControlFocus, Button1, ahk_id%regid%
PostMessage, 0x201, 0x0001,((10<<16)^10),Button1 , ahk_id%id%
PostMessage, 0x202 , 0,((10<<16)^10),Button1 , ahk_id%id%
}
}
if h>145
RegSofar++
GuiControl, , RegSofar, SNG:s registered so far: %RegSofar%
GuiControl, , Status, Status: Waiting ;TEST
Gui, show, NoActivate, %thisahk%
}
}
}

CountTourneys() {
global logfile
If (SetReg=1)
{
Return 0
}
tcount:=0
Loop, Read, %logfile%
{
If (instr(A_LoopReadLine,"RT add")>0) || ((instr(A_LoopReadLine,"TableClientConnection")>0) && (instr(A_LoopReadLine,":connect")>0)) 
{
 if !instr(A_LoopReadLine,"TableClientConnection")
 {
 tnumber:=RegExReplace(A_LoopReadLine, "RT add ", "")
 if instr(tnumber,A_space)
 StringLeft, tnumber, tnumber, instr(tnumber,A_space)-1
 }
 else
 {
 tnumber:=RegExReplace(A_LoopReadLine, "TableClientConnection{table.", "")
 stringleft,tnumber,tnumber,instr(tnumber,A_space)-1
 }
 if !instr(tables,tnumber)
 listadd(tables,tnumber)
}
else
If (instr(A_LoopReadLine,"RT remove")>0) || ((instr(A_LoopReadLine,"TableClientConnection")>0) && (instr(A_LoopReadLine,":disconnect")>0))
{
 if !instr(A_LoopReadLine,"TableClientConnection")
 stringtrimleft,tnumber,A_LoopReadLine,instr(A_LoopReadLine,A_space,"",0)
 else
 {
 tnumber:=RegExReplace(A_LoopReadLine, "TableClientConnection{table.", "")
 stringleft,tnumber,tnumber,instr(tnumber,A_space)-1
 }
 if instr(tables,tnumber)
 listDelItem(tables,tnumber)
}
tnumber=
}

Loop, Parse, tables, -,
{
if A_Loopfield
tcount++
}
return tcount
}

listAdd( byRef list, item, del="-" ) {
  list:=( list!="" ? ( list . del . item ) : item )
  return list
}

listDelItem( byRef list, item, del="-") {
  ifEqual, item,, return list
  list:=del . list . del
  StringReplace, list, list, %item%%del%
  StringTrimLeft, list, list, 1
  StringTrimRight, list, list, 1
  return list
}

donation() {
WinMenuSelectItem, PokerStars Lobby,, Requests, Transfer Funds...
WinWait, Transfer Funds ahk_class #32770, , 10
WinGet, tf, id
ControlFocus, Edit2, ahk_id%tf%
ControlSetText, Edit2, Attilio
ControlFocus, Edit1, ahk_id%tf%
Sleep, -1
ControlSetText, Edit1,
GuiControl, Disable, Donate
}

lobbyStars() {
SetTitleMatchMode 1
WinGet, id, id, PokerStars Lobby
Return id
}
~^!Q::
ExitApp
AHK script:Stars Filtered SNG Opener Quote
02-28-2011 , 06:29 PM
I use the default, but I will try it out, thank you
AHK script:Stars Filtered SNG Opener Quote
03-03-2011 , 12:00 AM
Hey max, does your script work for satellite hyper sngs? I don't really know how it works but i turned it on, put no of sngs to keep open at 10 and registered for a tournament but it doesn't automatically register me to any other sngs.
AHK script:Stars Filtered SNG Opener Quote
03-17-2011 , 08:31 PM
New to these scripts, what do I do with that code? The website for this programme seems to be down.
AHK script:Stars Filtered SNG Opener Quote
03-18-2011 , 08:26 PM
http://www.autohotkey.com/download/
The basic version should do it.

Copy the script that max1mus posted and paste it to notepad or something and save it as e.g. sngopener.ahk
AHK script:Stars Filtered SNG Opener Quote
03-20-2011 , 02:45 AM
does it register you for the first buy-in you register for or can you register for diff buy-ins ex. $6.50 and $15 9mans? Thx all for the help just downloaded it. Haven't used it yet just feeling out how this works before i jump on it.
AHK script:Stars Filtered SNG Opener Quote
04-02-2011 , 04:01 PM
ok I have been using this for well over a year, recently formatted my hdd and totally forgot how to set this up... I have AHK open and maximus' script pasted but I dont think thats what I need. I just need it to auto open/reg sngs.. Its been a while :/
AHK script:Stars Filtered SNG Opener Quote
04-02-2011 , 04:06 PM
Quote:
Originally Posted by Max1mums
Im pretty sure last time I dl'd this file, anyone rehost it?
AHK script:Stars Filtered SNG Opener Quote
04-12-2011 , 04:18 PM
Thanks to Maximus I got it set up and working last week, but now with the latest update it is no longer working once again... cant hurt to bump to see if any programmer can see what is happening here...
AHK script:Stars Filtered SNG Opener Quote
04-12-2011 , 04:38 PM
schlik20, replace PokerStarsButtonClass7 with PokerStarsButtonClass24 and PokerStarsButtonClass8 with PokerStarsButtonClass25
i'll post the fixed version later.
AHK script:Stars Filtered SNG Opener Quote
04-12-2011 , 05:19 PM
Code:
; Author:         Everlong@2p2 Code assembled from misc sources, thanks to _dave_, chris228, finnisher
; v.4.0a
; added: option to atuobuyin if full, hide/show window
; fixed issue with skipping first sng in lobby
; 4.0 version fixed by Max1mums 
#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%
#SingleInstance, Force
SetTitleMatchMode, 2
SetTimer, register, off
SetTimer, safeguard, off
StringTrimRight, thisahk, A_ScriptName, 4

;;;;;;;;;;;SET YOUR PokerStars folder path here;;;;;;;;;;;;;;;
;pspath:="C:\Program Files\PokerStars\"
IniRead, pspath, %thisahk%.ini, Settings, path
logfile:= pspath . "pokerstars.log.0"
IfNotExist %logfile%
{
 If A_OSVersion in WIN_VISTA
{		
IniWrite, %A_AppData%\Pokerstars\, %thisahk%.ini, Settings, path
IniRead, pspath, %thisahk%.ini, Settings, path 
logfile:= pspath . "pokerstars.log.0"
IfNotExist %logfile%
{
 StringGetPos,pos, pspath,Roaming
 StringLeft, pspath, pspath, %pos%
 pspath:=pspath . "Local\Pokerstars\"
 IniWrite, %pspath%, %thisahk%.ini, Settings, path
}
}
 Else							
 IniWrite, %ProgramFiles%\Pokerstars\, %thisahk%.ini, Settings, path
 IniRead, pspath, %thisahk%.ini, Settings, path
}
;==============================================================
tcount=0
tcounter:="tcounter.ini"
IfExist, %tcounter%
FileDelete, %tcounter%
RegSofar=0
OpenTables=0
trows=17
SysGet,mon, MonitorworkArea
fivesec=0
two=0
ddlist4=Off|
ddlist5=Off|
ddlist6=Off|
ddlist7=Off|
LobbyList=Default|Black|
ddlist2:=ddlist2 . 1 . "|"
Loop 100
{
two:=two+2
ddlist3:=ddlist3 . two . "|"
ddlist:=ddlist . A_index . "|"
If (A_index<51)
{
fivesec:=fivesec+5
ddlist2:=ddlist2 . fivesec . "|"
ddlist5:=ddlist5 . fivesec . "|"
ddlist6:=ddlist6 . fivesec . "|"
If (A_index<22)
{
ddlist7:=ddlist7 . A_Index . "|"
If (A_index<16)
{
ddlist4:=ddlist4 . A_index . "|"
}
}
}
}
ddlist3:=ddlist3 . 9999 . "|"
Gosub, BuildGui
Return

BuildGui:
Gui, color, white
Gui, font, cOlive
Gui, add, tab, h340 w240, General|Advanced Settings
Gui, add, text, , Auto-register
Gui, add, Checkbox, yp xp+80 Check3 Checked-1 vRegister
Gui, add, text, yp xp+30, Reg. next if full?
Gui, add, Checkbox, yp xp+80 AutoIfFull VAutoifFull


Gui, add, text,xp-190 yp+30 , Register every (sec):
Gui, add, DropDownList, w50 yp-5 xp+140  vInterval1, %ddlist2%
Gui, add, text, xp-140 yp+30, No of SNG:s to keep open:
Gui, add, DropDownList, w50 yp-5 xp+140 vKeepOpen , %ddlist%
Gui, add, text,xp-140 yp+30, Limit total SNG:s to:
Gui, add, DropDownList, w50 yp-5 xp+140 vTotalLimit , %ddlist3%
Gui, add, text,xp-140 yp+30, Limit total time to (min):
Gui, add, DropDownList, w50 yp-5 xp+140 vTimeLimit , %ddlist5%

Gui, add, text, xp-140 yp+30 cred vcdown w200
Gui, add, text, xp  yp+30 w200 vRegSofar, SNG:s registered so far:
Gui, add, text,  w200 vOpenTables, Tables open/waiting:
Gui, add, text, w200 cRed vStatus, Status: Idle
Gui, add, Button, w68 ggetgui, &Submit+Run
Gui, add, text, xp+72 yp+5, (Autosaves your settings)
Gui, Add, Button, Disabled xp-72 yp+20 w48 h20 Center, &Resume
Gui, Add, Button, Disabled  w45 h20 yp xp+48 Center, &Pause
Gui, Add, Button, w80 h20 yp xp+45 Center globbyrestore, &Lobby restore
Gui, Add, Button, w45 h20 yp xp+80 gDonate, &Donate
Gui, tab, 2

Gui, add, Text, x25 y65 , Lobby Theme:
Gui, add, DropDownList, w65 yp-5 xp+140 vLobby, %LobbyList%
Gui, add, text,xp-140 yp+30 , Close lobbies every (sec):
Gui, add, DropDownList, w50 yp-5 xp+140  vCloseInterv, %ddlist6%
Gui, add, text, xp-140 yp+18 , (manually Close with ctrl+e)
Gui, add, text, yp+30, Disable if no user Input (min):
Gui, add, DropDownList, w50 yp-5 xp+140 vGuardtimer Choose1 , %ddlist4%
Gui, add, text, xp-140 yp+30 ,Batch-register?
Gui, add, Checkbox,yp xp+140 vBatchReg
Gui, add, text, yp+20 xp-140 ,SetReg* mode?
Gui, add, Checkbox,yp xp+140 vSetReg
Gui, add, text, yp+20 xp-140 ,Minimize lobby?
Gui, add, Checkbox,yp xp+140 vMinlob
Gui, add, Text, xp-140 yp+30, Times to scroll down:
Gui, add, DropDownList, w50 yp-5 xp+140 vscrldwn, %ddlist7%
Gui, add, Text, xp-140 yp+25, Always start at top of lobby?
Gui, add, Checkbox, yp xp+140 vTopReturn
/*
Gui, tab, 3
Gui, add, text, , Manually populate list: F11
Gui, Add, ListView,  r%trows%  grid gFindLobby w200 c1, Registered in Tournaments
*/
Gui, show, w256, %thisahk%
WinGetPos, x, y, w, h, SFSO
;x:=monRight-w
;y:=monBottom-h
x:=monLeft
y:=monTop
Gosub, GetIni
Gui, show, x%x% y%y%, %thisahk%
Return

getgui:
GuiControl,, Register, -1
Register = 1
IfExist, %tcounter%
FileDelete, %tcounter%
tcount:=0
Gui, Submit, NoHide
displayedTime=
If (lobby="Default")
{
regButton:="PokerStarsButtonClass24"
}
Else If (lobby="Black" or lobby="Custom*")
{
regButton:="PokerStarsButtonClass25"
}
Gosub, TimeLimit
Gosub, MakeIni
GuiControl, Enable, Pause
GuiControl, Disable, Resume
interval:=interval1*1000

If !interval
interval=off

If guardtimer is not Number
{
SetTimer, safeguard, off
}
Else
{
killtime:=guardtimer*60000
SetTimer, safeguard, 1000
}
if CloseInterv is not number
SetTimer, NukeLobbies, off
else
{
lobclose:=CloseInterv*1000
SetTimer, NukeLobbies, %lobclose%
}
register=1
SetTimer, Register, %interval%
Gosub, ButtonResume
Return

Safeguard:
If (A_TimeIdle > killtime)
{
Gosub, ButtonPause
GuiControl, , cdown, Stopped  due to inactivity!!! %displayedTime%
}
Return

TimeLimit:
If TimeLimit is Number
{
allowedMinutes := timeLimit
endTime := A_Now
endTime += %allowedMinutes%, Minutes
SetTimer, CountDown, 1000
}
Else
{
GuiControl, , cdown, Time Limit off
}
Return

Countdown:
remainingTime := endTime
EnvSub remainingTime, %A_Now%, Seconds
m := remainingTime // 60
s := Mod(remainingTime, 60)
displayedTime := Format3Digits(m) ":" Format2Digits(s)
GuiControl, , cdown, Running another (mm:ss): %displayedTime%
If (A_now > endTime)
{
SetTimer, Countdown, off
Gosub, ButtonPause
GuiControl, , cdown, Time Limit reached.
}
Return

GuiClose:
Gui, Submit
Gosub, MakeIni
ExitApp
Return

ButtonResume:
Gui, Submit, NoHide
If PausedTime is Number
{
TimeLimit:=PausedTime
}
Gosub, TimeLimit

GuiControl, Disable, Resume
GuiControl, Enable, Pause
GuiControl, , Register, -1
Register=1
IfExist, %tcounter%
FileDelete, %tcounter%
tcount:=0
Gosub, Register
SetTimer, Register, %Interval%
Return

ButtonPause:
Critical
Gui, Submit, NoHide
PausedTime:=remainingTime/60
Register:=0
SetTimer, Countdown, off
SetTimer, Register, off
GuiControl, Disable, Pause
GuiControl, Enable, Resume
GuiControl, , Register, 0
GuiControl, , cdown, Manually Paused %displayedTime%
GuiControl, , Status, Status: Waiting ;TEST
Return

Register:
SetTitleMatchMode, 2
WinGet, LobbyID, id, PokerStars Lobby

If !LobbyID
{
Gosub, ButtonPause
GuiControl,, Status, Status: PokerStars Lobby not found
Gui, show, NoActivate, %thisahk%
Return
}
If (TopReturn=1)
{
ControlSend, PokerStarsListClass6, {NumpadUp 20}, ahk_id%lobbyid%
}
WinGet, PhysicalTables, list,Table ahk_class PokerStarsTableFrameClass
If PhysicalTables is not Number
PhysicalTables:=0
If (PhysicalTables >= KeepOpen)
{
GuiControl,, Status, Set Full waiting
Gui, show, NoActivate, %thisahk%
Return
}
OpenTables:=CountTourneys()
If OpenTables is not Number
OpenTables=0
GuiControl, , OpenTables, Tables open/waiting: %OpenTables%
GuiControl, , RegSofar, SNG:s registered so far: %RegSofar%
Gui, show, NoActivate, %thisahk%

If (RegSofar >= TotalLimit)
{
Gosub, ButtonPause
GuiControl, , cdown, SNG Total Limit reached
GuiControl, , Status, Status: Idle ;TEST
Return
}
If (OpenTables >= TotalLimit)
{
Gosub, ButtonPause
GuiControl, , cdown, SNG Total Limit reached
GuiControl, , Status, Status: Idle ;TEST
Return
}
If (OpenTables>=KeepOpen)
{
GuiControl, , OpenTables, Tables open/waiting: %OpenTables% (Set full)
GuiControl, , Status, Status: Waiting ;TEST
Return
}
Else
{
If (BatchReg=1)
{
Times:= KeepOpen - OpenTables
RegSNGexec(LobbyID, Times, scrldwn)
}
Else
{
RegSNGexec(LobbyID, 1, scrldwn)
}
}
Return
MakeIni:
IniWrite, %AutoIfFull%, %thisahk%.ini, Settings, AutoIfFull
IniWrite, %TopReturn%, %thisahk%.ini, Settings, TopReturn
IniWrite, %scrldwn%, %thisahk%.ini, Settings, scrldwn
IniWrite, %Lobby%, %thisahk%.ini, Settings, Lobby
IniWrite, %BatchReg%, %thisahk%.ini, Settings, BatchReg
IniWrite, %Setreg%, %thisahk%.ini, Settings, SetReg
IniWrite, %Minlob%, %thisahk%.ini, Settings, MinLob
IniWrite, %Interval1%, %thisahk%.ini, Settings, Interval1
IniWrite, %AutoClose%, %thisahk%.ini, Settings, AutoClose
IniWrite, %CloseInterv%, %thisahk%.ini, Settings, CloseInterv
IniWrite, %KeepOpen%, %thisahk%.ini, Settings, KeepOpen
IniWrite, %TotalLimit%, %thisahk%.ini, Settings, TotalLimit
IniWrite, %GuardTimer%, %thisahk%.ini, Settings, GuardTimer
IniWrite, %TimeLimit%, %thisahk%.ini, Settings, TimeLimit
Return

GetIni:
IfExist, %thisahk%.ini
{
IniRead, AutoIfFull, %thisahk%.ini, Settings, AutoIfFull
IniRead, TopReturn, %thisahk%.ini, Settings, TopReturn,0
IniRead, scrldwn, %thisahk%.ini, Settings, scrldwn
IniRead, Lobby, %thisahk%.ini, Settings, Lobby
IniRead, BatchReg, %thisahk%.ini, Settings, BatchReg
IniRead, SetReg, %thisahk%.ini, Settings, SetReg, 1
IniRead, MinLob, %thisahk%.ini, Settings, MinLob, 0
IniRead, Interval1, %thisahk%.ini, Settings, Interval1
IniRead, CloseInterv, %thisahk%.ini, Settings, CloseInterv
IniRead, AutoClose, %thisahk%.ini, Settings, AutoClose
IniRead, KeepOpen, %thisahk%.ini, Settings, KeepOpen
IniRead, TotalLimit, %thisahk%.ini, Settings, TotalLimit
IniRead, GuardTimer, %thisahk%.ini, Settings, GuardTimer, Off
IniRead, TimeLimit, %thisahk%.ini, Settings, TimeLimit, Off
GuiControl, , AutoIfFull, %AutoIfFull%
StringReplace, ddlist7, ddlist7, %scrldwn%, %scrldwn%|
GuiControl, , scrldwn, |%ddlist7%
StringReplace, LobbyList, LobbyList, %Lobby%, %Lobby%|
GuiControl, , Lobby, |%LobbyList%
GuiControl, , BatchReg, %BatchReg%
GuiControl, , SetReg, %SetReg%
GuiControl, , MinLob, %MinLob%
GuiControl, , TopReturn, %TopReturn%
GuiControl, , AutoClose, %AutoClose%
StringReplace, ddlist2, ddlist2, %interval1%, %Interval1%|
GuiControl, , Interval1, |%ddlist2%
StringReplace, ddlist6, ddlist6, %CloseInterv%, %CloseInterv%|
GuiControl, , CloseInterv, |%ddlist6%
StringReplace, ddlist, ddlist, %KeepOpen%, %KeepOpen%|
GuiControl, , KeepOpen, |%ddlist%
StringReplace, ddlist3, ddlist3, %TotalLimit%, %TotalLimit%|,
GuiControl, , TotalLimit, |%ddlist3%
StringReplace, ddlist4, ddlist4, %GuardTimer%, %GuardTimer%|
GuiControl, , GuardTimer, |%ddlist4%
StringReplace, ddlist5, ddlist5, %TimeLimit%, %TimeLimit%|
GuiControl, , TimeLimit, |%ddlist5%
}
Return
^e::
NukeLobbies:
SetTitleMatchMode, 2
GroupAdd, TLobbies, Lobby,,, PokerStars Lobby
GroupClose, TLobbies, A
Return

#H::
WinHide, %thisahk%
return

#S::
WinShow, %thisahk%
return

F11::
TmpSetReg:=SetReg
SetReg=0
CountTourneys()
SetReg:=TmpSetReg
Return
ManualCount:
CountTourneys()
Return

FindLobby:
If (%A_GuiEvent% = DoubleClick)
{
LV_GetText(TournId,A_EventInfo)
TournID:=SubStr(TournID, 1,10)
WinMenuSelectItem, PokerStars Lobby,, Requests, Find a Tournament
WinWait, Find Tournament ahk_class #32770, , 10
WinGet, fat, id
ControlFocus, Edit1, ahk_id%fat%
Sleep, -1
ControlSend, Edit1, %TournId%, ahk_id%fat%
ControlFocus, Button1, ahk_id%fat%
Sleep, -1
ControlSend, Button1, {Space}, ahk_id%fat%
}
Return

Donate:
donation()
Return

Format2Digits(_val) {
_val += 100
StringRight _val, _val, 2
Return _val
}

Format3Digits(_val) {
_val += 1000
StringRight _val, _val, 3
StringTrimRight, FirstZ, _val, 2
If FirstZ=0
{
StringTrimLeft, _val, _val, 1
}
StringTrimRight, FirstZ, _val, 1
If FirstZ=0
{
StringTrimLeft, _val, _val, 1
}
Return _val
}
LobbyRestore:
WinGet, lobbyid, id, PokerStars Lobby
WinShow, ahk_id%lobbyid%
WinMove, ahk_id%lobbyid%,,0,0
return


RegSNGexec(id, times, scrldwn) {
global RegSofar
global Register
global OpenTables
global KeepOpen
global TotalLimit
global RegButton
global AutoIfFull
Loop %times%
{
;Gosub, ManualCount
;Sleep, 25
;tcount:=0
;tcounter:="tcounter.ini"
;IfExist, %tcounter%
;FileDelete, %tcounter%

ControlSend, PokerStarsListClass6, {NumpadUp 20}, ahk_id%id%

If (OpenTables >= KeepOpen)
Exit
If (OpenTable >= TotalLimit)
Exit
ClickdirectionCount=0
direction=0
GuiControl, , Status, Status: Registering ;TEST
Loop 16
{
If (Register=0)
{
GuiControl, , Status, Status: Idle ;TEST
Exit
}
ControlGet, v, Visible, , %regButton%, ahk_id%id%
If (v = 0)
If (scrldwn!="Off")
{
If (ClickdirectionCount<scrldwn) {
If (direction=0) {
ControlSend, PokerStarsListClass6, {NumpadDown}, ahk_id%id%
} Else {
ControlSend, PokerStarsListClass6, {NumpadUp}, ahk_id%id%
}
ClickdirectionCount:=ClickdirectionCount+1
} Else {
If (direction=0) {
direction:=1
} Else {
direction:=0
}
ClickdirectionCount:=0
}
Sleep 1000
}
If (v = 1)
Break
}

If ( v = 1 ) {
SetTitleMatchMode, 2
ControlFocus, %regButton%, ahk_id%ID%
PostMessage, 0x201, 0x0001,((20<<16)^30),%regButton% , ahk_id%id%
PostMessage, 0x202 , 0,((20<<16)^30),%regButton% , ahk_id%id%
WinWait, Tournament Registration ahk_class #32770, , 3
{
WinGet, regid, id, Tournament Registration
ControlGet, Z, Visible,,Button1, ahk_id%regid%
if Z
{
ControlFocus, Button1, ahk_id%regID%
PostMessage, 0x201, 0x0001,((10<<16)^10),Button1 , ahk_id%id%
PostMessage, 0x202 , 0,((10<<16)^10),Button1 , ahk_id%id%
}

If (AutoIfFull = 1)
{
ControlFocus, Button2, ahk_id%regid%
Sleep, -1
ControlSend, Button2, {Space}, ahk_id%regid%
Sleep, 30
}

Control, Check,,Button3, ahk_id%regid%
ControlFocus, Button3, ahk_id%regid%
PostMessage, 0x201, 0x0001,((10<<16)^10),Button3 , ahk_id%id%
PostMessage, 0x202 , 0,((10<<16)^10),Button3 , ahk_id%id%
;RegSofar++
}

WinWait, Tournament Registration ahk_class #32770, , 3
{
WinGet, regid, id, Tournament Registration
WinGetPos, x, y, w, h, ahk_id%regid%
ControlGetText, ctext, Button1, ahk_id%regid%
If ( cText = "OK" )
{
Control, Check,,Button1, ahk_id%regid%
ControlFocus, Button1, ahk_id%regid%
PostMessage, 0x201, 0x0001,((10<<16)^10),Button1 , ahk_id%id%
PostMessage, 0x202 , 0,((10<<16)^10),Button1 , ahk_id%id%
}
}
if h>145
RegSofar++
GuiControl, , RegSofar, SNG:s registered so far: %RegSofar%
GuiControl, , Status, Status: Waiting ;TEST
Gui, show, NoActivate, %thisahk%
}
}
}

CountTourneys() {
global logfile
If (SetReg=1)
{
Return 0
}
tcount:=0
Loop, Read, %logfile%
{
If (instr(A_LoopReadLine,"RT add")>0) || ((instr(A_LoopReadLine,"TableClientConnection")>0) && (instr(A_LoopReadLine,":connect")>0)) 
{
 if !instr(A_LoopReadLine,"TableClientConnection")
 {
 tnumber:=RegExReplace(A_LoopReadLine, "RT add ", "")
 if instr(tnumber,A_space)
 StringLeft, tnumber, tnumber, instr(tnumber,A_space)-1
 }
 else
 {
 tnumber:=RegExReplace(A_LoopReadLine, "TableClientConnection{table.", "")
 stringleft,tnumber,tnumber,instr(tnumber,A_space)-1
 }
 if !instr(tables,tnumber)
 listadd(tables,tnumber)
}
else
If (instr(A_LoopReadLine,"RT remove")>0) || ((instr(A_LoopReadLine,"TableClientConnection")>0) && (instr(A_LoopReadLine,":disconnect")>0))
{
 if !instr(A_LoopReadLine,"TableClientConnection")
 stringtrimleft,tnumber,A_LoopReadLine,instr(A_LoopReadLine,A_space,"",0)
 else
 {
 tnumber:=RegExReplace(A_LoopReadLine, "TableClientConnection{table.", "")
 stringleft,tnumber,tnumber,instr(tnumber,A_space)-1
 }
 if instr(tables,tnumber)
 listDelItem(tables,tnumber)
}
tnumber=
}

Loop, Parse, tables, -,
{
if A_Loopfield
tcount++
}
return tcount
}

listAdd( byRef list, item, del="-" ) {
  list:=( list!="" ? ( list . del . item ) : item )
  return list
}

listDelItem( byRef list, item, del="-") {
  ifEqual, item,, return list
  list:=del . list . del
  StringReplace, list, list, %item%%del%
  StringTrimLeft, list, list, 1
  StringTrimRight, list, list, 1
  return list
}

donation() {
WinMenuSelectItem, PokerStars Lobby,, Requests, Transfer Funds...
WinWait, Transfer Funds ahk_class #32770, , 10
WinGet, tf, id
ControlFocus, Edit2, ahk_id%tf%
ControlSetText, Edit2, Attilio
ControlFocus, Edit1, ahk_id%tf%
Sleep, -1
ControlSetText, Edit1,
GuiControl, Disable, Donate
}

lobbyStars() {
SetTitleMatchMode 1
WinGet, id, id, PokerStars Lobby
Return id
}
~^!Q::
ExitApp
AHK script:Stars Filtered SNG Opener Quote
04-12-2011 , 08:01 PM
Quote:
Originally Posted by Max1mums

thanks again brother! youve been a big help!
AHK script:Stars Filtered SNG Opener Quote
04-16-2011 , 04:52 AM
Again, new update and sng opener stopped working.
Pokerstars
AHK script:Stars Filtered SNG Opener Quote
04-27-2011 , 06:02 AM
updates ?
AHK script:Stars Filtered SNG Opener Quote
05-28-2011 , 12:54 AM
push!
AHK script:Stars Filtered SNG Opener Quote
05-28-2011 , 05:37 AM
The update was posted a month ago guys.
AHK script:Stars Filtered SNG Opener Quote
07-25-2011 , 06:37 PM
The site has been down for ages, i accidently deleted it and now can't redownload, anyone know where it is rehosted?
AHK script:Stars Filtered SNG Opener Quote
08-22-2011 , 10:41 AM
Hi all,

Max1mums?

first of all THANK YOU very very much for your help, Awesome Work!
online game would be very boring without your scripts!

could you please find a solution for this problem:

" when you register for SNGs the final pop-up window which just states "Registered" with an OK box isnt closed automatically by either Starshotkeys or Starsassistant ahk anymore (they have changed the style of the window)"



Thanks again
AHK script:Stars Filtered SNG Opener Quote
08-29-2011 , 06:07 AM
I've used this way back, but I cannot download it now, the overcards site is down. Can anyone upload the latest version somewhere?
AHK script:Stars Filtered SNG Opener Quote
08-29-2011 , 08:54 AM
This version works and handles the final pop up but only if you use the "classic" lobby view, can't be that difficult to change it to work on the "black" lobby I guess

Quote:
; Author: Everlong@2p2 Code assembled from misc sources, thanks to _dave_, chris228, finnisher
; v.4.0a
; added: option to atuobuyin if full, hide/show window
; fixed issue with skipping first sng in lobby
; 4.0 version fixed by Max1mums
#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%
#SingleInstance, Force
SetTitleMatchMode, 2
SetTimer, register, off
SetTimer, safeguard, off
StringTrimRight, thisahk, A_ScriptName, 4

;;;;;;;;;;;SET YOUR PokerStars folder path here;;;;;;;;;;;;;;;
;pspath:="C:\Program Files\PokerStars\"
IniRead, pspath, %thisahk%.ini, Settings, path
logfile:= pspath . "pokerstars.log.0"
IfNotExist %logfile%
{
If A_OSVersion in WIN_VISTA
{
IniWrite, %A_AppData%\Pokerstars\, %thisahk%.ini, Settings, path
IniRead, pspath, %thisahk%.ini, Settings, path
logfile:= pspath . "pokerstars.log.0"
IfNotExist %logfile%
{
StringGetPos,pos, pspath,Roaming
StringLeft, pspath, pspath, %pos%
pspath:=pspath . "Local\Pokerstars\"
IniWrite, %pspath%, %thisahk%.ini, Settings, path
}
}
Else
IniWrite, %ProgramFiles%\Pokerstars\, %thisahk%.ini, Settings, path
IniRead, pspath, %thisahk%.ini, Settings, path
}
;================================================= =============
tcount=0
tcounter:="tcounter.ini"
IfExist, %tcounter%
FileDelete, %tcounter%
RegSofar=0
OpenTables=0
trows=17
SysGet,mon, MonitorworkArea
fivesec=0
two=0
ddlist4=Off|
ddlist5=Off|
ddlist6=Off|
ddlist7=Off|
LobbyList=Default|Black|
ddlist2:=ddlist2 . 1 . "|"
Loop 100
{
two:=two+2
ddlist3:=ddlist3 . two . "|"
ddlist:=ddlist . A_index . "|"
If (A_index<51)
{
fivesec:=fivesec+5
ddlist2:=ddlist2 . fivesec . "|"
ddlist5:=ddlist5 . fivesec . "|"
ddlist6:=ddlist6 . fivesec . "|"
If (A_index<22)
{
ddlist7:=ddlist7 . A_Index . "|"
If (A_index<16)
{
ddlist4:=ddlist4 . A_index . "|"
}
}
}
}
ddlist3:=ddlist3 . 9999 . "|"
Gosub, BuildGui
Return

BuildGui:
Gui, color, white
Gui, font, cOlive
Gui, add, tab, h340 w240, General|Advanced Settings
Gui, add, text, , Auto-register
Gui, add, Checkbox, yp xp+80 Check3 Checked-1 vRegister
Gui, add, text, yp xp+30, Reg. next if full?
Gui, add, Checkbox, yp xp+80 AutoIfFull VAutoifFull


Gui, add, text,xp-190 yp+30 , Register every (sec):
Gui, add, DropDownList, w50 yp-5 xp+140 vInterval1, %ddlist2%
Gui, add, text, xp-140 yp+30, No of SNG:s to keep open:
Gui, add, DropDownList, w50 yp-5 xp+140 vKeepOpen , %ddlist%
Gui, add, text,xp-140 yp+30, Limit total SNG:s to:
Gui, add, DropDownList, w50 yp-5 xp+140 vTotalLimit , %ddlist3%
Gui, add, text,xp-140 yp+30, Limit total time to (min):
Gui, add, DropDownList, w50 yp-5 xp+140 vTimeLimit , %ddlist5%

Gui, add, text, xp-140 yp+30 cred vcdown w200
Gui, add, text, xp yp+30 w200 vRegSofar, SNG:s registered so far:
Gui, add, text, w200 vOpenTables, Tables open/waiting:
Gui, add, text, w200 cRed vStatus, Status: Idle
Gui, add, Button, w68 ggetgui, &Submit+Run
Gui, add, text, xp+72 yp+5, (Autosaves your settings)
Gui, Add, Button, Disabled xp-72 yp+20 w48 h20 Center, &Resume
Gui, Add, Button, Disabled w45 h20 yp xp+48 Center, &Pause
Gui, Add, Button, w80 h20 yp xp+45 Center globbyrestore, &Lobby restore
Gui, Add, Button, w45 h20 yp xp+80 gDonate, &Donate
Gui, tab, 2

Gui, add, Text, x25 y65 , Lobby Theme:
Gui, add, DropDownList, w65 yp-5 xp+140 vLobby, %LobbyList%
Gui, add, text,xp-140 yp+30 , Close lobbies every (sec):
Gui, add, DropDownList, w50 yp-5 xp+140 vCloseInterv, %ddlist6%
Gui, add, text, xp-140 yp+18 , (manually Close with ctrl+e)
Gui, add, text, yp+30, Disable if no user Input (min):
Gui, add, DropDownList, w50 yp-5 xp+140 vGuardtimer Choose1 , %ddlist4%
Gui, add, text, xp-140 yp+30 ,Batch-register?
Gui, add, Checkbox,yp xp+140 vBatchReg
Gui, add, text, yp+20 xp-140 ,SetReg* mode?
Gui, add, Checkbox,yp xp+140 vSetReg
Gui, add, text, yp+20 xp-140 ,Minimize lobby?
Gui, add, Checkbox,yp xp+140 vMinlob
Gui, add, Text, xp-140 yp+30, Times to scroll down:
Gui, add, DropDownList, w50 yp-5 xp+140 vscrldwn, %ddlist7%
Gui, add, Text, xp-140 yp+25, Always start at top of lobby?
Gui, add, Checkbox, yp xp+140 vTopReturn
/*
Gui, tab, 3
Gui, add, text, , Manually populate list: F11
Gui, Add, ListView, r%trows% grid gFindLobby w200 c1, Registered in Tournaments
*/
Gui, show, w256, %thisahk%
WinGetPos, x, y, w, h, SFSO
;x:=monRight-w
;y:=monBottom-h
x:=monLeft
y:=monTop
Gosub, GetIni
Gui, show, x%x% y%y%, %thisahk%
Return

getgui:
GuiControl,, Register, -1
Register = 1
IfExist, %tcounter%
FileDelete, %tcounter%
tcount:=0
Gui, Submit, NoHide
displayedTime=
If (lobby="Default")
{
regButton:="PokerStarsButtonClass24"
}
Else If (lobby="Black" or lobby="Custom*")
{
regButton:="PokerStarsButtonClass25"
}
Gosub, TimeLimit
Gosub, MakeIni
GuiControl, Enable, Pause
GuiControl, Disable, Resume
interval:=interval1*1000

If !interval
interval=off

If guardtimer is not Number
{
SetTimer, safeguard, off
}
Else
{
killtime:=guardtimer*60000
SetTimer, safeguard, 1000
}
if CloseInterv is not number
SetTimer, NukeLobbies, off
else
{
lobclose:=CloseInterv*1000
SetTimer, NukeLobbies, %lobclose%
}
register=1
SetTimer, Register, %interval%
Gosub, ButtonResume
Return

Safeguard:
If (A_TimeIdle > killtime)
{
Gosub, ButtonPause
GuiControl, , cdown, Stopped due to inactivity!!! %displayedTime%
}
Return

TimeLimit:
If TimeLimit is Number
{
allowedMinutes := timeLimit
endTime := A_Now
endTime += %allowedMinutes%, Minutes
SetTimer, CountDown, 1000
}
Else
{
GuiControl, , cdown, Time Limit off
}
Return

Countdown:
remainingTime := endTime
EnvSub remainingTime, %A_Now%, Seconds
m := remainingTime // 60
s := Mod(remainingTime, 60)
displayedTime := Format3Digits(m) ":" Format2Digits(s)
GuiControl, , cdown, Running another (mm:ss): %displayedTime%
If (A_now > endTime)
{
SetTimer, Countdown, off
Gosub, ButtonPause
GuiControl, , cdown, Time Limit reached.
}
Return

GuiClose:
Gui, Submit
Gosub, MakeIni
ExitApp
Return

ButtonResume:
Gui, Submit, NoHide
If PausedTime is Number
{
TimeLimit:=PausedTime
}
Gosub, TimeLimit

GuiControl, Disable, Resume
GuiControl, Enable, Pause
GuiControl, , Register, -1
Register=1
IfExist, %tcounter%
FileDelete, %tcounter%
tcount:=0
Gosub, Register
SetTimer, Register, %Interval%
Return

ButtonPause:
Critical
Gui, Submit, NoHide
PausedTime:=remainingTime/60
Register:=0
SetTimer, Countdown, off
SetTimer, Register, off
GuiControl, Disable, Pause
GuiControl, Enable, Resume
GuiControl, , Register, 0
GuiControl, , cdown, Manually Paused %displayedTime%
GuiControl, , Status, Status: Waiting ;TEST
Return

Register:
SetTitleMatchMode, 2
WinGet, LobbyID, id, PokerStars Lobby

If !LobbyID
{
Gosub, ButtonPause
GuiControl,, Status, Status: PokerStars Lobby not found
Gui, show, NoActivate, %thisahk%
Return
}
If (TopReturn=1)
{
ControlSend, PokerStarsListClass6, {NumpadUp 20}, ahk_id%lobbyid%
}
WinGet, PhysicalTables, list,Table ahk_class PokerStarsTableFrameClass
If PhysicalTables is not Number
PhysicalTables:=0
If (PhysicalTables >= KeepOpen)
{
GuiControl,, Status, Set Full waiting
Gui, show, NoActivate, %thisahk%
Return
}
OpenTables:=CountTourneys()
If OpenTables is not Number
OpenTables=0
GuiControl, , OpenTables, Tables open/waiting: %OpenTables%
GuiControl, , RegSofar, SNG:s registered so far: %RegSofar%
Gui, show, NoActivate, %thisahk%

If (RegSofar >= TotalLimit)
{
Gosub, ButtonPause
GuiControl, , cdown, SNG Total Limit reached
GuiControl, , Status, Status: Idle ;TEST
Return
}
If (OpenTables >= TotalLimit)
{
Gosub, ButtonPause
GuiControl, , cdown, SNG Total Limit reached
GuiControl, , Status, Status: Idle ;TEST
Return
}
If (OpenTables>=KeepOpen)
{
GuiControl, , OpenTables, Tables open/waiting: %OpenTables% (Set full)
GuiControl, , Status, Status: Waiting ;TEST
Return
}
Else
{
If (BatchReg=1)
{
Times:= KeepOpen - OpenTables
RegSNGexec(LobbyID, Times, scrldwn)
}
Else
{
RegSNGexec(LobbyID, 1, scrldwn)
}
}
Return
MakeIni:
IniWrite, %AutoIfFull%, %thisahk%.ini, Settings, AutoIfFull
IniWrite, %TopReturn%, %thisahk%.ini, Settings, TopReturn
IniWrite, %scrldwn%, %thisahk%.ini, Settings, scrldwn
IniWrite, %Lobby%, %thisahk%.ini, Settings, Lobby
IniWrite, %BatchReg%, %thisahk%.ini, Settings, BatchReg
IniWrite, %Setreg%, %thisahk%.ini, Settings, SetReg
IniWrite, %Minlob%, %thisahk%.ini, Settings, MinLob
IniWrite, %Interval1%, %thisahk%.ini, Settings, Interval1
IniWrite, %AutoClose%, %thisahk%.ini, Settings, AutoClose
IniWrite, %CloseInterv%, %thisahk%.ini, Settings, CloseInterv
IniWrite, %KeepOpen%, %thisahk%.ini, Settings, KeepOpen
IniWrite, %TotalLimit%, %thisahk%.ini, Settings, TotalLimit
IniWrite, %GuardTimer%, %thisahk%.ini, Settings, GuardTimer
IniWrite, %TimeLimit%, %thisahk%.ini, Settings, TimeLimit
Return

GetIni:
IfExist, %thisahk%.ini
{
IniRead, AutoIfFull, %thisahk%.ini, Settings, AutoIfFull
IniRead, TopReturn, %thisahk%.ini, Settings, TopReturn,0
IniRead, scrldwn, %thisahk%.ini, Settings, scrldwn
IniRead, Lobby, %thisahk%.ini, Settings, Lobby
IniRead, BatchReg, %thisahk%.ini, Settings, BatchReg
IniRead, SetReg, %thisahk%.ini, Settings, SetReg, 1
IniRead, MinLob, %thisahk%.ini, Settings, MinLob, 0
IniRead, Interval1, %thisahk%.ini, Settings, Interval1
IniRead, CloseInterv, %thisahk%.ini, Settings, CloseInterv
IniRead, AutoClose, %thisahk%.ini, Settings, AutoClose
IniRead, KeepOpen, %thisahk%.ini, Settings, KeepOpen
IniRead, TotalLimit, %thisahk%.ini, Settings, TotalLimit
IniRead, GuardTimer, %thisahk%.ini, Settings, GuardTimer, Off
IniRead, TimeLimit, %thisahk%.ini, Settings, TimeLimit, Off
GuiControl, , AutoIfFull, %AutoIfFull%
StringReplace, ddlist7, ddlist7, %scrldwn%, %scrldwn%|
GuiControl, , scrldwn, |%ddlist7%
StringReplace, LobbyList, LobbyList, %Lobby%, %Lobby%|
GuiControl, , Lobby, |%LobbyList%
GuiControl, , BatchReg, %BatchReg%
GuiControl, , SetReg, %SetReg%
GuiControl, , MinLob, %MinLob%
GuiControl, , TopReturn, %TopReturn%
GuiControl, , AutoClose, %AutoClose%
StringReplace, ddlist2, ddlist2, %interval1%, %Interval1%|
GuiControl, , Interval1, |%ddlist2%
StringReplace, ddlist6, ddlist6, %CloseInterv%, %CloseInterv%|
GuiControl, , CloseInterv, |%ddlist6%
StringReplace, ddlist, ddlist, %KeepOpen%, %KeepOpen%|
GuiControl, , KeepOpen, |%ddlist%
StringReplace, ddlist3, ddlist3, %TotalLimit%, %TotalLimit%|,
GuiControl, , TotalLimit, |%ddlist3%
StringReplace, ddlist4, ddlist4, %GuardTimer%, %GuardTimer%|
GuiControl, , GuardTimer, |%ddlist4%
StringReplace, ddlist5, ddlist5, %TimeLimit%, %TimeLimit%|
GuiControl, , TimeLimit, |%ddlist5%
}
Return
^e::
NukeLobbies:
SetTitleMatchMode, 2
GroupAdd, TLobbies, Lobby,,, PokerStars Lobby
GroupClose, TLobbies, A
Return

#H::
WinHide, %thisahk%
return

#S::
WinShow, %thisahk%
return

F11::
TmpSetReg:=SetReg
SetReg=0
CountTourneys()
SetReg:=TmpSetReg
Return
ManualCount:
CountTourneys()
Return

FindLobby:
If (%A_GuiEvent% = DoubleClick)
{
LV_GetText(TournId,A_EventInfo)
TournID:=SubStr(TournID, 1,10)
WinMenuSelectItem, PokerStars Lobby,, Requests, Find a Tournament
WinWait, Find Tournament ahk_class #32770, , 10
WinGet, fat, id
ControlFocus, Edit1, ahk_id%fat%
Sleep, -1
ControlSend, Edit1, %TournId%, ahk_id%fat%
ControlFocus, Button1, ahk_id%fat%
Sleep, -1
ControlSend, Button1, {Space}, ahk_id%fat%
}
Return

Donate:
donation()
Return

Format2Digits(_val) {
_val += 100
StringRight _val, _val, 2
Return _val
}

Format3Digits(_val) {
_val += 1000
StringRight _val, _val, 3
StringTrimRight, FirstZ, _val, 2
If FirstZ=0
{
StringTrimLeft, _val, _val, 1
}
StringTrimRight, FirstZ, _val, 1
If FirstZ=0
{
StringTrimLeft, _val, _val, 1
}
Return _val
}
LobbyRestore:
WinGet, lobbyid, id, PokerStars Lobby
WinShow, ahk_id%lobbyid%
WinMove, ahk_id%lobbyid%,,0,0
return


RegSNGexec(id, times, scrldwn) {
global RegSofar
global Register
global OpenTables
global KeepOpen
global TotalLimit
global RegButton
global AutoIfFull
Loop %times%
{
;Gosub, ManualCount
;Sleep, 25
;tcount:=0
;tcounter:="tcounter.ini"
;IfExist, %tcounter%
;FileDelete, %tcounter%

ControlSend, PokerStarsListClass6, {NumpadUp 20}, ahk_id%id%

If (OpenTables >= KeepOpen)
Exit
If (OpenTable >= TotalLimit)
Exit
ClickdirectionCount=0
direction=0
GuiControl, , Status, Status: Registering ;TEST
Loop 16
{
If (Register=0)
{
GuiControl, , Status, Status: Idle ;TEST
Exit
}
ControlGet, v, Visible, , %regButton%, ahk_id%id%
If (v = 0)
If (scrldwn!="Off")
{
If (ClickdirectionCount<scrldwn) {
If (direction=0) {
ControlSend, PokerStarsListClass6, {NumpadDown}, ahk_id%id%
} Else {
ControlSend, PokerStarsListClass6, {NumpadUp}, ahk_id%id%
}
ClickdirectionCount:=ClickdirectionCount+1
} Else {
If (direction=0) {
direction:=1
} Else {
direction:=0
}
ClickdirectionCount:=0
}
Sleep 1000
}
If (v = 1)
Break
}

If ( v = 1 ) {
SetTitleMatchMode, 2
ControlFocus, %regButton%, ahk_id%ID%
PostMessage, 0x201, 0x0001,((20<<16)^30),%regButton% , ahk_id%id%
PostMessage, 0x202 , 0,((20<<16)^30),%regButton% , ahk_id%id%
WinWait, Tournament Registration ahk_class #32770, , 3
{
WinGet, regid, id, Tournament Registration
ControlGet, Z, Visible,,Button1, ahk_id%regid%
if Z
{
ControlFocus, Button1, ahk_id%regID%
PostMessage, 0x201, 0x0001,((10<<16)^10),Button1 , ahk_id%id%
PostMessage, 0x202 , 0,((10<<16)^10),Button1 , ahk_id%id%
}

If (AutoIfFull = 1)
{
ControlFocus, Button2, ahk_id%regid%
Sleep, -1
ControlSend, Button2, {Space}, ahk_id%regid%
Sleep, 30
}

Control, Check,,Button3, ahk_id%regid%
ControlFocus, Button3, ahk_id%regid%
PostMessage, 0x201, 0x0001,((10<<16)^10),Button3 , ahk_id%id%
PostMessage, 0x202 , 0,((10<<16)^10),Button3 , ahk_id%id%
;RegSofar++
}

WinWait, Tournament Registration ahk_class #32770, , 3
{
WinGet, regid, id, Tournament Registration
WinGetPos, x, y, w, h, ahk_id%regid%
ControlGetText, ctext, Button1, ahk_id%regid%
If ( cText = "OK" )
{
Control, Check,,Button1, ahk_id%regid%
ControlFocus, Button1, ahk_id%regid%
PostMessage, 0x201, 0x0001,((10<<16)^10),Button1 , ahk_id%id%
PostMessage, 0x202 , 0,((10<<16)^10),Button1 , ahk_id%id%
}
}
if h>145
RegSofar++
GuiControl, , RegSofar, SNG:s registered so far: %RegSofar%
GuiControl, , Status, Status: Waiting ;TEST
Gui, show, NoActivate, %thisahk%
}
}
}

CountTourneys() {
global logfile
If (SetReg=1)
{
Return 0
}
tcount:=0
Loop, Read, %logfile%
{
If (instr(A_LoopReadLine,"RT add")>0) || ((instr(A_LoopReadLine,"TableClientConnection")>0) && (instr(A_LoopReadLine,":connect")>0))
{
if !instr(A_LoopReadLine,"TableClientConnection")
{
tnumber:=RegExReplace(A_LoopReadLine, "RT add ", "")
if instr(tnumber,A_space)
StringLeft, tnumber, tnumber, instr(tnumber,A_space)-1
}
else
{
tnumber:=RegExReplace(A_LoopReadLine, "TableClientConnection{table.", "")
stringleft,tnumber,tnumber,instr(tnumber,A_space)-1
}
if !instr(tables,tnumber)
listadd(tables,tnumber)
}
else
If (instr(A_LoopReadLine,"RT remove")>0) || ((instr(A_LoopReadLine,"TableClientConnection")>0) && (instr(A_LoopReadLine,":disconnect")>0))
{
if !instr(A_LoopReadLine,"TableClientConnection")
stringtrimleft,tnumber,A_LoopReadLine,instr(A_Loop ReadLine,A_space,"",0)
else
{
tnumber:=RegExReplace(A_LoopReadLine, "TableClientConnection{table.", "")
stringleft,tnumber,tnumber,instr(tnumber,A_space)-1
}
if instr(tables,tnumber)
listDelItem(tables,tnumber)
}
tnumber=
}

Loop, Parse, tables, -,
{
if A_Loopfield
tcount++
}
return tcount
}

listAdd( byRef list, item, del="-" ) {
list:=( list!="" ? ( list . del . item ) : item )
return list
}

listDelItem( byRef list, item, del="-") {
ifEqual, item,, return list
list:=del . list . del
StringReplace, list, list, %item%%del%
StringTrimLeft, list, list, 1
StringTrimRight, list, list, 1
return list
}

donation() {
WinMenuSelectItem, PokerStars Lobby,, Requests, Transfer Funds...
WinWait, Transfer Funds ahk_class #32770, , 10
WinGet, tf, id
ControlFocus, Edit2, ahk_id%tf%
ControlSetText, Edit2, Attilio
ControlFocus, Edit1, ahk_id%tf%
Sleep, -1
ControlSetText, Edit1,
GuiControl, Disable, Donate
}

lobbyStars() {
SetTitleMatchMode 1
WinGet, id, id, PokerStars Lobby
Return id
}
~^!Q::
ExitApp
I dunno how to post this so it doesn't have a huge quote box, sorry

Last edited by fix9; 08-29-2011 at 08:56 AM. Reason: Would have posted earlier but only found out today when messing with lobby views
AHK script:Stars Filtered SNG Opener Quote
08-31-2011 , 05:38 PM
Here is the latest version:
Code:
; Author:         Everlong@2p2 Code assembled from misc sources, thanks to _dave_, chris228, finnisher
; v.4.01
; added: option to atuobuyin if full, hide/show window
; fixed issue with skipping first sng in lobby
; 4.0 version fixed by Max1mums 
#NoEnv
#SingleInstance, Force
SendMode Input
SetWorkingDir %A_ScriptDir%
SetTitleMatchMode, 2
SetTimer, register, off
SetTimer, safeguard, off
StringTrimRight, thisahk, A_ScriptName, 4

;;;;;;;;;;;SET YOUR PokerStars folder path here;;;;;;;;;;;;;;;
IniRead, pspath, %thisahk%.ini, Settings, path
logfile:= pspath . "pokerstars.log.0"
IfNotExist %logfile%
{
 If A_OSVersion in WIN_VISTA
{		
IniWrite, %A_AppData%\Pokerstars\, %thisahk%.ini, Settings, path
IniRead, pspath, %thisahk%.ini, Settings, path 
logfile:= pspath . "pokerstars.log.0"
IfNotExist %logfile%
{
 StringGetPos,pos, pspath,Roaming
 StringLeft, pspath, pspath, %pos%
 pspath:=pspath . "Local\Pokerstars\"
 IniWrite, %pspath%, %thisahk%.ini, Settings, path
}
}
 Else							
 IniWrite, %ProgramFiles%\Pokerstars\, %thisahk%.ini, Settings, path
 IniRead, pspath, %thisahk%.ini, Settings, path
}
;==============================================================
tcount=0
RegSofar=0
OpenTables=0
trows=17
SysGet,mon, MonitorworkArea
fivesec=0
two=0
ddlist4=Off|
ddlist5=Off|
ddlist6=Off|
ddlist7=Off|
LobbyList=Default|Black|
ddlist2:=ddlist2 . 1 . "|"
ddlist2:=ddlist2 . 2 . "|"
Loop 100
{
two:=two+2
ddlist3:=ddlist3 . two . "|"
ddlist:=ddlist . A_index . "|"
If (A_index<51)
{
fivesec:=fivesec+5
ddlist2:=ddlist2 . fivesec . "|"
ddlist5:=ddlist5 . fivesec . "|"
ddlist6:=ddlist6 . fivesec . "|"
If (A_index<22)
{
ddlist7:=ddlist7 . A_Index . "|"
If (A_index<16)
{
ddlist4:=ddlist4 . A_index . "|"
}
}
}
}
ddlist3:=ddlist3 . 9999 . "|"
Gosub, BuildGui
Return
;==============================================================
;==============================================================

BuildGui:
Gui, color, white
Gui, font, cOlive
Gui, add, tab, h340 w240, General|Advanced Settings
Gui, add, text, , Auto-register
Gui, add, Checkbox, yp xp+80 Check3 Checked-1 vRegister
Gui, add, text, yp xp+30, Reg. next if full?
Gui, add, Checkbox, yp xp+80 AutoIfFull VAutoifFull


Gui, add, text,xp-190 yp+30 , Register every (sec):
Gui, add, DropDownList, w50 yp-5 xp+140  vInterval1, %ddlist2%
Gui, add, text, xp-140 yp+30, No of SNG:s to keep open:
Gui, add, DropDownList, w50 yp-5 xp+140 vKeepOpen , %ddlist%
Gui, add, text,xp-140 yp+30, Limit total SNG:s to:
Gui, add, DropDownList, w50 yp-5 xp+140 vTotalLimit , %ddlist3%
Gui, add, text,xp-140 yp+30, Limit total time to (min):
Gui, add, DropDownList, w50 yp-5 xp+140 vTimeLimit , %ddlist5%

Gui, add, text, xp-140 yp+30 cred vcdown w200
Gui, add, text, xp  yp+30 w200 vRegSofar, SNG:s registered so far:
Gui, add, text,  w200 vOpenTables, Tables open/waiting:
Gui, add, text, w200 cRed vStatus, Status: Idle
Gui, add, Button, w68 ggetgui, &Submit+Run
Gui, add, text, xp+72 yp+5, (Autosaves your settings)
Gui, Add, Button, Disabled xp-72 yp+20 w48 h20 Center, &Resume
Gui, Add, Button, Disabled  w45 h20 yp xp+48 Center, &Pause
Gui, Add, Button, w80 h20 yp xp+45 Center globbyrestore, &Lobby restore
Gui, Add, Button, w45 h20 yp xp+80 gDonate, &Donate
Gui, tab, 2

Gui, add, Text, x25 y65 , Lobby Theme:
Gui, add, DropDownList, w65 yp-5 xp+140 vLobby, %LobbyList%
Gui, add, text,xp-140 yp+30 , Close lobbies every (sec):
Gui, add, DropDownList, w50 yp-5 xp+140  vCloseInterv, %ddlist6%
Gui, add, text, xp-140 yp+18 , (manually Close with ctrl+e)
Gui, add, text, yp+30, Disable if no user Input (min):
Gui, add, DropDownList, w50 yp-5 xp+140 vGuardtimer Choose1 , %ddlist4%
Gui, add, text, xp-140 yp+30 ,Batch-register?
Gui, add, Checkbox,yp xp+140 vBatchReg
Gui, add, text, yp+20 xp-140 ,SetReg* mode?
Gui, add, Checkbox,yp xp+140 vSetReg
Gui, add, text, yp+20 xp-140 ,Minimize lobby?
Gui, add, Checkbox,yp xp+140 vMinlob
Gui, add, Text, xp-140 yp+30, Times to scroll down:
Gui, add, DropDownList, w50 yp-5 xp+140 vscrldwn, %ddlist7%
Gui, add, Text, xp-140 yp+25, Always start at top of lobby?
Gui, add, Checkbox, yp xp+140 vTopReturn
Gui, show, w256, %thisahk%
WinGetPos, x, y, w, h, SFSO
;x:=monRight-w
;y:=monBottom-h
x:=monLeft
y:=monTop
Gosub, GetIni
Gui, show, x%x% y%y%, %thisahk%
Return

getgui:
GuiControl,, Register, -1
Register = 1
tcount:=0
Gui, Submit, NoHide
displayedTime=
If (lobby="Default")
{
regButton:="PokerStarsButtonClass24"
}
Else If (lobby="Black" or lobby="Custom*")
{
regButton:="PokerStarsButtonClass25"
}
Gosub, TimeLimit
Gosub, MakeIni
GuiControl, Enable, Pause
GuiControl, Disable, Resume
interval:=interval1*1000

If !interval
interval=off

If guardtimer is not Number
{
SetTimer, safeguard, off
}
Else
{
killtime:=guardtimer*60000
SetTimer, safeguard, 1000
}
if CloseInterv is not number
SetTimer, NukeLobbies, off
else
{
lobclose:=CloseInterv*1000
SetTimer, NukeLobbies, %lobclose%
}
register=1
SetTimer, Register, %interval%
sleep,-1
Gosub, ButtonResume
Return

Safeguard:
If (A_TimeIdle > killtime)
{
Gosub, ButtonPause
GuiControl, , cdown, Stopped  due to inactivity!!! %displayedTime%
}
Return

TimeLimit:
If TimeLimit is Number
{
allowedMinutes := timeLimit
endTime := A_Now
endTime += %allowedMinutes%, Minutes
SetTimer, CountDown, 1000
}
Else
{
GuiControl, , cdown, Time Limit off
}
Return

Countdown:
remainingTime := endTime
EnvSub remainingTime, %A_Now%, Seconds
m := remainingTime // 60
s := Mod(remainingTime, 60)
displayedTime := Format3Digits(m) ":" Format2Digits(s)
GuiControl, , cdown, Running another (mm:ss): %displayedTime%
If (A_now > endTime)
{
SetTimer, Countdown, off
Gosub, ButtonPause
GuiControl, , cdown, Time Limit reached.
}
Return

GuiClose:
Gui, Submit
Gosub, MakeIni
ExitApp
Return

ButtonResume:
Gui, Submit, NoHide
If PausedTime is Number
{
TimeLimit:=PausedTime
}
Gosub, TimeLimit

GuiControl, Disable, Resume
GuiControl, Enable, Pause
GuiControl, , Register, -1
Register=1
tcount:=0
SetTimer, Register, %Interval%
sleep,-1
Return

ButtonPause:
Critical
Gui, Submit, NoHide
PausedTime:=remainingTime/60
Register:=0
SetTimer, Countdown, off
SetTimer, Register, off
GuiControl, Disable, Pause
GuiControl, Enable, Resume
GuiControl, , Register, 0
GuiControl, , cdown, Manually Paused %displayedTime%
GuiControl, , Status, Status: Waiting ;TEST
Return

Register:
SetTitleMatchMode, 2
WinGet, LobbyID, id, PokerStars Lobby - ahk_class #32770

If !LobbyID
{
Gosub, ButtonPause
GuiControl,, Status, Status: PokerStars Lobby not found
Gui, show, NoActivate, %thisahk%
Return
}
If (TopReturn=1)
{
ControlSend, PokerStarsListClass6, {NumpadUp 20}, ahk_id%lobbyid%
}
WinGet, PhysicalTables, list,Table ahk_class PokerStarsTableFrameClass
If PhysicalTables is not Number
PhysicalTables:=0
If (PhysicalTables >= KeepOpen)
{
GuiControl,, Status, Set Full waiting
;Gui, show, NoActivate, %thisahk%
Return
}
OpenTables:=CountTourneys()
If OpenTables is not Number
OpenTables=0
GuiControl, , OpenTables, Tables open/waiting: %OpenTables%
GuiControl, , RegSofar, SNG:s registered so far: %RegSofar%
;Gui, show, NoActivate, %thisahk%

If (RegSofar >= TotalLimit)
{
Gosub, ButtonPause
GuiControl, , cdown, SNG Total Limit reached
GuiControl, , Status, Status: Idle ;TEST
Return
}
If (OpenTables >= TotalLimit)
{
Gosub, ButtonPause
GuiControl, , cdown, SNG Total Limit reached
GuiControl, , Status, Status: Idle ;TEST
Return
}
If (OpenTables>=KeepOpen)
{
GuiControl, , OpenTables, Tables open/waiting: %OpenTables% (Set full)
GuiControl, , Status, Status: Waiting ;TEST
Return
}
Else
{
If (BatchReg=1)
{
Times:= KeepOpen - OpenTables
RegSNGexec(LobbyID, Times, scrldwn)
}
Else
{
RegSNGexec(LobbyID, 1, scrldwn)
}
}
Return
MakeIni:
IniWrite, %AutoIfFull%, %thisahk%.ini, Settings, AutoIfFull
IniWrite, %TopReturn%, %thisahk%.ini, Settings, TopReturn
IniWrite, %scrldwn%, %thisahk%.ini, Settings, scrldwn
IniWrite, %Lobby%, %thisahk%.ini, Settings, Lobby
IniWrite, %BatchReg%, %thisahk%.ini, Settings, BatchReg
IniWrite, %Setreg%, %thisahk%.ini, Settings, SetReg
IniWrite, %Minlob%, %thisahk%.ini, Settings, MinLob
IniWrite, %Interval1%, %thisahk%.ini, Settings, Interval1
IniWrite, %AutoClose%, %thisahk%.ini, Settings, AutoClose
IniWrite, %CloseInterv%, %thisahk%.ini, Settings, CloseInterv
IniWrite, %KeepOpen%, %thisahk%.ini, Settings, KeepOpen
IniWrite, %TotalLimit%, %thisahk%.ini, Settings, TotalLimit
IniWrite, %GuardTimer%, %thisahk%.ini, Settings, GuardTimer
IniWrite, %TimeLimit%, %thisahk%.ini, Settings, TimeLimit
Return

GetIni:
IfExist, %thisahk%.ini
{
IniRead, AutoIfFull, %thisahk%.ini, Settings, AutoIfFull
IniRead, TopReturn, %thisahk%.ini, Settings, TopReturn,0
IniRead, scrldwn, %thisahk%.ini, Settings, scrldwn
IniRead, Lobby, %thisahk%.ini, Settings, Lobby
IniRead, BatchReg, %thisahk%.ini, Settings, BatchReg
IniRead, SetReg, %thisahk%.ini, Settings, SetReg, 1
IniRead, MinLob, %thisahk%.ini, Settings, MinLob, 0
IniRead, Interval1, %thisahk%.ini, Settings, Interval1
IniRead, CloseInterv, %thisahk%.ini, Settings, CloseInterv
IniRead, AutoClose, %thisahk%.ini, Settings, AutoClose
IniRead, KeepOpen, %thisahk%.ini, Settings, KeepOpen
IniRead, TotalLimit, %thisahk%.ini, Settings, TotalLimit
IniRead, GuardTimer, %thisahk%.ini, Settings, GuardTimer, Off
IniRead, TimeLimit, %thisahk%.ini, Settings, TimeLimit, Off
GuiControl, , AutoIfFull, %AutoIfFull%
StringReplace, ddlist7, ddlist7, %scrldwn%, %scrldwn%|
GuiControl, , scrldwn, |%ddlist7%
StringReplace, LobbyList, LobbyList, %Lobby%, %Lobby%|
GuiControl, , Lobby, |%LobbyList%
GuiControl, , BatchReg, %BatchReg%
GuiControl, , SetReg, %SetReg%
GuiControl, , MinLob, %MinLob%
GuiControl, , TopReturn, %TopReturn%
GuiControl, , AutoClose, %AutoClose%
StringReplace, ddlist2, ddlist2, %interval1%, %Interval1%|
GuiControl, , Interval1, |%ddlist2%
StringReplace, ddlist6, ddlist6, %CloseInterv%, %CloseInterv%|
GuiControl, , CloseInterv, |%ddlist6%
StringReplace, ddlist, ddlist, %KeepOpen%, %KeepOpen%|
GuiControl, , KeepOpen, |%ddlist%
StringReplace, ddlist3, ddlist3, %TotalLimit%, %TotalLimit%|,
GuiControl, , TotalLimit, |%ddlist3%
StringReplace, ddlist4, ddlist4, %GuardTimer%, %GuardTimer%|
GuiControl, , GuardTimer, |%ddlist4%
StringReplace, ddlist5, ddlist5, %TimeLimit%, %TimeLimit%|
GuiControl, , TimeLimit, |%ddlist5%
}
Return
^e::
NukeLobbies:
SetTitleMatchMode, 2
GroupAdd, TLobbies, Lobby,,, PokerStars Lobby
GroupClose, TLobbies, A
Return

#H::
WinHide, %thisahk%
return

#S::
WinShow, %thisahk%
return

F11::
TmpSetReg:=SetReg
SetReg=0
CountTourneys()
SetReg:=TmpSetReg
Return
ManualCount:
CountTourneys()
Return

FindLobby:
If (%A_GuiEvent% = DoubleClick)
{
LV_GetText(TournId,A_EventInfo)
TournID:=SubStr(TournID, 1,10)
WinMenuSelectItem, PokerStars Lobby,, Requests, Find a Tournament
WinWait, Find Tournament ahk_class #32770, , 10
WinGet, fat, id
ControlFocus, Edit1, ahk_id%fat%
Sleep, -1
ControlSend, Edit1, %TournId%, ahk_id%fat%
ControlFocus, Button1, ahk_id%fat%
Sleep, -1
ControlSend, Button1, {Space}, ahk_id%fat%
}
Return

Donate:
donation()
Return

Format2Digits(_val) {
_val += 100
StringRight _val, _val, 2
Return _val
}

Format3Digits(_val) {
_val += 1000
StringRight _val, _val, 3
StringTrimRight, FirstZ, _val, 2
If FirstZ=0
{
StringTrimLeft, _val, _val, 1
}
StringTrimRight, FirstZ, _val, 1
If FirstZ=0
{
StringTrimLeft, _val, _val, 1
}
Return _val
}
LobbyRestore:
WinGet, lobbyid, id, PokerStars Lobby
WinShow, ahk_id%lobbyid%
WinMove, ahk_id%lobbyid%,,0,0
return


RegSNGexec(id, times, scrldwn) {
global RegSofar
global Register
global OpenTables
global KeepOpen
global TotalLimit
global RegButton
global AutoIfFull
wingetclass,class,A
Loop %times%
{
optables:=opentables
ControlSend, PokerStarsListClass6, {NumpadUp 20}, ahk_id%id%

If (OpenTables >= KeepOpen)
Exit
If (OpenTable >= TotalLimit)
Exit
ClickdirectionCount=0
direction=0
GuiControl, , Status, Status: Registering ;TEST
Loop 16
{
If (Register=0)
{
GuiControl, , Status, Status: Idle ;TEST
Exit
}
ControlGet, v, Visible, , %regButton%, ahk_id%id%
If (v = 0)
If (scrldwn!="Off")
{
If (ClickdirectionCount<scrldwn) {
If (direction=0) {
ControlSend, PokerStarsListClass6, {NumpadDown}, ahk_id%id%
} Else {
ControlSend, PokerStarsListClass6, {NumpadUp}, ahk_id%id%
}
ClickdirectionCount:=ClickdirectionCount+1
} Else {
If (direction=0) {
direction:=1
} Else {
direction:=0
}
ClickdirectionCount:=0
}
Sleep 1000
}
If (v = 1)
Break
}

If ( v = 1 ) {
winactivate,ahk_id%id%
SetTitleMatchMode, 2
ControlFocus, %regButton%, ahk_id%ID%
PostMessage, 0x201, 0x0001,((20<<16)^30),%regButton% , ahk_id%id%
PostMessage, 0x202 , 0,((20<<16)^30),%regButton% , ahk_id%id%
winset,bottom,,PokerStars Lobby - ahk_class #32770
WinWait, Tournament Registration ahk_class #32770, , 1
{
WinGet, regid, id,
If (AutoIfFull = 1)
{
ControlFocus, Button2, ahk_id%regid%
Sleep, -1
ControlSend, Button2, {Space}, ahk_id%regid%
Sleep, 30
}
Control, Check,,Button3, ahk_id%regid%
ControlFocus, Button3, ahk_id%regid%
PostMessage, 0x201, 0x0001,((10<<16)^10),Button3 , ahk_id%regid%
PostMessage, 0x202 , 0,((10<<16)^10),Button3 , ahk_id%regid%
if class=PokerStarsTableFrameClass
winactivate,ahk_class PokerStarsTableFrameClass
RegSofar++
}

WinWait, Tournament Registration ahk_class #32770, , 1
{
WinGet, regid1, id,
WinGetPos, x, y, w, h, ahk_id%regid%
controlget,handle,hwnd,,PokerStarsButtonClass1,ahk_id%regid1%
if handle
{
 Control, Check,,PokerStarsButtonClass1, ahk_id%regid1%
 ControlFocus, PokerStarsButtonClass1, ahk_id%regid1%
 PostMessage, 0x201, 0x0001,((10<<16)^10),PokerStarsButtonClass1 , ahk_id%regid1%
 PostMessage, 0x202 , 0,((10<<16)^10),PokerStarsButtonClass1, ahk_id%regid1%
}
}
GuiControl, , OpenTables, Tables open/waiting: %OpenTables%
GuiControl, , RegSofar, SNG:s registered so far: %RegSofar%
GuiControl, , Status, Status: Waiting ;TEST
winset,alwaysontop,off,PokerStars Lobby -
}
}
}
return

CountTourneys() {
global logfile
If (SetReg=1)
{
Return 0
}
tcount:=0
fileread,log, %logfile%
Loop, Parse, log, `n,
{
If (instr(A_loopField,"RT add")>0) || ((instr(A_loopField,"TableClientConnection")>0) && (instr(A_loopField,":connect")>0)) 
{
 if !instr(A_loopField,"TableClientConnection")
 {
 tnumber:=RegExReplace(A_loopField, "RT add ", "")
 if instr(tnumber,A_space)
 StringLeft, tnumber, tnumber, instr(tnumber,A_space)-1
 }
 else
 {
 tnumber:=RegExReplace(A_loopField, "TableClientConnection{table.", "")
 stringleft,tnumber,tnumber,instr(tnumber,A_space)-1
 }
 if !instr(tables,tnumber)
 listadd(tables,tnumber)
}
else
If (instr(A_loopField,"RT remove")>0) || (instr(A_loopField,"~TournFrame")>0)
{
 if instr(A_loopField,"~TournFrame")
 {
 tnumber:=RegExReplace(A_loopField, "~TournFrame '", "")
 stringleft,tnumber,tnumber,instr(tnumber,A_space)-2
 }
 else
 stringtrimleft,tnumber,A_loopField,instr(A_loopField,A_space,"",0)
 tnumber:=RegExReplace(tnumber, "[`n,`r]", "")
 if instr(tables,tnumber)
 listDelItem(tables,tnumber)
}
tnumber=
}

Loop, Parse, tables, -,
{
if A_Loopfield is number
tcount++
}
return tcount
}

listAdd( byRef list, item, del="-" ) {
  list:=( list!="" ? ( list . del . item ) : item )
  return list
}

listDelItem( byRef list, item, del="-") {
  ifEqual, item,, return list
  list:=del . list . del
  StringReplace, list, list, %item%%del%
  StringTrimLeft, list, list, 1
  StringTrimRight, list, list, 1
  return list
}

donation() {
WinMenuSelectItem, PokerStars Lobby,, Requests, Transfer Funds...
WinWait, Transfer Funds ahk_class #32770, , 10
WinGet, tf, id
ControlFocus, Edit2, ahk_id%tf%
ControlSetText, Edit2, Attilio
ControlFocus, Edit1, ahk_id%tf%
Sleep, -1
ControlSetText, Edit1,
GuiControl, Disable, Donate
}

lobbyStars() {
SetTitleMatchMode 2
WinGet, id, id, PokerStars Lobby - ahk_class #32770
Return id
}
~^!Q::
ExitApp
AHK script:Stars Filtered SNG Opener Quote
08-31-2011 , 07:30 PM
Hi Max1mums,

Thank you so much man, it works Perfect!
Fixed All Problems!...

Max? could you take a look in this (my) Post please?
I have a problem long time ago with the BetPot script, and I cant find out how to fix it:

http://forumserver.twoplustwo.com/16...l#post28332234

If I can donate somewhere please let me know, would be glad to do so immediatelly.

Once again thanks man!

regards...
AHK script:Stars Filtered SNG Opener Quote
08-31-2011 , 09:41 PM
aristoteles, betpot settings are in the "betpot_default_hotkeys.txt" file - the only one you should edit, you can try using my StarsCash script as well, BetPot function should work fine for sngs there. I'm Max1mums on stars if you want to make a donation.
AHK script:Stars Filtered SNG Opener Quote
09-01-2011 , 07:17 PM
Any fix for the latest update?

will donate!

Last edited by VulgarDisplayPoker; 09-01-2011 at 07:18 PM. Reason: will donate!
AHK script:Stars Filtered SNG Opener Quote

      
m