Two Plus Two Publishing LLC Two Plus Two Publishing LLC
 

Go Back   Two Plus Two Poker Forums > > >

Notices

Free Software Discussion of Free / Freeware / Donationware / Open Source poker software and Free Graphics mods

Reply
 
Thread Tools Display Modes
Old 06-25-2008, 09:04 AM   #1
Everlong
veteran
 
Everlong's Avatar
 
Join Date: Aug 2005
Location: let it snow
Posts: 3,064
AHK script:Stars Filtered SNG Opener

This is the latest (and imo working) version of the stuff that evolved from the other thread. Guys that I PM:ed today should also update - there are minor changes since pm.

Stars Filtered SNG Opener (SFSO)

I decided to make this one it's own thread as it seems to be working OK now.
[DISCLAIMER]
It has only been tested by a couple of people so please take it for a micro testdrive.
[/DISCLAIMER]]

* Will not work with Stars custom Lobby theme
* Best to put in a separate folder - it will create a .ini file with your settings

To do:
* Add function for auto-closing tables where Hero busted
* Add auto sit-in function

http://overcards.com/wiki/moin.cgi/SFSO

Post issues here. You need to run as admin on Vista obv
Everlong is offline   Reply With Quote
Old 06-25-2008, 04:05 PM   #2
thunderbolt
adept
 
Join Date: Feb 2006
Posts: 1,037
Re: AHK script:Stars Filtered SNG Opener

Very nice thanks for the support Everlong!!!
thunderbolt is offline   Reply With Quote
Old 06-26-2008, 04:48 AM   #3
Simplicity8
veteran
 
Simplicity8's Avatar
 
Join Date: Apr 2008
Location: @Simplicity38
Posts: 2,485
Re: AHK script:Stars Filtered SNG Opener

When setting "No of SNG:s to keep open:" to 18 and "Limit total SNG:s to:" as 54 it kept registering past 18.
Simplicity8 is offline   Reply With Quote
Old 06-26-2008, 05:23 AM   #4
Everlong
veteran
 
Everlong's Avatar
 
Join Date: Aug 2005
Location: let it snow
Posts: 3,064
Re: AHK script:Stars Filtered SNG Opener

Quote:
Originally Posted by Simplicity8 View Post
When setting "No of SNG:s to keep open:" to 18 and "Limit total SNG:s to:" as 54 it kept registering past 18.
I will test this a bit at home. If it registers way past 18 obv there is something wrong. However there is a possible scenario where it will register past the no to keep open: say you have 17 tables running ->it it will keep registering for new ones until the 18:th table actually opens.

You could help me test this by opening 18 random tables (you do not need to be seated) and then see if it tries to register you. It shouldn't. If it does I messed up somewhere.
Everlong is offline   Reply With Quote
Old 06-26-2008, 06:00 AM   #5
Simplicity8
veteran
 
Simplicity8's Avatar
 
Join Date: Apr 2008
Location: @Simplicity38
Posts: 2,485
Re: AHK script:Stars Filtered SNG Opener

Quote:
Originally Posted by Everlong View Post
I will test this a bit at home. If it registers way past 18 obv there is something wrong. However there is a possible scenario where it will register past the no to keep open: say you have 17 tables running ->it it will keep registering for new ones until the 18:th table actually opens.

You could help me test this by opening 18 random tables (you do not need to be seated) and then see if it tries to register you. It shouldn't. If it does I messed up somewhere.
Did what you suggested and opened 18 play money tables and put stars lobby back to the S&Gs that I play and when I hit start it no longer registered (as it shouldn't). I then closed one of the play money tables and it began registering (as it should). So it appears that what you said is true.
Simplicity8 is offline   Reply With Quote
Old 06-26-2008, 06:20 AM   #6
Everlong
veteran
 
Everlong's Avatar
 
Join Date: Aug 2005
Location: let it snow
Posts: 3,064
Re: AHK script:Stars Filtered SNG Opener

I will add a fix for this shortly.
Everlong is offline   Reply With Quote
Old 06-26-2008, 08:23 AM   #7
Everlong
veteran
 
Everlong's Avatar
 
Join Date: Aug 2005
Location: let it snow
Posts: 3,064
Re: AHK script:Stars Filtered SNG Opener

Here's the latest version for testing (with caution) before I put it on Overcards

* Timer added for limiting session length instead of no of SNG (combination is possible)
* Added a 30 second pause of registration after registering for the last table
(for example at 5/6 tables it registers for a 6th sng then sleeps for 30 sec in order to avoid overlapping registration and extra unwanted tables). I have no idea if 30 secs is a good time. If you need to change it, edit :
if (posOverlap=1)
{
SetTimer, Register, off
Sleep 30000
posOverlap=0
SetTimer Register, on
}
about 2/3 down to someting other than 30000 mil

* Current status is displayed in red

(I am taking a break from this for a couple of days but please report and will look at it)

Code:
;
; AutoHotkey Version: 1.0.47.1
; Language:       English
; Platform:       Win9x/NT
; Author:         Everlong@2p2 Code assembled from misc sources, thanks to _dave_, chris228 
;
; Script Function: PokerStars SNG opener (for use with the tournament filter filtering a specific type of SNG/MTT-Sng)

#NoEnv 
SendMode Input
SetWorkingDir %A_ScriptDir%
;======================================================
#SingleInstance, Force
SetTitleMatchMode, 2
Settimer, register, off
SetTimer, safeguard, off
RegSofar=0
OpenTables=0
Sysget,mon, MonitorworkArea
fivesec=0
two=0
ddlist4=0ff|
ddlist5=0ff|
Loop 50
{
fivesec:=fivesec+5

ddlist:=ddlist . A_index . "|"
ddlist2:=ddlist2 . fivesec . "|"
ddlist5:=ddlist5 . fivesec . "|"
}

Loop 100
{
two:=two+2
ddlist3:=ddlist3 . two . "|"
}

Loop 15
{
ddlist4:=ddlist4 . A_index . "|"
}
;==========================================================

Gui, add, checkbox, x10 vRegister
Gui, add, text, yp xp+30, Auto-register
Gui, add, text, x10, Close lobbies with Ctrl+E!
Gui, add, text, yp+20 x10, Register every (sec):
Gui, add, dropdownlist, w50 yp-5 xp+140  vInterval1, %ddlist2%
Gui, add, text,x10, No of SNG:s to keep open:
Gui, add, dropdownlist, w50 yp-5 xp+140 vKeepOpen , %ddlist% 
Gui, add, text,x10, Limit total SNG:s to:
Gui, add, dropdownlist, w50 yp-5 xp+140 vTotalLimit , %ddlist3% 
Gui, add, text,x10, Limit total time to (min):
Gui, add, dropdownlist, w50 yp-5 xp+140 vTimeLimit , %ddlist5% 
Gui, add, text,x10, Disable if no user input (min):
Gui, add, dropdownlist, w50 yp-5 xp+140 vGuardtimer Choose1 , %ddlist4% 
Gui, add, text, x10 cred vcdown w200 
Gui, add, text, x10 w200 vRegSofar, SNG:s registered so far:   
Gui, add, text, x10 w200 vOpenTables, Tables currently open:
Gui, add, button, w68 gGetgui, &Submit+Run
Gui, add, text, xp+72 yp+5, (Autosaves your settings) 
Gui, Add, Button, disabled x10 w56 h20 center, &Resume
Gui, Add, Button, disabled  w56 h20 yp xp+56 center, &Pause
gui, show, NA , Stars Filtered SNG Opener
WinGetPos, x, y, w, h, Stars Filtered SNG
x:=monright-w
y:=monbottom-h
Gosub, Getini
Gui, show, x%x% y%y%, SFSO 1.1 
return
;===============================================================

getgui:
Gui, submit, nohide
displayedTime=
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
}

WinGet, OpenTables, list, ahk_class PokerStarsTableFrameClass
if OpenTables is not number
OpenTables=0

GuiControl, , OpenTables, Tables currently open: %OpenTables%
GuiControl, , RegSofar, SNG:s registered so far: %RegSofar%
Gui, show, noactivate, Stars Filtered SNG Opener

if register=1
{
gosub, register
SetTimer, Register, %interval%
}
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


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
}


GuiClose:
Gui, submit
Gosub, MakeIni
ExitApp
return

^e::
SetTitleMatchMode, 2
GroupAdd, TLobbies, Lobby,,, PokerStars Lobby
GroupClose, TLobbies, A
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
SetTimer, countdown, off

Gui, submit, nohide
PausedTime:=remainingTime/60


  GuiControl, Disable, Pause
  GuiControl, Enable, Resume
  GuiControl, , Register, 0
  GuiControl, , cdown, Manually paused %displayedTime% 
SetTimer, Register, off
return

;=====================================================================
Register:

WinGet, OpenTables, list, ahk_class PokerStarsTableFrameClass
if OpenTables is not number
OpenTables=0
if (posOverlap=1)
{
SetTimer, Register, off
Sleep 30000
posOverlap=0
SetTimer Register, on
}
GuiControl, , OpenTables, Tables currently open: %OpenTables%
GuiControl, , RegSofar, SNG:s registered so far: %RegSofar%
Gui, show, noactivate, Stars Filtered SNG Opener

if (RegSofar >= TotalLimit)
{
Gosub, ButtonPause
GuiControl, , cdown, SNG Total limit reached
return
}
if (OpenTables >= TotalLimit)
{
Gosub, ButtonPause
GuiControl, , cdown, SNG Total limit reached
return
return
}
if (KeepOpen - OpenTables = 1)
{
posOverlap=1
}
if (OpenTables >= KeepOpen)
{
return
}
else
{
SettitleMatchmode, 2
  WinGet, LobbyID, id, PokerStars Lobby
  
  if !LobbyID
  {

  return
}
  RegSNGexec(LobbyID)
  }
return
MakeIni:
iniwrite, %Register%, SFSO.ini, Settings, Register
iniwrite, %Interval1%, SFSO.ini, Settings, Interval1
iniwrite, %KeepOpen%, SFSO.ini, Settings, KeepOpen
iniwrite, %TotalLimit%, SFSO.ini, Settings, TotalLimit
iniwrite, %GuardTimer%, SFSO.ini, Settings, GuardTimer
iniwrite, %TimeLimit%, SFSO.ini, Settings, TimeLimit
return

GetIni:
IfExist, SFSO.ini
{
IniRead, Register, SFSO.ini, Settings, Register
IniRead, Interval1, SFSO.ini, Settings, Interval1
IniRead, KeepOpen, SFSO.ini, Settings, KeepOpen
IniRead, TotalLimit, SFSO.ini, Settings, TotalLimit
IniRead, GuardTimer, SFSO.ini, Settings, GuardTimer, Off
IniRead, TimeLimit, SFSO.ini, Settings, TimeLimit, Off
GuiControl, , Register, %register%
StringReplace, ddlist2, ddlist2, %interval1%, %Interval1%|
GuiControl, , Interval1, |%ddlist2%
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


RegSNGexec(id) {
global RegSofar, Register
Loop 16
{

If Register=0
 break

    ControlGet, v, Visible, , PokerStarsButtonClass6, ahk_id%id%
  if (v = 0)
  ControlSend, PokerStarsListClass5, {NumpadDown}, ahk_id%id%
  Sleep 1000
  if (v = 1)
  break
  }
  
  if ( v = 1 ) {
    ControlClick, PokerStarsButtonClass6, 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
      ControlFocus, Button2, ahk_id%regid%
      Sleep, -1
      ControlSend, Button2, {SPACE}, ahk_id%regid% 
      RegSofar++ 
        GuiControl, , RegSofar, SNG:s registered so far: %RegSofar%
        gui, show, noactivate, Stars Filtered SNG Opener
    }
    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%
        

      }        
    }
  }
}

;=========================================================
~^!Q::
ExitApp
Everlong is offline   Reply With Quote
Old 06-26-2008, 08:45 AM   #8
kara
grinder
 
kara's Avatar
 
Join Date: Dec 2007
Location: software forum looking for new AHKs
Posts: 456
Re: AHK script:Stars Filtered SNG Opener

This is awesome...thank you! Is there any possible way to filter for just 18 mans, 45 mans, 180s, or does that all just fall under multi table? I would love to be able to use this to open sets of just 18s, etc.

Edited to say: Just used the search box in the filter and typed in 18 and my buy in and that narrowed it down to just the 18 mans. Great script...just tried it, worked perfectly!

Last edited by kara; 06-26-2008 at 09:00 AM.
kara is offline   Reply With Quote
Old 06-26-2008, 05:25 PM   #9
thunderbolt
adept
 
Join Date: Feb 2006
Posts: 1,037
Re: AHK script:Stars Filtered SNG Opener

Very nice work. I have a sng buddy who is going to love this.
thunderbolt is offline   Reply With Quote
Old 06-28-2008, 12:53 AM   #10
Simplicity8
veteran
 
Simplicity8's Avatar
 
Join Date: Apr 2008
Location: @Simplicity38
Posts: 2,485
Re: AHK script:Stars Filtered SNG Opener

Quote:
Originally Posted by Everlong View Post
Here's the latest version for testing (with caution) before I put it on Overcards

* Timer added for limiting session length instead of no of SNG (combination is possible)
* Added a 30 second pause of registration after registering for the last table
(for example at 5/6 tables it registers for a 6th sng then sleeps for 30 sec in order to avoid overlapping registration and extra unwanted tables). I have no idea if 30 secs is a good time. If you need to change it, edit :
if (posOverlap=1)
{
SetTimer, Register, off
Sleep 30000
posOverlap=0
SetTimer Register, on
}
about 2/3 down to someting other than 30000 mil

* Current status is displayed in red

(I am taking a break from this for a couple of days but please report and will look at it)

Code:
;
; AutoHotkey Version: 1.0.47.1
; Language:       English
; Platform:       Win9x/NT
; Author:         Everlong@2p2 Code assembled from misc sources, thanks to _dave_, chris228 
;
; Script Function: PokerStars SNG opener (for use with the tournament filter filtering a specific type of SNG/MTT-Sng)

#NoEnv 
SendMode Input
SetWorkingDir %A_ScriptDir%
;======================================================
#SingleInstance, Force
SetTitleMatchMode, 2
Settimer, register, off
SetTimer, safeguard, off
RegSofar=0
OpenTables=0
Sysget,mon, MonitorworkArea
fivesec=0
two=0
ddlist4=0ff|
ddlist5=0ff|
Loop 50
{
fivesec:=fivesec+5

ddlist:=ddlist . A_index . "|"
ddlist2:=ddlist2 . fivesec . "|"
ddlist5:=ddlist5 . fivesec . "|"
}

Loop 100
{
two:=two+2
ddlist3:=ddlist3 . two . "|"
}

Loop 15
{
ddlist4:=ddlist4 . A_index . "|"
}
;==========================================================

Gui, add, checkbox, x10 vRegister
Gui, add, text, yp xp+30, Auto-register
Gui, add, text, x10, Close lobbies with Ctrl+E!
Gui, add, text, yp+20 x10, Register every (sec):
Gui, add, dropdownlist, w50 yp-5 xp+140  vInterval1, %ddlist2%
Gui, add, text,x10, No of SNG:s to keep open:
Gui, add, dropdownlist, w50 yp-5 xp+140 vKeepOpen , %ddlist% 
Gui, add, text,x10, Limit total SNG:s to:
Gui, add, dropdownlist, w50 yp-5 xp+140 vTotalLimit , %ddlist3% 
Gui, add, text,x10, Limit total time to (min):
Gui, add, dropdownlist, w50 yp-5 xp+140 vTimeLimit , %ddlist5% 
Gui, add, text,x10, Disable if no user input (min):
Gui, add, dropdownlist, w50 yp-5 xp+140 vGuardtimer Choose1 , %ddlist4% 
Gui, add, text, x10 cred vcdown w200 
Gui, add, text, x10 w200 vRegSofar, SNG:s registered so far:   
Gui, add, text, x10 w200 vOpenTables, Tables currently open:
Gui, add, button, w68 gGetgui, &Submit+Run
Gui, add, text, xp+72 yp+5, (Autosaves your settings) 
Gui, Add, Button, disabled x10 w56 h20 center, &Resume
Gui, Add, Button, disabled  w56 h20 yp xp+56 center, &Pause
gui, show, NA , Stars Filtered SNG Opener
WinGetPos, x, y, w, h, Stars Filtered SNG
x:=monright-w
y:=monbottom-h
Gosub, Getini
Gui, show, x%x% y%y%, SFSO 1.1 
return
;===============================================================

getgui:
Gui, submit, nohide
displayedTime=
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
}

WinGet, OpenTables, list, ahk_class PokerStarsTableFrameClass
if OpenTables is not number
OpenTables=0

GuiControl, , OpenTables, Tables currently open: %OpenTables%
GuiControl, , RegSofar, SNG:s registered so far: %RegSofar%
Gui, show, noactivate, Stars Filtered SNG Opener

if register=1
{
gosub, register
SetTimer, Register, %interval%
}
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


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
}


GuiClose:
Gui, submit
Gosub, MakeIni
ExitApp
return

^e::
SetTitleMatchMode, 2
GroupAdd, TLobbies, Lobby,,, PokerStars Lobby
GroupClose, TLobbies, A
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
SetTimer, countdown, off

Gui, submit, nohide
PausedTime:=remainingTime/60


  GuiControl, Disable, Pause
  GuiControl, Enable, Resume
  GuiControl, , Register, 0
  GuiControl, , cdown, Manually paused %displayedTime% 
SetTimer, Register, off
return

;=====================================================================
Register:

WinGet, OpenTables, list, ahk_class PokerStarsTableFrameClass
if OpenTables is not number
OpenTables=0
if (posOverlap=1)
{
SetTimer, Register, off
Sleep 30000
posOverlap=0
SetTimer Register, on
}
GuiControl, , OpenTables, Tables currently open: %OpenTables%
GuiControl, , RegSofar, SNG:s registered so far: %RegSofar%
Gui, show, noactivate, Stars Filtered SNG Opener

if (RegSofar >= TotalLimit)
{
Gosub, ButtonPause
GuiControl, , cdown, SNG Total limit reached
return
}
if (OpenTables >= TotalLimit)
{
Gosub, ButtonPause
GuiControl, , cdown, SNG Total limit reached
return
return
}
if (KeepOpen - OpenTables = 1)
{
posOverlap=1
}
if (OpenTables >= KeepOpen)
{
return
}
else
{
SettitleMatchmode, 2
  WinGet, LobbyID, id, PokerStars Lobby
  
  if !LobbyID
  {

  return
}
  RegSNGexec(LobbyID)
  }
return
MakeIni:
iniwrite, %Register%, SFSO.ini, Settings, Register
iniwrite, %Interval1%, SFSO.ini, Settings, Interval1
iniwrite, %KeepOpen%, SFSO.ini, Settings, KeepOpen
iniwrite, %TotalLimit%, SFSO.ini, Settings, TotalLimit
iniwrite, %GuardTimer%, SFSO.ini, Settings, GuardTimer
iniwrite, %TimeLimit%, SFSO.ini, Settings, TimeLimit
return

GetIni:
IfExist, SFSO.ini
{
IniRead, Register, SFSO.ini, Settings, Register
IniRead, Interval1, SFSO.ini, Settings, Interval1
IniRead, KeepOpen, SFSO.ini, Settings, KeepOpen
IniRead, TotalLimit, SFSO.ini, Settings, TotalLimit
IniRead, GuardTimer, SFSO.ini, Settings, GuardTimer, Off
IniRead, TimeLimit, SFSO.ini, Settings, TimeLimit, Off
GuiControl, , Register, %register%
StringReplace, ddlist2, ddlist2, %interval1%, %Interval1%|
GuiControl, , Interval1, |%ddlist2%
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


RegSNGexec(id) {
global RegSofar, Register
Loop 16
{

If Register=0
 break

    ControlGet, v, Visible, , PokerStarsButtonClass6, ahk_id%id%
  if (v = 0)
  ControlSend, PokerStarsListClass5, {NumpadDown}, ahk_id%id%
  Sleep 1000
  if (v = 1)
  break
  }
  
  if ( v = 1 ) {
    ControlClick, PokerStarsButtonClass6, 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
      ControlFocus, Button2, ahk_id%regid%
      Sleep, -1
      ControlSend, Button2, {SPACE}, ahk_id%regid% 
      RegSofar++ 
        GuiControl, , RegSofar, SNG:s registered so far: %RegSofar%
        gui, show, noactivate, Stars Filtered SNG Opener
    }
    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%
        

      }        
    }
  }
}

;=========================================================
~^!Q::
ExitApp
I'm not seeing a difference, I put the 30 seconds to 300 seconds (5 minutes, 300000 in your code) and it still keeps registering for more.
Simplicity8 is offline   Reply With Quote
Old 06-28-2008, 10:00 AM   #11
Everlong
veteran
 
Everlong's Avatar
 
Join Date: Aug 2005
Location: let it snow
Posts: 3,064
Re: AHK script:Stars Filtered SNG Opener

Does
Sleep, 30000

work better
Everlong is offline   Reply With Quote
Old 06-28-2008, 04:45 PM   #12
Simplicity8
veteran
 
Simplicity8's Avatar
 
Join Date: Apr 2008
Location: @Simplicity38
Posts: 2,485
Re: AHK script:Stars Filtered SNG Opener

Quote:
Originally Posted by Everlong View Post
Does
Sleep, 30000

work better
Quote:
Register every (sec): 10
No of SNG:s to keep open: 15
Limit total SNG:s to: 200
Limit total time to (min): 250
Disable if no user input (min): Off

SNG:s registered so far: 18
Tables currently open: 2
It still registering past 15 tables, didn't see it pause either.
Simplicity8 is offline   Reply With Quote
Old 07-02-2008, 07:56 AM   #13
jmflu
journeyman
 
Join Date: May 2007
Posts: 290
Re: AHK script:Stars Filtered SNG Opener

A semi workaround for this I am pretty sure would be to first pick your table amount you want to play and set it at

''No of SNGs to keep open'' and ''Limit Total SNGs to open'' the same to your desired number. This will cause it to only register in that many and stop.

Now wait until all tables are all up and running on your screen then right click the script in the corner and reload it and change the total to your desired total or use the timer from there and then you can change the time limit that it sleeps to fit your limits/avg register time. Because the problem with it is only a problem if you are starting from 0 tables and wanting it to stop at a semi-high amount because the script doesn't know you are 'in' it unless the table is up hence the sleep function added but the problem is when you start at 0 sngs and register in 20 sngs straight it is going to take a while for them to actually open so this method cuts out the problem part of getting them open because once the desired amount is open it works pretty much how it should.

Hopefully this can get fixed and maybe someone can get some sort of auto close table feature going but for now does this work for you? I haven't actually tried it yet as I am on my laptop but in my head I dont see why it wouldnt.
jmflu is offline   Reply With Quote
Old 07-02-2008, 11:06 AM   #14
jmflu
journeyman
 
Join Date: May 2007
Posts: 290
Re: AHK script:Stars Filtered SNG Opener

hmmm well I just tried what I suggested and it didnt work (kept regging) although it may be because I am reloading the script and pausing it after it registers for the last one and resuming after they open might work ill try that later.
jmflu is offline   Reply With Quote
Old 07-03-2008, 03:09 AM   #15
Simplicity8
veteran
 
Simplicity8's Avatar
 
Join Date: Apr 2008
Location: @Simplicity38
Posts: 2,485
Re: AHK script:Stars Filtered SNG Opener

Quote:
Originally Posted by jmflu View Post
A semi workaround for this I am pretty sure would be to first pick your table amount you want to play and set it at

''No of SNGs to keep open'' and ''Limit Total SNGs to open'' the same to your desired number. This will cause it to only register in that many and stop.

Now wait until all tables are all up and running on your screen then right click the script in the corner and reload it and change the total to your desired total or use the timer from there and then you can change the time limit that it sleeps to fit your limits/avg register time. Because the problem with it is only a problem if you are starting from 0 tables and wanting it to stop at a semi-high amount because the script doesn't know you are 'in' it unless the table is up hence the sleep function added but the problem is when you start at 0 sngs and register in 20 sngs straight it is going to take a while for them to actually open so this method cuts out the problem part of getting them open because once the desired amount is open it works pretty much how it should.

Hopefully this can get fixed and maybe someone can get some sort of auto close table feature going but for now does this work for you? I haven't actually tried it yet as I am on my laptop but in my head I dont see why it wouldnt.
This is what I did, but it ended up not registering when I closed a table. It still read as my desired amount of tables to be up at once (let's say 24) and when I closed a table to get down to 23 it still read me as playing 24 tables.
Simplicity8 is offline   Reply With Quote
Old 07-03-2008, 10:13 AM   #16
jmflu
journeyman
 
Join Date: May 2007
Posts: 290
Re: AHK script:Stars Filtered SNG Opener

^^^

Yea you are right it won't recognize the amount of tables open when I try to resume it once one busts. Couldn't get it to work.
jmflu is offline   Reply With Quote
Old 07-03-2008, 03:54 PM   #17
RandomRange
journeyman
 
RandomRange's Avatar
 
Join Date: Apr 2008
Location: Finland
Posts: 388
Re: AHK script:Stars Filtered SNG Opener

I think one way to solve this would be to keep an array of the tourney id's that have been registered, but not yet opened. Then comapre the limit to keep open to the sum of open tables and the count of the array. Of course once the table opens, the id should be removed from the array.
RandomRange is offline   Reply With Quote
Old 07-06-2008, 09:37 PM   #18
Finnisher
veteran
 
Finnisher's Avatar
 
Join Date: Oct 2006
Location: Finland
Posts: 2,177
Re: AHK script:Stars Filtered SNG Opener

I did a thingy that counts the number of tourneys reged in by opening the window, puts all the text in the lines into a string and then counts the instances of "Hold" in the string with a loop. I have no idea how violent this is and I kinda stumbled into getting the text into the string too so not sure if it should work like this . Side effects are unknown too but I doubt there's much else than maybe some problems with clicking and moving the mouse. I'd appreciate if someone would clean it up, it's copy/paste from multiple sources, I'm not sure what's needed and so on. It probly sucks for a totally automated opener tho since it has to open the window.

But you could also make a primitive autocloser with this by crosschecking open table's tourney numbers with the tourney numbers in the string. Maybe make it run the bit once a minute or something, or everytime you get a popup but I think stars popups are all the same to ahk so that's not so great either.

Anyway here's the code. This works alone, I have it included in another script with some of the stuff removed. F3 to launch, it shows a tooltip for 4 seconds
Code:
#NoEnv
#Persistent
#SingleInstance force
#Include %a_scriptDir%
#Include Functions.ahk

F3:: ;__Reged in tourneys
WinActivate, Pokerstars Lobby
WinMenuSelectItem, PokerStars Lobby,, Requests, Registered In Tournaments
WinWait, Registered In Tournaments
WinActivate, Registered In Tournaments
ControlGet, Kount, List,, ListBox1
ControlClick, Cancel
b:=0
x:=0
Loop
{StringGetPos, a, Kount, Hold,, b
If %ErrorLevel%= 0
{x:=x + 1
 b:=a + 2
}
else break
}
#Persistent
ToolTip, %x%
SetTimer, RemoveToolTip, 4000
return
Finnisher is offline   Reply With Quote
Old 07-07-2008, 11:48 AM   #19
jmflu
journeyman
 
Join Date: May 2007
Posts: 290
Re: AHK script:Stars Filtered SNG Opener

any chance of an update on this?
jmflu is offline   Reply With Quote
Old 07-09-2008, 02:27 AM   #20
BicVicTheQuick
grinder
 
BicVicTheQuick's Avatar
 
Join Date: Aug 2007
Location: living my life the best I can
Posts: 590
Re: AHK script:Stars Filtered SNG Opener

Quote:
Originally Posted by jmflu View Post
any chance of an update on this?
+1
BicVicTheQuick is offline   Reply With Quote
Old 07-09-2008, 04:41 AM   #21
Everlong
veteran
 
Everlong's Avatar
 
Join Date: Aug 2005
Location: let it snow
Posts: 3,064
Re: AHK script:Stars Filtered SNG Opener

on my cellphone from a ****ty rainy vacation. will fix next week when back home fo sho.
Everlong is offline   Reply With Quote
Old 07-09-2008, 10:52 PM   #22
NWCougar
grinder
 
NWCougar's Avatar
 
Join Date: Jun 2005
Location: Seattle, WA
Posts: 465
Re: AHK script:Stars Filtered SNG Opener

It's not registering for any SnG's for me
NWCougar is offline   Reply With Quote
Old 07-10-2008, 12:46 AM   #23
RandomRange
journeyman
 
RandomRange's Avatar
 
Join Date: Apr 2008
Location: Finland
Posts: 388
Re: AHK script:Stars Filtered SNG Opener

Yeah. After the latest update to stars client, it just goes down the list of tourneys.
RandomRange is offline   Reply With Quote
Old 07-10-2008, 01:35 AM   #24
jmflu
journeyman
 
Join Date: May 2007
Posts: 290
Re: AHK script:Stars Filtered SNG Opener

Quote:
Originally Posted by Everlong View Post
on my cellphone from a ****ty rainy vacation. will fix next week when back home fo sho.
you didnt expect him to fix it from his cell phone did you?
jmflu is offline   Reply With Quote
Old 07-11-2008, 04:55 AM   #25
jmflu
journeyman
 
Join Date: May 2007
Posts: 290
Re: AHK script:Stars Filtered SNG Opener

hey guys I fixed it to work on the new update (just the registering part def not any of the other issues) I just followed someones advice in a dif ahk thread about changing the window class from 6 to 7 under the register part of the script so you can just change it yourself if you want or here it is with the small changes

Code:
;
; AutoHotkey Version: 1.0.47.1
; Language:       English
; Platform:       Win9x/NT
; Author:         Everlong@2p2 Code assembled from misc sources, thanks to _dave_, chris228 
;
; Script Function: PokerStars SNG opener (for use with the tournament filter filtering a specific type of SNG/MTT-Sng)

#NoEnv 
SendMode Input
SetWorkingDir %A_ScriptDir%
;======================================================
#SingleInstance, Force
SetTitleMatchMode, 2
Settimer, register, off
SetTimer, safeguard, off
RegSofar=0
OpenTables=0
Sysget,mon, MonitorworkArea
fivesec=0
two=0
ddlist4=0ff|
ddlist5=0ff|
Loop 50
{
fivesec:=fivesec+5

ddlist:=ddlist . A_index . "|"
ddlist2:=ddlist2 . fivesec . "|"
ddlist5:=ddlist5 . fivesec . "|"
}

Loop 100
{
two:=two+2
ddlist3:=ddlist3 . two . "|"
}

Loop 15
{
ddlist4:=ddlist4 . A_index . "|"
}
;==========================================================

Gui, add, checkbox, x10 vRegister
Gui, add, text, yp xp+30, Auto-register
Gui, add, text, x10, Close lobbies with Ctrl+E!
Gui, add, text, yp+20 x10, Register every (sec):
Gui, add, dropdownlist, w50 yp-5 xp+140  vInterval1, %ddlist2%
Gui, add, text,x10, No of SNG:s to keep open:
Gui, add, dropdownlist, w50 yp-5 xp+140 vKeepOpen , %ddlist% 
Gui, add, text,x10, Limit total SNG:s to:
Gui, add, dropdownlist, w50 yp-5 xp+140 vTotalLimit , %ddlist3% 
Gui, add, text,x10, Limit total time to (min):
Gui, add, dropdownlist, w50 yp-5 xp+140 vTimeLimit , %ddlist5% 
Gui, add, text,x10, Disable if no user input (min):
Gui, add, dropdownlist, w50 yp-5 xp+140 vGuardtimer Choose1 , %ddlist4% 
Gui, add, text, x10 cred vcdown w200 
Gui, add, text, x10 w200 vRegSofar, SNG:s registered so far:   
Gui, add, text, x10 w200 vOpenTables, Tables currently open:
Gui, add, button, w68 gGetgui, &Submit+Run
Gui, add, text, xp+72 yp+5, (Autosaves your settings) 
Gui, Add, Button, disabled x10 w56 h20 center, &Resume
Gui, Add, Button, disabled  w56 h20 yp xp+56 center, &Pause
gui, show, NA , Stars Filtered SNG Opener
WinGetPos, x, y, w, h, Stars Filtered SNG
x:=monright-w
y:=monbottom-h
Gosub, Getini
Gui, show, x%x% y%y%, SFSO 1.1 
return
;===============================================================

getgui:
Gui, submit, nohide
displayedTime=
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
}

WinGet, OpenTables, list, ahk_class PokerStarsTableFrameClass
if OpenTables is not number
OpenTables=0

GuiControl, , OpenTables, Tables currently open: %OpenTables%
GuiControl, , RegSofar, SNG:s registered so far: %RegSofar%
Gui, show, noactivate, Stars Filtered SNG Opener

if register=1
{
gosub, register
SetTimer, Register, %interval%
}
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


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
}


GuiClose:
Gui, submit
Gosub, MakeIni
ExitApp
return

^e::
SetTitleMatchMode, 2
GroupAdd, TLobbies, Lobby,,, PokerStars Lobby
GroupClose, TLobbies, A
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
SetTimer, countdown, off

Gui, submit, nohide
PausedTime:=remainingTime/60


  GuiControl, Disable, Pause
  GuiControl, Enable, Resume
  GuiControl, , Register, 0
  GuiControl, , cdown, Manually paused %displayedTime% 
SetTimer, Register, off
return

;=====================================================================
Register:

WinGet, OpenTables, list, ahk_class PokerStarsTableFrameClass
if OpenTables is not number
OpenTables=0
if (posOverlap=1)
{
SetTimer, Register, off
Sleep 30000
posOverlap=0
SetTimer Register, on
}
GuiControl, , OpenTables, Tables currently open: %OpenTables%
GuiControl, , RegSofar, SNG:s registered so far: %RegSofar%
Gui, show, noactivate, Stars Filtered SNG Opener

if (RegSofar >= TotalLimit)
{
Gosub, ButtonPause
GuiControl, , cdown, SNG Total limit reached
return
}
if (OpenTables >= TotalLimit)
{
Gosub, ButtonPause
GuiControl, , cdown, SNG Total limit reached
return
return
}
if (KeepOpen - OpenTables = 1)
{
posOverlap=1
}
if (OpenTables >= KeepOpen)
{
return
}
else
{
SettitleMatchmode, 2
  WinGet, LobbyID, id, PokerStars Lobby
  
  if !LobbyID
  {

  return
}
  RegSNGexec(LobbyID)
  }
return
MakeIni:
iniwrite, %Register%, SFSO.ini, Settings, Register
iniwrite, %Interval1%, SFSO.ini, Settings, Interval1
iniwrite, %KeepOpen%, SFSO.ini, Settings, KeepOpen
iniwrite, %TotalLimit%, SFSO.ini, Settings, TotalLimit
iniwrite, %GuardTimer%, SFSO.ini, Settings, GuardTimer
iniwrite, %TimeLimit%, SFSO.ini, Settings, TimeLimit
return

GetIni:
IfExist, SFSO.ini
{
IniRead, Register, SFSO.ini, Settings, Register
IniRead, Interval1, SFSO.ini, Settings, Interval1
IniRead, KeepOpen, SFSO.ini, Settings, KeepOpen
IniRead, TotalLimit, SFSO.ini, Settings, TotalLimit
IniRead, GuardTimer, SFSO.ini, Settings, GuardTimer, Off
IniRead, TimeLimit, SFSO.ini, Settings, TimeLimit, Off
GuiControl, , Register, %register%
StringReplace, ddlist2, ddlist2, %interval1%, %Interval1%|
GuiControl, , Interval1, |%ddlist2%
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


RegSNGexec(id) {
global RegSofar, Register
Loop 16
{

If Register=0
 break

    ControlGet, v, Visible, , PokerStarsButtonClass7, ahk_id%id%
  if (v = 0)
  ControlSend, PokerStarsListClass5, {NumpadDown}, ahk_id%id%
  Sleep 1000
  if (v = 1)
  break
  }
  
  if ( v = 1 ) {
    ControlClick, PokerStarsButtonClass7, 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
      ControlFocus, Button2, ahk_id%regid%
      Sleep, -1
      ControlSend, Button2, {SPACE}, ahk_id%regid% 
      RegSofar++ 
        GuiControl, , RegSofar, SNG:s registered so far: %RegSofar%
        gui, show, noactivate, Stars Filtered SNG Opener
    }
    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%
        

      }        
    }
  }
}

;=========================================================
~^!Q::
ExitApp
jmflu is offline   Reply With Quote

Reply
      

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Forum Jump


All times are GMT -4. The time now is 09:53 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright ę 2008-2010, Two Plus Two Interactive
 
Poker Players - Streaming Live Online