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 12-08-2010, 01:49 AM   #1
_dave_
_Pooh_Bah_
 
Join Date: Feb 2005
Location: UK (or what remains of it)
Posts: 11,494
New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars

I made this the other day since I dunno of a similarly working TimeOut Helper. Added Auto-Timebank since I may as well since it's a sensible way to do it.

It reads the ps log file so timebank works for PF All-Ins (UrgentTable does not). Also no pixel scanning so should work on any theme. x/y coordinates may need edited for themes other than Hyper Simple / Classic, not sure. Works for tournaments and cash games.

I've not tested on anything but my own machine so there may be problems, try at your own risk and so on.

You can test if it'll sit you back in by joining a cash table and "sit out next hand" (don't have to have posted a blind yet).

It seems not to sit you back in if you choose "sit out next big blind" which is handy

Code:
#NoEnv
#Persistent
SetBatchLines -1


CheckTime := 500   ; Check every n MilliSeconds
sitin_x := 532
sitin_y := 468

timebank_x := 520
timebank_y := 460

_FILE := A_ProgramFiles . "\PokerStars\PokerStars.log.0"
;_FILE := "E:\sitout.txt"
SysGet, border, 32
SysGet, caption, 4
SetTimer, FILE_CHECK, %CheckTime%
return


FILE_CHECK:
If (_NEWLINES := CheckFile(_FILE))
{
  ;msgbox, %_NEWLINES%
  Loop, Parse, _NEWLINES, `n
  {
    if(regExMatch(a_loopfield, "MSG_TABLE_SITTING_STATUS\s(\w{8})\s1", m))
    {
      ;msgbox, %m1%
      PostStarsClick(sitin_x, sitin_y, ("0x" . m1))
      
    }
    else if (regExMatch(a_loopfield, "MSG_TABLE_TIMEBANK\s(\w{8})\stime=", m))
    {
      ;msgbox, %m1%
      PostStarsClick(timebank_x, timebank_y, ("0x" . m1))
    }
  }
;msgbox, %m1%
   
}
Return


CheckFile(File) {
   ; THX Sean for File.ahk : http://www.autohotkey.com/forum/post-124759.html
   Static CF := ""   ; Current File
   Static FP := 0    ; File Pointer
   Static OPEN_EXISTING := 3
   Static GENERIC_READ := 0x80000000
   Static FILE_SHARE_READ := 1
   Static FILE_SHARE_WRITE := 2
   Static FILE_SHARE_DELETE := 4
   Static FILE_BEGIN := 0
   BatchLines := A_BatchLines
   SetBatchLines, -1
   If (File != CF) {
      CF := File
      FP := 0
   }
   hFile := DllCall("CreateFile"
                  , "Str",  File
                  , "Uint", GENERIC_READ
                  , "Uint", FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE
                  , "Uint", 0
                  , "Uint", OPEN_EXISTING
                  , "Uint", 0
                  , "Uint", 0)
   If (!hFile) {
      CF := ""
      FP := 0
      SetBatchLines, %BatchLines%
      Return False
   }
   DllCall("GetFileSizeEx"
         , "Uint",   hFile
         , "Int64P", nSize)
   If (FP = 0 Or nSize <= FP) {
      FP := nSize
      SetBatchLines, %BatchLines%
      DllCall("CloseHandle", "Uint", hFile) ; close file
     Return False
   }
   DllCall("SetFilePointerEx"
         , "Uint",  hFile
         , "Int64", FP
         , "Uint",  0
         , "Uint",  FILE_BEGIN)
   VarSetCapacity(Tail, Length := nSize - FP, 0)
   DllCall("ReadFile"
         , "Uint",  hFile
         , "Str",   Tail
         , "Uint",  Length
         , "UintP", Length
         , "Uint",  0)
   DllCall("CloseHandle", "Uint", hFile)
   VarSetCapacity(Tail, -1)
   FP := nSize
   SetBatchLines, %BatchLines%
   Return Tail
}

relStarsClientPoint(id, ByRef x, ByRef y)
{
  global border
  global caption
  rw := 792
  rh := 546
  WinGetPos, , , w, h, ahk_id%id%
  w := w - (2*border)
  h := h - (2*border) - caption
  
  x := Floor( (x / rw ) * w )
  y := Floor( (y / rh) * h  )
  
}

;Juks rocks
PostLeftClick(x, y, table_id, activate=0) {
; ### JUK: Send the down left click, then the mouse-up messages.
; NOTE: This is relative to the top left of the client area and NOT the top left of the
;       window (ie: It *doesn't* include the title-bar like AHK's MouseClick does!!!).
If activate
 WinActivate, ahk_id%table_id%
PostMessage, 0x201, 0x0001, ((y<<16)^x), , ahk_id%table_id%
PostMessage, 0x202 , 0, ((y<<16)^x), , ahk_id%table_id%
}

PostStarsClick(x, y, id)
{
  relStarsClientPoint(id, x, y)
  PostLeftClick(x, y, id)
}
_dave_ is offline   Reply With Quote
Old 12-08-2010, 12:58 PM   #2
gruey1
newbie
 
Join Date: Jul 2007
Location: Exeter
Posts: 42
Re: New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars

This is great thanks
gruey1 is offline   Reply With Quote
Old 12-08-2010, 09:33 PM   #3
elcacheman
newbie
 
Join Date: Oct 2008
Posts: 35
Re: New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars

Yeah very cool, wish WA players could still play on stars
elcacheman is offline   Reply With Quote
Old 12-09-2010, 04:47 PM   #4
Baobhan-Sith
Pooh-Bah
 
Baobhan-Sith's Avatar
 
Join Date: Oct 2009
Posts: 4,259
Re: New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars

Wow that's awesome, tyvm! Been looking for a working auto timebank for so long...

Auto sitback works perfectly, but unfortunately auto timebank does not. I tried replacing the modded button with the original one, and I also made sure the timebank_x and _y are correct, as follows:

I added MouseMove timebank_x, timebank_y right before PostStarsClick to verify the coordinates I put in, and the mouse is moved exactly over the timebank button - but it doesn't click it. I also tried the timebank coordinates the script came with since sitback works well despite of its coordinates being way off (didn't change these).

I am using a slightly modded Slick Base theme, and my OS is WinXP. Please let me know what other information you need, if any, in order to get the issue fixed.

TIA

Last edited by Baobhan-Sith; 12-09-2010 at 04:53 PM.
Baobhan-Sith is offline   Reply With Quote
Old 12-09-2010, 05:58 PM   #5
_dave_
_Pooh_Bah_
 
Join Date: Feb 2005
Location: UK (or what remains of it)
Posts: 11,494
Re: New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars

I'll take a look at slick base later on tonight - I figure if the sitback looks off to you but works, you're maybe getting the coordinates from a wrongly sized table? (it needs to be dafault size)
_dave_ is offline   Reply With Quote
Old 12-09-2010, 06:13 PM   #6
Baobhan-Sith
Pooh-Bah
 
Baobhan-Sith's Avatar
 
Join Date: Oct 2009
Posts: 4,259
Re: New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars

Oh great, that did the trick, ty so much!
Baobhan-Sith is offline   Reply With Quote
Old 12-09-2010, 07:20 PM   #7
spellofmaya
grinder
 
spellofmaya's Avatar
 
Join Date: May 2006
Location: Friday nights are killing me
Posts: 500
Re: New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars

_dave_ could this be modified to close the table when sitting out rather than sitting back in?
spellofmaya is offline   Reply With Quote
Old 12-09-2010, 07:30 PM   #8
_dave_
_Pooh_Bah_
 
Join Date: Feb 2005
Location: UK (or what remains of it)
Posts: 11,494
Re: New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars

easily I would think dangerous tho!
_dave_ is offline   Reply With Quote
Old 12-09-2010, 09:11 PM   #9
spellofmaya
grinder
 
spellofmaya's Avatar
 
Join Date: May 2006
Location: Friday nights are killing me
Posts: 500
Re: New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars

How so? I usually play short sessions so the only time i sit out is to get on a new table or to end my session.
spellofmaya is offline   Reply With Quote
Old 12-09-2010, 09:19 PM   #10
_dave_
_Pooh_Bah_
 
Join Date: Feb 2005
Location: UK (or what remains of it)
Posts: 11,494
Re: New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars

Well it's not really dangerous if that's the behaviour you want and expect. just like for example you are sat in a game with great position a big fish spewing money your way, and there is a waitlist - timing out would be instant loss of seat rather than just folding a hand.

If you change the coordinates of sitin_x and sitin_y to somewhere top-right of the table (where it will hit the "leave table" button), that'll do the job.

It unfortunately won't work if you use the "sit out next Big Blind" option, for some reason that produces a different message in the log file I'd have to identify (for auto sit-in but still being able to cleanly exit a table, it's quite handy to not flag these sit-outs. but for your purposes I think not)
_dave_ is offline   Reply With Quote
Old 12-09-2010, 09:33 PM   #11
spellofmaya
grinder
 
spellofmaya's Avatar
 
Join Date: May 2006
Location: Friday nights are killing me
Posts: 500
Re: New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars

I generally use sit out next bb so I guess this wouldn't work anyways, Thanks tho.
spellofmaya is offline   Reply With Quote
Old 12-09-2010, 09:41 PM   #12
_dave_
_Pooh_Bah_
 
Join Date: Feb 2005
Location: UK (or what remains of it)
Posts: 11,494
Re: New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars

well not quite - all I'm saying there is changing the coordinates won't work - we need a different "trigger". I'll have a look later on and see if I can spot what message shows from "sitout next BB". I didn't look previously because I thought behaviour was reasonable as-is. If you want it to auto-close a table only after "sitout next BB", hopefully that is possible
_dave_ is offline   Reply With Quote
Old 12-10-2010, 12:24 AM   #13
_dave_
_Pooh_Bah_
 
Join Date: Feb 2005
Location: UK (or what remains of it)
Posts: 11,494
Re: New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars

Ugh doesn't look too likely - the Stars table seems to post MSG_TABLE_FORCE_SITOUT after sitout next BB, but this also gets posted for a timeout. Difference is for the next BB option it is posted without the MSG_TABLE_SITTING_STATUS a moment later, which is what I'm looking for.

If you don't care how the sitout occurs it's easy to make it auto-close tables, if you only want that to happen after a "sitout next BB" selection that'll take more thinking

ETA: actually it posts "sitOutNextBigBlindCheck set to 1" to the log file, it is possible to keep a list of windows with that option set and auto-close only them if need be.
_dave_ is offline   Reply With Quote
Old 12-10-2010, 12:26 PM   #14
Brian O'Nolan
Pooh-Bah
 
Join Date: Nov 2005
Location: Equal rights for Orcs!
Posts: 5,939
Re: New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars

Awesome. I haven't gotten it working yet- my log files/hand histories are stored in a totally different directory than c:\program files\pokerstars- could that be the problem?
Brian O'Nolan is offline   Reply With Quote
Old 12-10-2010, 03:36 PM   #15
_dave_
_Pooh_Bah_
 
Join Date: Feb 2005
Location: UK (or what remains of it)
Posts: 11,494
Re: New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars

The file PokerStars.log.0 is theonly one this script reads - if it isn't in Program Files (like you have PokerStars installed elsewhere, or maybe Win7 writes it elsewhere) line ~13 will need editing to the correct location.

Also if you uncomment (remove the ";") the first msgbox line, the script will alert you of any new lines in the log file, so simply starting pokerstars lobby will be enough to see if you have the right log file location.
_dave_ is offline   Reply With Quote
Old 12-10-2010, 05:47 PM   #16
Brian O'Nolan
Pooh-Bah
 
Join Date: Nov 2005
Location: Equal rights for Orcs!
Posts: 5,939
Re: New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars

Cool, got it working. Thanks _dave_
Brian O'Nolan is offline   Reply With Quote
Old 12-10-2010, 05:52 PM   #17
_dave_
_Pooh_Bah_
 
Join Date: Feb 2005
Location: UK (or what remains of it)
Posts: 11,494
Re: New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars

Awesome was it something particular to your setup or something that affects all newer Windows systems that I should code for?
_dave_ is offline   Reply With Quote
Old 12-10-2010, 08:34 PM   #18
Brian O'Nolan
Pooh-Bah
 
Join Date: Nov 2005
Location: Equal rights for Orcs!
Posts: 5,939
Re: New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars

I may have changed where the hh files etc are stored from the default location at some point for HEM compatibility... I vaguely remember doing something like that... but in any case my comp is a few years old and running Vista, so I couldn't really speak for newer systems.
Brian O'Nolan is offline   Reply With Quote
Old 12-11-2010, 04:34 AM   #19
Mikka
journeyman
 
Join Date: Nov 2006
Posts: 243
Re: New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars

Quote:
Originally Posted by _dave_ View Post
The file PokerStars.log.0 is theonly one this script reads - if it isn't in Program Files (like you have PokerStars installed elsewhere, or maybe Win7 writes it elsewhere) line ~13 will need editing to the correct location.

my log file is under users/myname/appdata/local/pokerstars

I dont know how to edit the line in the script to that location. Would really appreciate your help
Mikka is offline   Reply With Quote
Old 12-11-2010, 11:56 AM   #20
Brian O'Nolan
Pooh-Bah
 
Join Date: Nov 2005
Location: Equal rights for Orcs!
Posts: 5,939
Re: New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars

Quote:
Originally Posted by Mikka View Post
my log file is under users/myname/appdata/local/pokerstars

I dont know how to edit the line in the script to that location. Would really appreciate your help
Change this line:
Code:
_FILE := A_ProgramFiles . "\PokerStars\PokerStars.log.0"
to
Code:
_FILE := C . "\Users\Myname\AppData\Local\PokerStars\PokerStars.log.0"
(or whatever the appropriate path is, if the hard drive is D change the A to a D)

As _dave_ mentioned, you can uncomment the first msgbox line and that will tell you as soon as you open the lobby if the script is reading the log file by popping up some message boxes.
Brian O'Nolan is offline   Reply With Quote
Old 12-11-2010, 02:53 PM   #21
Mikka
journeyman
 
Join Date: Nov 2006
Posts: 243
Re: New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars

works perfect.. thanks a lot to both of you
Mikka is offline   Reply With Quote
Old 12-12-2010, 03:03 AM   #22
spellofmaya
grinder
 
spellofmaya's Avatar
 
Join Date: May 2006
Location: Friday nights are killing me
Posts: 500
Re: New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars

Quote:
Originally Posted by _dave_ View Post
Ugh doesn't look too likely - the Stars table seems to post MSG_TABLE_FORCE_SITOUT after sitout next BB, but this also gets posted for a timeout. Difference is for the next BB option it is posted without the MSG_TABLE_SITTING_STATUS a moment later, which is what I'm looking for.

If you don't care how the sitout occurs it's easy to make it auto-close tables, if you only want that to happen after a "sitout next BB" selection that'll take more thinking

ETA: actually it posts "sitOutNextBigBlindCheck set to 1" to the log file, it is possible to keep a list of windows with that option set and auto-close only them if need be.
For me it would be fine to auto close any table that i'm sitting out on, wouldn't necessarily have to be after next BB. Do you think it would be possible for you to make a version that does this? Would be very appreciated.
spellofmaya is offline   Reply With Quote
Old 01-21-2011, 02:17 PM   #23
JustAmazing777
adept
 
JustAmazing777's Avatar
 
Join Date: Dec 2009
Posts: 994
Re: New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars

Hey... the tool is working fine with me and Im like super excited because I finally have autotimebank clicking as TN wouldnt do this for me.
However could it be that your tool has some sort of a "never sit out" option running the whole time? could you tell me how to disable that?
JustAmazing777 is offline   Reply With Quote
Old 02-19-2011, 09:10 PM   #24
JoeShowdown
centurion
 
Join Date: Oct 2008
Posts: 106
Re: New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars

I used tableninja's free 30daytrial this year and it ran out so I'm looking for a timeouthelper. I went to autohotkey.com and downloaded it, copied dave's code from post 1, saved it to notepad, called it timeouthelper.ahk and have run into problems getting it to work. I have the green H icon in the system tray. I've clicked run as administrator and/or run script and it still doesn't work. I'm using a laptop with windows 7. I am clueless when it comes to computer codes. The only thing I really enjoyed of tableninja was the autoclicking the timebank. Can anyone help me out?
JoeShowdown is offline   Reply With Quote
Old 02-20-2011, 12:16 AM   #25
UrSoUnusual
centurion
 
UrSoUnusual's Avatar
 
Join Date: Mar 2010
Location: Learning what we call life
Posts: 105
Re: New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars

This is great! Thanks, _dave_.
UrSoUnusual 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 06:16 PM.


Powered by vBulletin®
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.
Search Engine Optimisation provided by DragonByte SEO v2.0.33 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Copyright ę 2008-2010, Two Plus Two Interactive
 
Poker Players - Streaming Live Online