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

11-06-2008 , 10:44 AM
Quote:
Originally Posted by Everlong
RightClick save to file. You have installed the AHK main application right? www. autohotkey.com
If your talking about autohotkey, yes I have installed that.
AHK script:Stars Filtered SNG Opener Quote
11-06-2008 , 10:48 AM
Ok, this is strange. This time I clicked on the link and it brought up the save/open box. Before it took me to another IE page that showed the actual script. Thats why I asked the question above.
AHK script:Stars Filtered SNG Opener Quote
11-06-2008 , 06:11 PM
I cant get SFSO to work I have tried all versions,ran as admin and all that happens is SFSO says it registered me in tourneys but never does any help would be greatly appreciated
AHK script:Stars Filtered SNG Opener Quote
11-07-2008 , 09:30 AM
This could be your answer:

It is set to work with black lobby ->

Quote:
Originally Posted by Everlong
To work with standard old lobby replace all instances of PokerStarsButtonClass8 with PokerStarsButtonClass7 in the script, I'll add a simple setting for this in the next version.
I have this update lying around on the laptop just havent uploaded yet will do
AHK script:Stars Filtered SNG Opener Quote
11-08-2008 , 02:33 AM
Quote:
Originally Posted by Everlong
This could be your answer:

It is set to work with black lobby ->



I have this update lying around on the laptop just havent uploaded yet will do
After changing the class it works and registers with the old Lobby. I'm not sure why but for some reason the "Registered In Tournaments" window keeps popping up and closing.
AHK script:Stars Filtered SNG Opener Quote
11-08-2008 , 03:15 AM
SFSO opens that to check how many to register for.


I uploaded the one with the setting for lobby. Haven't had time to test.
AHK script:Stars Filtered SNG Opener Quote
11-08-2008 , 08:55 PM
hey im back to play some sngs again and I was using 3.0.8a with the lobby not minimizing and that worked fine but I prefer to have it minimize the lobby but now that version isnt up there.

Also on the latest 0.9 the text seemed all messed up and couldnt read it fully like the other versions and it was just not working and it just kept opening my cashier and not doing anything. Can you post up 3.0.8 (the one that DOES minimize the lobby)
AHK script:Stars Filtered SNG Opener Quote
11-08-2008 , 09:50 PM
3.0.9 removed for the time being i will fix and test.

08 and 08a are back up

sry
AHK script:Stars Filtered SNG Opener Quote
11-09-2008 , 12:26 PM
why there is unable to download,
can it auto register for double or nth ?


Thanks :>
AHK script:Stars Filtered SNG Opener Quote
11-11-2008 , 02:29 AM
Hey I wanted to make a request and I would add another donation if you could do it, but can you add a feature like a checkbox or something for 'register for sets' or something like that because the new version is awesome for continuous running getting everything loaded and maintaining the right amount of tables but the batch register and the initial registering of a lot of tourneys can be slow and painful.

What happens is it will register in one and it will keep checking the 'registered in tournaments' dialog on stars often (twice pre register I think) and then there will be a big list of sngs and it will keep going to the top of the list and sometimes take up to 30 seconds to find a table that it hadnt registered in. Perhaps removing the 'registered in tournaments' checkbox for this mode?

The old version (I think from the previous thread) was not usable for running continuous but it was actually very efficient for registering in sets via setting # to keep open and register in X tournaments total at the same amount and it would very quickly register for all of them and then stop at the total.

This is much better for me lately ive been regging in sets of like 30 and the new version of this takes a long time to do that, but is great for running continuous settings which I still do often but could you at the least upload an old version of the script with updated button classes for sets or perhaps incorporate a checkbox for registering in sets that would maybe just remove the checking of the 'registered in tournaments' or perhaps it might be an issue with scrolling up during batch.

So id make a new donation if you could do something like that or just up the old script updated for the new software of stars.

thanks
AHK script:Stars Filtered SNG Opener Quote
11-11-2008 , 03:01 AM
watching is a little closer it seems liek during batch it scrolls down like 5(?) times and if it doesnt find the 'register' button and then scrolls up looking for the register button when there are a bunch of unregistered tourneys below it that it could reg in. It seems like it happens when there is a long list of awaiting tourneys
AHK script:Stars Filtered SNG Opener Quote
11-11-2008 , 03:50 AM
I am considering a complete re-write of this seeing how I have trouble at times understanding how I was originally thinking.

Anyway, I think if you change this at the bottom
Code:
    ControlGet, v, Visible, , PokerStarsButtonClass8, ahk_id%id%
      If (v = 0)
        If (ClickdirectionCount<=5) {
          If (direction=0) {
            ControlSend, PokerStarsListClass5, {NumpadDown}, ahk_id%id%
          } Else {
            ControlSend, PokerStarsListClass5, {NumpadUp}, ahk_id%id%
to a higher number in If (ClickdirectionCount<=5)

it will look further down.

Lemme know.
AHK script:Stars Filtered SNG Opener Quote
11-11-2008 , 04:02 AM
that works a lot better actually thanks
AHK script:Stars Filtered SNG Opener Quote
11-11-2008 , 05:55 AM
Overcards seems nuked atm. I made a test version 3.1 with misc improvements

* Setting for lobby (worked on my 2 min test)
* Setting for no of times to scroll (also seemed to work)
Code:
; Author:         Everlong@2p2 Code assembled from misc sources, thanks to _dave_, chris228, finnisher
#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%
#SingleInstance, Force
SetTitleMatchMode, 2
SetTimer, register, off
SetTimer, safeguard, off
Stringtrimright, thisahk, A_ScriptName, 4

RegSofar=0
OpenTables=0
trows=20
SysGet,mon, MonitorworkArea
fivesec=0
two=0
ddlist4=Off|
ddlist5=Off|
ddlist6=Off|
LobbyList=Default|Black|
Loop 50
 {
  fivesec:=fivesec+5
  ddlist:=ddlist . A_index . "|"
  ddlist2:=ddlist2 . fivesec . "|"
  ddlist5:=ddlist5 . fivesec . "|"
  ddlist6:=ddlist6 . fivesec . "|"
  If (A_index<21)
  ddlist7:=ddlist7 . A_Index . "|"
 }
Loop 100
 {
  two:=two+2
  ddlist3:=ddlist3 . two . "|"
 }
Loop 15
 {
  ddlist4:=ddlist4 . A_index . "|"
 }

Gosub, BuildGui
Return

BuildGui:
;Gui, color, Black
Gui, font, cOlive
Gui, add, tab, h435 w230, General|Registered in Tournaments
Gui, add, text, , Auto-register
Gui, add, Checkbox, yp xp+75 Check3 Checked-1 vRegister
Gui, add, text, yp+20 xp-75 ,Batch-register?
Gui, add, Checkbox,yp xp+75 vBatchReg
Gui, add, Text, xp-75 yp+20 , Lobby theme:
Gui, add, Dropdownlist, w65 yp-5 xp+75 vLobby, %LobbyList%
Gui, add, Text, xp-75 yp+30, Times to scroll:
Gui, add, Dropdownlist, w50 yp-5 xp+75 vscrldwn, %ddlist7%

 Gui, add, text,xp-75 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+14 , 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, Disable if no user Input (min):
 Gui, add, DropDownList, w50 yp-5 xp+140 vGuardtimer Choose1 , %ddlist4%
 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 w56 h20 Center, &Resume
 Gui, Add, Button, Disabled  w56 h20 yp xp+56 Center, &Pause
 Gui, Add, Button, w56 h20 yp xp+91 gDonate, &Donate
Gui, tab, 2
Gui, add, text, , Manually populate list: F11
Gui, Add, Listview,  r%trows%  grid gFindLobby w200 c1, Registered in Tournaments
gui, show, w248, %thisahk%
 WinGetPos, x, y, w, h, SFSO
 x:=monRight-w
 y:=monBottom-h
 Gosub, GetIni
 Gui, show, x%x% y%y%, %thisahk%
Return

getgui:
 GuiControl,, Register, -1
 Register = 1
 Gui, Submit, NoHide
 displayedTime=
 If (lobby="Default")
 {
 regbutton:="PokerStarsButtonClass7"
 }
 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
  }
   SetTimer, NukeLobbies, %CloseInterv%
 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
 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
  }
 ControlSend, PokerStarsListClass5, {NumpadUp 20}, ahk_id%lobbyid% 
 WinGet, PhysicalTables, list, 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, %scrldwn%, %thisahk%.ini, Settings, scrldwn
 IniWrite, %Lobby%, %thisahk%.ini, Settings, Lobby
 IniWrite, %BatchReg%, %thisahk%.ini, Settings, BatchReg
 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, scrldwn, %thisahk%.ini, Settings, scrldwn
   IniRead, Lobby, %thisahk%.ini, Settings, Lobby
   IniRead, BatchReg, %thisahk%.ini, Settings, BatchReg
   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
  StringReplace, ddlist7, ddlist7, %scrldwn%, %scrldwn%|
     GuiControl, , scrldwn, |%ddlist7%
  StringReplace, LobbyList, LobbyList, %Lobby%, %Lobby%|
     GuiControl, , Lobby, |%LobbyList%
   GuiControl, , BatchReg, %BatchReg%
   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

F11::
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
 }

RegSNGexec(id, times, scrldwn) {
  global RegSofar
  global Register
  global OpenTables
  global KeepOpen
  global TotalLimit
  global RegButton
  Loop %times%
   {
   Gosub, ManualCount
   If (OpenTables >= KeepOpen)
   exit
    If (OpenTable >0 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 (ClickdirectionCount<=scrldwn) {
          If (direction=0) {
            ControlSend, PokerStarsListClass5, {NumpadDown}, ahk_id%id%
          } Else {
            ControlSend, PokerStarsListClass5, {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 ) {
      ControlClick, %regbutton%, ahk_id%id%
      WinWait, Tournament Registration ahk_class #32770, , 10
      {
       WinGet, regid, id
       ControlFocus, Button1, ahk_id%regid%
       Sleep, -1
       ControlSend, Button1, {Space}, ahk_id%regid%
       Sleep, 10
       ;TEST
       WinGet, clist , ControlList, ahk_id%regid%
       IfInString, clist, Button4
       {
              ControlFocus, Button3, ahk_id%regid%
       Sleep, -1
       ControlSend, Button3, {Space}, ahk_id%regid%
       RegSofar++
       GuiControl, , RegSofar, SNG:s registered so far: %RegSofar%
       GuiControl, , Status, Status: Waiting ;TEST
       Gui, show, NoActivate, %thisahk%
       }
       else
       {
       ControlFocus, Button2, ahk_id%regid%
       Sleep, -1
       ControlSend, Button2, {Space}, ahk_id%regid%
       RegSofar++
       GuiControl, , RegSofar, SNG:s registered so far: %RegSofar%
       GuiControl, , Status, Status: Waiting ;TEST
       Gui, show, NoActivate, %thisahk%
       }
      }
      WinWait, Tournament Registration ahk_class #32770, , 10
    {
     WinGet, regid, id
     ControlGetText, ctext, Button1, ahk_id%regid%
     If ( cText = "OK" ) {
       ControlFocus, Button1, ahk_id%regid%
       Sleep, -1
       ControlSend, Button1, {Space}, ahk_id%regid%
      }
    }
   }
 }
}
CountTourneys() {
  global
  WinMenuSelectItem, PokerStars Lobby,, Requests, Registered In Tournaments
  WinWait, Registered In Tournaments ahk_class #32770, , 10
  WinGet, ritw, id
  ControlGetText, nf, Button1, ahk_id%ritw%
  If (nf = "OK")
   {
    ControlFocus, Button1, ahk_id%ritw%
    Sleep, -1
    ControlSend, Button1, {Space}, ahk_id%ritw%
    WinMinimize, PokerStars Lobby
    Return 0
   }
  ControlGet, Tlist, List,, ListBox1, ahk_id%ritw%
  ControlFocus, Button2, ahk_id%ritw%
  Sleep, -1
  ControlSend, Button2, {Space}, ahk_id%ritw%
  WinMinimize, PokerStars Lobby
  StringSplit, tlist, tlist, `n
  If (tlist0 > 4)
    trows:=tlist0

  GuiControl, , trows, %trows%
  Loop %tlist0%
   {
    t:=tlist%A_index%
    If A_index=1
      LV_Delete()
    LV_Add("", t)
    LV_ModifyCol()
    LV_DeleteCol(2)
   }
  Gui, show, NoActivate, %thisahk%
  Return tlist0
 }
 
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
11-11-2008 , 07:23 AM
hmm I just noticed something interesting, when you highlight a table that is 'running' as opposed to registering there is a dialog that says 'register to any' and it will register you in that particular buy in without having to select it individually, this could eliminate the scrolling altogether if you filter your settings to show only 'running.' and not 'registering'

Could you try to incorporate a setting where it looks for this other image 'Register to Any' as opposed to the standard 'Register' button and if you do could you add an option for it to not scroll at all (0)? Id be happy to test it out and I think that could speed up the reg process a lot.

Also, on a small sidenote, why does limit total have to be an even number?

thanks again for all the help
AHK script:Stars Filtered SNG Opener Quote
11-11-2008 , 07:59 AM
Quote:
Originally Posted by jmflu
hmm I just noticed something interesting, when you highlight a table that is 'running' as opposed to registering there is a dialog that says 'register to any' and it will register you in that particular buy in without having to select it individually, this could eliminate the scrolling altogether if you filter your settings to show only 'running.' and not 'registering'

Could you try to incorporate a setting where it looks for this other image 'Register to Any' as opposed to the standard 'Register' button and if you do could you add an option for it to not scroll at all (0)? Id be happy to test it out and I think that could speed up the reg process a lot.

Also, on a small sidenote, why does limit total have to be an even number?

thanks again for all the help
well ignore that idea, tried and does not work.
AHK script:Stars Filtered SNG Opener Quote
11-11-2008 , 08:12 AM
3.1.1

*added SetReg mode, this mode will bypass checking Registered in tournaments menu so you can more easily fire up a set (best is to then set max and keep open to the same limit - or rather keep open will have no impact I think)

-not really tested


*added Off as a choice in Times to scroll (this will just check the topmost row)

Code:
; Author:         Everlong@2p2 Code assembled from misc sources, thanks to _dave_, chris228, finnisher
#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%
#SingleInstance, Force
SetTitleMatchMode, 2
SetTimer, register, off
SetTimer, safeguard, off
Stringtrimright, thisahk, A_ScriptName, 4

RegSofar=0
OpenTables=0
trows=20
SysGet,mon, MonitorworkArea
fivesec=0
two=0
ddlist4=Off|
ddlist5=Off|
ddlist6=Off|
ddlist7=Off|
LobbyList=Default|Black|
Loop 100
 {
   two:=two+2
  ddlist3:=ddlist3 . two . "|"
  If (A_index<51)
  {
  fivesec:=fivesec+5
  ddlist:=ddlist . A_index . "|"
  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 . "|"
  }
 }
 }
 }


Gosub, BuildGui
Return

BuildGui:
;Gui, color, Black
Gui, font, cOlive
Gui, add, tab, h445 w230, General|Registered in Tournaments
Gui, add, text, , Auto-register
Gui, add, Checkbox, yp xp+80 Check3 Checked-1 vRegister
Gui, add, text, yp+20 xp-80 ,Batch-register?
Gui, add, Checkbox,yp xp+80 vBatchReg
Gui, add, text, yp+20 xp-80 ,SetReg* mode?
Gui, add, Checkbox,yp xp+80 vSetReg
Gui, add, Text, xp-80 yp+20 , Lobby theme:
Gui, add, Dropdownlist, w65 yp-5 xp+80 vLobby, %LobbyList%
Gui, add, Text, xp-80 yp+30, Times to scroll:
Gui, add, Dropdownlist, w50 yp-5 xp+80 vscrldwn, %ddlist7%

 Gui, add, text,xp-80 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+14 , 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, Disable if no user Input (min):
 Gui, add, DropDownList, w50 yp-5 xp+140 vGuardtimer Choose1 , %ddlist4%
 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 w56 h20 Center, &Resume
 Gui, Add, Button, Disabled  w56 h20 yp xp+56 Center, &Pause
 Gui, Add, Button, w56 h20 yp xp+91 gDonate, &Donate
Gui, tab, 2
Gui, add, text, , Manually populate list: F11 `n(disabled in SetReg mode)
Gui, Add, Listview,  r%trows%  grid gFindLobby w200 c1, Registered in Tournaments
gui, show, w248, %thisahk%
 WinGetPos, x, y, w, h, SFSO
 x:=monRight-w
 y:=monBottom-h
 Gosub, GetIni
 Gui, show, x%x% y%y%, %thisahk%
Return

getgui:
 GuiControl,, Register, -1
 Register = 1
 Gui, Submit, NoHide
 displayedTime=
 If (lobby="Default")
 {
 regbutton:="PokerStarsButtonClass7"
 }
 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
  }
   SetTimer, NukeLobbies, %CloseInterv%
 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
 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
  }
 ControlSend, PokerStarsListClass5, {NumpadUp 20}, ahk_id%lobbyid% 
 WinGet, PhysicalTables, list, 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, %scrldwn%, %thisahk%.ini, Settings, scrldwn
 IniWrite, %Lobby%, %thisahk%.ini, Settings, Lobby
 IniWrite, %BatchReg%, %thisahk%.ini, Settings, BatchReg
 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, scrldwn, %thisahk%.ini, Settings, scrldwn
   IniRead, Lobby, %thisahk%.ini, Settings, Lobby
   IniRead, BatchReg, %thisahk%.ini, Settings, BatchReg
   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
  StringReplace, ddlist7, ddlist7, %scrldwn%, %scrldwn%|
     GuiControl, , scrldwn, |%ddlist7%
  StringReplace, LobbyList, LobbyList, %Lobby%, %Lobby%|
     GuiControl, , Lobby, |%LobbyList%
   GuiControl, , BatchReg, %BatchReg%
   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

F11::
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
 }

RegSNGexec(id, times, scrldwn) {
  global RegSofar
  global Register
  global OpenTables
  global KeepOpen
  global TotalLimit
  global RegButton
  Loop %times%
   {
   Gosub, ManualCount
   If (OpenTables >= KeepOpen)
   exit
    If (OpenTable >0 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, PokerStarsListClass5, {NumpadDown}, ahk_id%id%
          } Else {
            ControlSend, PokerStarsListClass5, {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 ) {
      ControlClick, %regbutton%, ahk_id%id%
      WinWait, Tournament Registration ahk_class #32770, , 10
      {
       WinGet, regid, id
       ControlFocus, Button1, ahk_id%regid%
       Sleep, -1
       ControlSend, Button1, {Space}, ahk_id%regid%
       Sleep, 10
       ;TEST
       WinGet, clist , ControlList, ahk_id%regid%
       IfInString, clist, Button4
       {
              ControlFocus, Button3, ahk_id%regid%
       Sleep, -1
       ControlSend, Button3, {Space}, ahk_id%regid%
       RegSofar++
       GuiControl, , RegSofar, SNG:s registered so far: %RegSofar%
       GuiControl, , Status, Status: Waiting ;TEST
       Gui, show, NoActivate, %thisahk%
       }
       else
       {
       ControlFocus, Button2, ahk_id%regid%
       Sleep, -1
       ControlSend, Button2, {Space}, ahk_id%regid%
       RegSofar++
       GuiControl, , RegSofar, SNG:s registered so far: %RegSofar%
       GuiControl, , Status, Status: Waiting ;TEST
       Gui, show, NoActivate, %thisahk%
       }
      }
      WinWait, Tournament Registration ahk_class #32770, , 10
    {
     WinGet, regid, id
     ControlGetText, ctext, Button1, ahk_id%regid%
     If ( cText = "OK" ) {
       ControlFocus, Button1, ahk_id%regid%
       Sleep, -1
       ControlSend, Button1, {Space}, ahk_id%regid%
      }
    }
   }
 }
}
CountTourneys() {
  global
  If (SetReg=1)
  {
  return 0
  }
  WinMenuSelectItem, PokerStars Lobby,, Requests, Registered In Tournaments
  WinWait, Registered In Tournaments ahk_class #32770, , 10
  WinGet, ritw, id
  ControlGetText, nf, Button1, ahk_id%ritw%
  If (nf = "OK")
   {
    ControlFocus, Button1, ahk_id%ritw%
    Sleep, -1
    ControlSend, Button1, {Space}, ahk_id%ritw%
    WinMinimize, PokerStars Lobby
    Return 0
   }
  ControlGet, Tlist, List,, ListBox1, ahk_id%ritw%
  ControlFocus, Button2, ahk_id%ritw%
  Sleep, -1
  ControlSend, Button2, {Space}, ahk_id%ritw%
  WinMinimize, PokerStars Lobby
  StringSplit, tlist, tlist, `n
  If (tlist0 > 4)
    trows:=tlist0

  GuiControl, , trows, %trows%
  Loop %tlist0%
   {
    t:=tlist%A_index%
    If A_index=1
      LV_Delete()
    LV_Add("", t)
    LV_ModifyCol()
    LV_DeleteCol(2)
   }
  Gui, show, NoActivate, %thisahk%
  Return tlist0
 }
 
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
11-11-2008 , 04:05 PM
Quote:
Originally Posted by Everlong
3.1.1

*added SetReg mode, this mode will bypass checking Registered in tournaments menu so you can more easily fire up a set (best is to then set max and keep open to the same limit - or rather keep open will have no impact I think)

-not really tested


*added Off as a choice in Times to scroll (this will just check the topmost row)
Testing it now, so far so good. Awesome work.

Thanks :-)
AHK script:Stars Filtered SNG Opener Quote
11-11-2008 , 11:13 PM
Cosign on the awesome work, setreg is working great although one small thing could speed it up is taking out the auto scroll up to the top after each registration (just for setreg as other than that it is all great)

also, for people using this script hook up everlong with some donations! This is something people have been asking about and wanting for a long time and this is a very working version of what we wanted so show him a little love.
AHK script:Stars Filtered SNG Opener Quote
11-12-2008 , 04:01 AM
thx for the praise

3.1.2
* Re-enabled manual populate tournament list with F11
* auto-scroll to top disabled in SetReg mode

-- not tested at all --

Code:
; Author:         Everlong@2p2 Code assembled from misc sources, thanks to _dave_, chris228, finnisher
#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%
#SingleInstance, Force
SetTitleMatchMode, 2
SetTimer, register, off
SetTimer, safeguard, off
Stringtrimright, thisahk, A_ScriptName, 4

RegSofar=0
OpenTables=0
trows=20
SysGet,mon, MonitorworkArea
fivesec=0
two=0
ddlist4=Off|
ddlist5=Off|
ddlist6=Off|
ddlist7=Off|
LobbyList=Default|Black|
Loop 100
 {
   two:=two+2
  ddlist3:=ddlist3 . two . "|"
  If (A_index<51)
  {
  fivesec:=fivesec+5
  ddlist:=ddlist . A_index . "|"
  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 . "|"
  }
 }
 }
 }


Gosub, BuildGui
Return

BuildGui:
;Gui, color, Black
Gui, font, cOlive
Gui, add, tab, h445 w220, General|Registered in Tournaments
Gui, add, text, , Auto-register
Gui, add, Checkbox, yp xp+80 Check3 Checked-1 vRegister
Gui, add, text, yp+20 xp-80 ,Batch-register?
Gui, add, Checkbox,yp xp+80 vBatchReg
Gui, add, text, yp+20 xp-80 ,SetReg* mode?
Gui, add, Checkbox,yp xp+80 vSetReg
Gui, add, Text, xp-80 yp+20 , Lobby theme:
Gui, add, Dropdownlist, w65 yp-5 xp+80 vLobby, %LobbyList%
Gui, add, Text, xp-80 yp+30, Times to scroll:
Gui, add, Dropdownlist, w50 yp-5 xp+80 vscrldwn, %ddlist7%

 Gui, add, text,xp-80 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+14 , 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, Disable if no user Input (min):
 Gui, add, DropDownList, w50 yp-5 xp+140 vGuardtimer Choose1 , %ddlist4%
 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 w56 h20 Center, &Resume
 Gui, Add, Button, Disabled  w56 h20 yp xp+56 Center, &Pause
 Gui, Add, Button, w56 h20 yp xp+80 gDonate, &Donate
Gui, tab, 2
Gui, add, text, , Manually populate list: F11
Gui, Add, Listview,  r%trows%  grid gFindLobby w200 c1, Registered in Tournaments
gui, show, w236, %thisahk%
 WinGetPos, x, y, w, h, SFSO
 x:=monRight-w
 y:=monBottom-h
 Gosub, GetIni
 Gui, show, x%x% y%y%, %thisahk%
Return

getgui:
 GuiControl,, Register, -1
 Register = 1
 Gui, Submit, NoHide
 displayedTime=
 If (lobby="Default")
 {
 regbutton:="PokerStarsButtonClass7"
 }
 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
  }
   SetTimer, NukeLobbies, %CloseInterv%
 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
 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 (SetReg=0)
 {
 ControlSend, PokerStarsListClass5, {NumpadUp 20}, ahk_id%lobbyid% 
 }
 WinGet, PhysicalTables, list, 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, %scrldwn%, %thisahk%.ini, Settings, scrldwn
 IniWrite, %Lobby%, %thisahk%.ini, Settings, Lobby
 IniWrite, %BatchReg%, %thisahk%.ini, Settings, BatchReg
 IniWrite, %Setreg%, %thisahk%.ini, Settings, SetReg
 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, 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, 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
  StringReplace, ddlist7, ddlist7, %scrldwn%, %scrldwn%|
     GuiControl, , scrldwn, |%ddlist7%
  StringReplace, LobbyList, LobbyList, %Lobby%, %Lobby%|
     GuiControl, , Lobby, |%LobbyList%
   GuiControl, , BatchReg, %BatchReg%
   GuiControl, , SetReg, %SetReg%
   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

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
 }

RegSNGexec(id, times, scrldwn) {
  global RegSofar
  global Register
  global OpenTables
  global KeepOpen
  global TotalLimit
  global RegButton
  Loop %times%
   {
   Gosub, ManualCount
   If (OpenTables >= KeepOpen)
   exit
    If (OpenTable >0 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, PokerStarsListClass5, {NumpadDown}, ahk_id%id%
          } Else {
            ControlSend, PokerStarsListClass5, {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 ) {
      ControlClick, %regbutton%, ahk_id%id%
      WinWait, Tournament Registration ahk_class #32770, , 10
      {
       WinGet, regid, id
       ControlFocus, Button1, ahk_id%regid%
       Sleep, -1
       ControlSend, Button1, {Space}, ahk_id%regid%
       Sleep, 10
       ;TEST
       WinGet, clist , ControlList, ahk_id%regid%
       IfInString, clist, Button4
       {
              ControlFocus, Button3, ahk_id%regid%
       Sleep, -1
       ControlSend, Button3, {Space}, ahk_id%regid%
       RegSofar++
       GuiControl, , RegSofar, SNG:s registered so far: %RegSofar%
       GuiControl, , Status, Status: Waiting ;TEST
       Gui, show, NoActivate, %thisahk%
       }
       else
       {
       ControlFocus, Button2, ahk_id%regid%
       Sleep, -1
       ControlSend, Button2, {Space}, ahk_id%regid%
       RegSofar++
       GuiControl, , RegSofar, SNG:s registered so far: %RegSofar%
       GuiControl, , Status, Status: Waiting ;TEST
       Gui, show, NoActivate, %thisahk%
       }
      }
      WinWait, Tournament Registration ahk_class #32770, , 10
    {
     WinGet, regid, id
     ControlGetText, ctext, Button1, ahk_id%regid%
     If ( cText = "OK" ) {
       ControlFocus, Button1, ahk_id%regid%
       Sleep, -1
       ControlSend, Button1, {Space}, ahk_id%regid%
      }
    }
   }
 }
}
CountTourneys() {
  global
  If (SetReg=1)
  {
  return 0
  }
  WinMenuSelectItem, PokerStars Lobby,, Requests, Registered In Tournaments
  WinWait, Registered In Tournaments ahk_class #32770, , 10
  WinGet, ritw, id
  ControlGetText, nf, Button1, ahk_id%ritw%
  If (nf = "OK")
   {
    ControlFocus, Button1, ahk_id%ritw%
    Sleep, -1
    ControlSend, Button1, {Space}, ahk_id%ritw%
    WinMinimize, PokerStars Lobby
    Return 0
   }
  ControlGet, Tlist, List,, ListBox1, ahk_id%ritw%
  ControlFocus, Button2, ahk_id%ritw%
  Sleep, -1
  ControlSend, Button2, {Space}, ahk_id%ritw%
  WinMinimize, PokerStars Lobby
  StringSplit, tlist, tlist, `n
  If (tlist0 > 4)
    trows:=tlist0

  GuiControl, , trows, %trows%
  Loop %tlist0%
   {
    t:=tlist%A_index%
    If A_index=1
      LV_Delete()
    LV_Add("", t)
    LV_ModifyCol()
    LV_DeleteCol(2)
   }
  Gui, show, NoActivate, %thisahk%
  Return tlist0
 }
 
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
11-12-2008 , 05:16 AM
Quote:
Originally Posted by Everlong
thx for the praise

3.1.2
* Re-enabled manual populate tournament list with F11
* auto-scroll to top disabled in SetReg mode

-- not tested at all --

Code:
; Author:         Everlong@2p2 Code assembled from misc sources, thanks to _dave_, chris228, finnisher
#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%
#SingleInstance, Force
SetTitleMatchMode, 2
SetTimer, register, off
SetTimer, safeguard, off
Stringtrimright, thisahk, A_ScriptName, 4

RegSofar=0
OpenTables=0
trows=20
SysGet,mon, MonitorworkArea
fivesec=0
two=0
ddlist4=Off|
ddlist5=Off|
ddlist6=Off|
ddlist7=Off|
LobbyList=Default|Black|
Loop 100
 {
   two:=two+2
  ddlist3:=ddlist3 . two . "|"
  If (A_index<51)
  {
  fivesec:=fivesec+5
  ddlist:=ddlist . A_index . "|"
  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 . "|"
  }
 }
 }
 }


Gosub, BuildGui
Return

BuildGui:
;Gui, color, Black
Gui, font, cOlive
Gui, add, tab, h445 w220, General|Registered in Tournaments
Gui, add, text, , Auto-register
Gui, add, Checkbox, yp xp+80 Check3 Checked-1 vRegister
Gui, add, text, yp+20 xp-80 ,Batch-register?
Gui, add, Checkbox,yp xp+80 vBatchReg
Gui, add, text, yp+20 xp-80 ,SetReg* mode?
Gui, add, Checkbox,yp xp+80 vSetReg
Gui, add, Text, xp-80 yp+20 , Lobby theme:
Gui, add, Dropdownlist, w65 yp-5 xp+80 vLobby, %LobbyList%
Gui, add, Text, xp-80 yp+30, Times to scroll:
Gui, add, Dropdownlist, w50 yp-5 xp+80 vscrldwn, %ddlist7%

 Gui, add, text,xp-80 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+14 , 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, Disable if no user Input (min):
 Gui, add, DropDownList, w50 yp-5 xp+140 vGuardtimer Choose1 , %ddlist4%
 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 w56 h20 Center, &Resume
 Gui, Add, Button, Disabled  w56 h20 yp xp+56 Center, &Pause
 Gui, Add, Button, w56 h20 yp xp+80 gDonate, &Donate
Gui, tab, 2
Gui, add, text, , Manually populate list: F11
Gui, Add, Listview,  r%trows%  grid gFindLobby w200 c1, Registered in Tournaments
gui, show, w236, %thisahk%
 WinGetPos, x, y, w, h, SFSO
 x:=monRight-w
 y:=monBottom-h
 Gosub, GetIni
 Gui, show, x%x% y%y%, %thisahk%
Return

getgui:
 GuiControl,, Register, -1
 Register = 1
 Gui, Submit, NoHide
 displayedTime=
 If (lobby="Default")
 {
 regbutton:="PokerStarsButtonClass7"
 }
 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
  }
   SetTimer, NukeLobbies, %CloseInterv%
 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
 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 (SetReg=0)
 {
 ControlSend, PokerStarsListClass5, {NumpadUp 20}, ahk_id%lobbyid% 
 }
 WinGet, PhysicalTables, list, 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, %scrldwn%, %thisahk%.ini, Settings, scrldwn
 IniWrite, %Lobby%, %thisahk%.ini, Settings, Lobby
 IniWrite, %BatchReg%, %thisahk%.ini, Settings, BatchReg
 IniWrite, %Setreg%, %thisahk%.ini, Settings, SetReg
 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, 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, 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
  StringReplace, ddlist7, ddlist7, %scrldwn%, %scrldwn%|
     GuiControl, , scrldwn, |%ddlist7%
  StringReplace, LobbyList, LobbyList, %Lobby%, %Lobby%|
     GuiControl, , Lobby, |%LobbyList%
   GuiControl, , BatchReg, %BatchReg%
   GuiControl, , SetReg, %SetReg%
   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

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
 }

RegSNGexec(id, times, scrldwn) {
  global RegSofar
  global Register
  global OpenTables
  global KeepOpen
  global TotalLimit
  global RegButton
  Loop %times%
   {
   Gosub, ManualCount
   If (OpenTables >= KeepOpen)
   exit
    If (OpenTable >0 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, PokerStarsListClass5, {NumpadDown}, ahk_id%id%
          } Else {
            ControlSend, PokerStarsListClass5, {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 ) {
      ControlClick, %regbutton%, ahk_id%id%
      WinWait, Tournament Registration ahk_class #32770, , 10
      {
       WinGet, regid, id
       ControlFocus, Button1, ahk_id%regid%
       Sleep, -1
       ControlSend, Button1, {Space}, ahk_id%regid%
       Sleep, 10
       ;TEST
       WinGet, clist , ControlList, ahk_id%regid%
       IfInString, clist, Button4
       {
              ControlFocus, Button3, ahk_id%regid%
       Sleep, -1
       ControlSend, Button3, {Space}, ahk_id%regid%
       RegSofar++
       GuiControl, , RegSofar, SNG:s registered so far: %RegSofar%
       GuiControl, , Status, Status: Waiting ;TEST
       Gui, show, NoActivate, %thisahk%
       }
       else
       {
       ControlFocus, Button2, ahk_id%regid%
       Sleep, -1
       ControlSend, Button2, {Space}, ahk_id%regid%
       RegSofar++
       GuiControl, , RegSofar, SNG:s registered so far: %RegSofar%
       GuiControl, , Status, Status: Waiting ;TEST
       Gui, show, NoActivate, %thisahk%
       }
      }
      WinWait, Tournament Registration ahk_class #32770, , 10
    {
     WinGet, regid, id
     ControlGetText, ctext, Button1, ahk_id%regid%
     If ( cText = "OK" ) {
       ControlFocus, Button1, ahk_id%regid%
       Sleep, -1
       ControlSend, Button1, {Space}, ahk_id%regid%
      }
    }
   }
 }
}
CountTourneys() {
  global
  If (SetReg=1)
  {
  return 0
  }
  WinMenuSelectItem, PokerStars Lobby,, Requests, Registered In Tournaments
  WinWait, Registered In Tournaments ahk_class #32770, , 10
  WinGet, ritw, id
  ControlGetText, nf, Button1, ahk_id%ritw%
  If (nf = "OK")
   {
    ControlFocus, Button1, ahk_id%ritw%
    Sleep, -1
    ControlSend, Button1, {Space}, ahk_id%ritw%
    WinMinimize, PokerStars Lobby
    Return 0
   }
  ControlGet, Tlist, List,, ListBox1, ahk_id%ritw%
  ControlFocus, Button2, ahk_id%ritw%
  Sleep, -1
  ControlSend, Button2, {Space}, ahk_id%ritw%
  WinMinimize, PokerStars Lobby
  StringSplit, tlist, tlist, `n
  If (tlist0 > 4)
    trows:=tlist0

  GuiControl, , trows, %trows%
  Loop %tlist0%
   {
    t:=tlist%A_index%
    If A_index=1
      LV_Delete()
    LV_Add("", t)
    LV_ModifyCol()
    LV_DeleteCol(2)
   }
  Gui, show, NoActivate, %thisahk%
  Return tlist0
 }
 
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
Hey sorry I kinda feel like a jackass but I actually found out regging for multiple buy ins that with the setreg it works better with the scrolling to the top each time because it ends up mixing the buy ins up better but when it skips the move to the top it is better for a single set of the same buy ins.

Could this be an optional thing (scrolling up)? (although the general tab is getting kind of cluttered with all the things we're adding, perhaps an 'options' tab to clean it up a bit - but obv nothing that needs to be done quickly, i am basically nitpicking)

thx again for the work
AHK script:Stars Filtered SNG Opener Quote
11-12-2008 , 06:58 AM
Uploaded v3.2 to overcards with new tab and setting for top of lobby start etc.
Not really tested.

http://www.overcards.com/wiki/moin.cgi/SFSO
AHK script:Stars Filtered SNG Opener Quote
11-13-2008 , 06:29 PM
hey man... i dont understand the diference between No of SNGs to keep open and Limit Total Sngs to: .. can u explain to me plz?
AHK script:Stars Filtered SNG Opener Quote
11-13-2008 , 06:58 PM
I would assume No of SNGs to keep open would be how many tables you wanted to play at one time. For instance, if you 12 tabled, 12 would go there. Then I would assume that Limit Total Sngs would be how many total sngs you wanted to play. If you set this to say, 24, it would keep opening sngs with a max of 12 open at a time, opening a new one as you bust out of an old one, until you've played 24 total sngs.

Those are just my guesses but I'd be surprised if I was wrong.
AHK script:Stars Filtered SNG Opener Quote
11-14-2008 , 03:49 AM
100% correct
AHK script:Stars Filtered SNG Opener Quote

      
m