Open Side Menu Go to the Top
Register
New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars

12-26-2012 , 12:01 AM
I tried everything but it still doesn't work. I have black theme and I reset table size to default. Have Windows 7.

My script:

Code:
#NoEnv
#Persistent
SetBatchLines -1


CheckTime := 500   ; Check every n MilliSeconds
sitin_x := 679
sitin_y := 485

timebank_x := 442
timebank_y := 459

_FILE := "C:\Users\MyName\AppData\Local\PokerStars.EU\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_0x000A-T\s\w{8}\s(\w{8})\s", m))
    {
      ;msgbox, %m1%
      PostStarsClick(sitin_x, sitin_y, ("0x" . m1))
      
    }
    else if (regExMatch(a_loopfield, "MSG_0x0023-T\s\w{8}\s(\w{8})", 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)
}
I got coordinates by using windows spy (substracted 8 from x and 30 from y). A picture where mouse cursor was in the middle of the time bank box:




If i uncomment all 4 msgbox lines it starts to pop up windows but script never pushed any button.

Oh, I also tried with Nova theme and got the same coordinates as OditeRussia but it didn't work.

Any suggestions?

Last edited by gaan64; 12-26-2012 at 12:22 AM.
New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars Quote
01-10-2013 , 12:51 PM
You PM'ed me the other day about your message boxes showing Chinese or cryptical symbols. If that's still the case, note the 2 posts above yours.

Also what you could try is, rightclick the .ahk file -> compile the script and run the resulting .exe as admin. Other than that I'm clueless, sry.
New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars Quote
01-10-2013 , 10:18 PM
Quote:
Originally Posted by _dave_
yeah why 1.1.x is the primary download at this point I have no idea, many of my scripts are completely non-functional in it. 1.0.48.05 (basic) was on the main download page for the past year or so, it still should be imo.
This script would be super easy to fix for 1.1.x

do this
Code:
_FILE := FileOpen(".../PokerStars.log.0", "r")
and replace that monstrous CheckFile() with
Code:
CheckFile( File )
{
   while( !File.AtEOF )
      tail .= File.ReadLine()
   return tail
}
and when you exit the script
Code:
_FILE.Close()

I personally love the new 1.1.x. Proper arrays at last and all those objects and classes

And I'm pretty sure most of the old scripts will work if you just install the ANSI build instead of Unicode.

Last edited by Weegs; 01-10-2013 at 10:24 PM.
New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars Quote
01-10-2013 , 10:42 PM
Quote:
Originally Posted by Weegs
And I'm pretty sure most of the old scripts will work if you just install the ANSI build instead of Unicode.
yeah this

altough i havent upgraded to 1.1 yet
New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars Quote
01-16-2013 , 09:51 AM
Hey. Could anyone tell me what exacly I need to do with this script? I dont have any idea about coding and all that but should be able to follow instruction. Would be great if someone help
New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars Quote
01-20-2013 , 06:33 PM
Quote:
Originally Posted by Distrat
Hey. Could anyone tell me what exacly I need to do with this script? I dont have any idea about coding and all that but should be able to follow instruction. Would be great if someone help
bump. i´m curious aswell
New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars Quote
01-21-2013 , 12:05 PM
General:
- download and install autohotkey 1.0.48.05 (basic)
- create a folder to put your scripts in
- create an .ahk file in said folder (rightclick -> new ahk file)
- open/edit the file with text editor (notepad++ is awesome)
- replace its content with code

For this script especially:
- make sure the following line guides to PokerStars.log.0:
Code:
_FILE := "C:\Users\MyName\AppData\Local\PokerStars.EU\PokerStars.log.0"
- open a table and reset it to default size
- grab the "in active window" coords of timebank and sit back buttons using WindowSpy (came with autohotkey) and put them there:
Code:
sitin_x := 679
sitin_y := 485

timebank_x := 442
timebank_y := 459
- edit to add:
Quote:
you have to substract something like 8px from x (less important) and 30px from y (important!) due to Win7 borders and caption. (The reference width/height is based on client area only, without window borders and title.)
That's it, now just save the file as TimeOutHelper.ahk and doubleclick to run it. You can now change table sizes back to your likes. Test the script on playmoney tables first. Note that TimeOutHelper doesn't sit you back if you sat out on purpose. Also, Stars will auto activate the timebank itself in case you already put money into the pot (eg. you posted a blind).

Last edited by Baobhan-Sith; 01-21-2013 at 12:29 PM.
New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars Quote
01-24-2013 , 02:49 PM
that's my code for Nova theme. 100% works.
Code:
#NoEnv
#Persistent
SetBatchLines -1


CheckTime := 800   ; Check every n MilliSeconds
sitin_x := 729
sitin_y := 400

timebank_x := 615
timebank_y := 445

If A_OSVersion in WIN_VISTA
{
_FILE := "c:\Users\*Name*\AppData\Local\PokerStars\PokerStars.log.0"
IfNotExist %_FILE%
stringreplace,_FILE,_FILE,Roaming,Local
IfNotExist %_FILE%
_FILE := A_ProgramFiles . "\PokerStars\PokerStars.log.0"
IfNotExist %_FILE%
{
 msgbox, PokerStars.log.0 file was not found
 return
}
}
else
{
_FILE := A_ProgramFiles . "\PokerStars\PokerStars.log.0"
IfNotExist %_FILE%
{
 msgbox, PokerStars.log.0 file was not found
 return
}
}
;_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_0x000A-T\s\w{8}\s(\w{8})\s", m))
    {
      ;msgbox, %m1%
      PostStarsClick(sitin_x, sitin_y, ("0x" . m1))
      
    }
    else if (regExMatch(a_loopfield, "MSG_0x0023-T\s\w{8}\s(\w{8})", 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)
}
New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars Quote
03-12-2013 , 08:38 AM
I ran this script and and received an error message: ´PokerStars.log.0 was not found´. Aparently, this file is removed foram the aplication in the recent versions. Did anyone found a solution?
New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars Quote
03-12-2013 , 11:57 AM
Surely it hasn't been removed completely, did you search for the file? It probably just went to a different location, or you forgot to edit the red part here:

Code:
_FILE := "c:\Users\*Name*\AppData\Local\PokerStars\PokerStars.log.0"
New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars Quote
03-13-2013 , 01:48 AM
Thx, Baobhan-Sith. I changed the code and no more the file not found message. But the program still doesn,t work. I debuged a little and found out that those 2 conditions :
regExMatch(a_loopfield, "MSG_0x000A-T\s\w{8}\s(\w{8})\s", m)
regExMatch(a_loopfield, "MSG_0x0023-T\s\w{8}\s(\w{8})", m)
never go TRUE. So the program never click because cant detect the time bar and the ì´m Back´ button. Any idea how can i fix it ?
New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars Quote
03-30-2013 , 05:49 PM
it´s working the timebank for FTP ? i remember to use it but at some point it finish to work, with the relaunch of FTP i tried again but nothing, it´s possible to fix it in order to work with FTP ?

tks
regards
New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars Quote
03-30-2013 , 07:02 PM
Well, i gave up of making it work. I bought tableninja and it does work as i want. So i saved some time in programming (and spent some money). Thx everyone.
New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars Quote
04-04-2013 , 01:16 PM
I have a question regarding taking the coordinates with the window spy, do I just move my mouse dead center to the buttons and take the numbers IN ACTIVE WINDOW: " x, x". The "I'm Back" button and "timebank" is quite large.

I tried the numbers of active window and the script didn't work. I had changed everything to default and used the Nova Script with Nova from post #158.

I also changed the user name as indicated.
New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars Quote
04-04-2013 , 07:32 PM
any help about how may work in FTP cash tables ???

many tks
New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars Quote
04-05-2013 , 02:11 PM
Have you tried FTPCash Skywalker? I'm pretty sure that use to work. I was using that before I got TimebankButler. Also Keypoker Time bank works for FTP. I think the sit out buttons are broken for those though.
New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars Quote
04-05-2013 , 04:33 PM
many tks mr_tea, i will try it!
New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars Quote
04-10-2013 , 01:53 PM
Quote:
Originally Posted by egorriCh
that's my code for Nova theme. 100% works.
Code:
#NoEnv
#Persistent
SetBatchLines -1


CheckTime := 800   ; Check every n MilliSeconds
sitin_x := 729
sitin_y := 400

timebank_x := 615
timebank_y := 445

If A_OSVersion in WIN_VISTA
{
_FILE := "c:\Users\*Name*\AppData\Local\PokerStars\PokerStars.log.0"
IfNotExist %_FILE%
stringreplace,_FILE,_FILE,Roaming,Local
IfNotExist %_FILE%
_FILE := A_ProgramFiles . "\PokerStars\PokerStars.log.0"
IfNotExist %_FILE%
{
 msgbox, PokerStars.log.0 file was not found
 return
}
}
else
{
_FILE := A_ProgramFiles . "\PokerStars\PokerStars.log.0"
IfNotExist %_FILE%
{
 msgbox, PokerStars.log.0 file was not found
 return
}
}
;_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_0x000A-T\s\w{8}\s(\w{8})\s", m))
    {
      ;msgbox, %m1%
      PostStarsClick(sitin_x, sitin_y, ("0x" . m1))
      
    }
    else if (regExMatch(a_loopfield, "MSG_0x0023-T\s\w{8}\s(\w{8})", 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)
}
instead of *Name* type your username. this code is 100% working on Win 7 64bit.
New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars Quote
04-19-2013 , 12:11 PM
^^ how do I do it if my windows user name has a space in it?


ie "jim bob"

it seems to not work when I type it with a space
New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars Quote
04-19-2013 , 12:58 PM
jmflu, should work fine with space, it is a log file - erasing won't hurt anything, you can always change PS handhistory folder location in the PS client settings.
New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars Quote
05-10-2013 , 11:16 PM
^^ PokerStars.log.0 file was not found

I have changed folder to Pokerstars.EU and still not working, any ideas?
New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars Quote
05-11-2013 , 10:22 AM
^ Maybe change the path to the folder actually containing the file?

Quote:
Originally Posted by Baobhan-Sith
Surely it hasn't been removed completely, did you search for the file? It probably just went to a different location, or you forgot to edit the red part here:

Code:
_FILE := "c:\Users\*Name*\AppData\Local\PokerStars\PokerStars.log.0"
In PokerStars, click Help -> Open My Settings Folder, or click the Windows Start button and then type "PokerStars.log.0" in the search box.

Last edited by Baobhan-Sith; 05-11-2013 at 10:30 AM.
New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars Quote
05-11-2013 , 03:05 PM
yeah, i checked like 20 times, i'm 100% sure it's the right location.
But i noticed there are a few more lines like
_FILE := A_ProgramFiles . "\PokerStars\PokerStars.log.0"
should i change this as well? (to PokerStars.EU i mean)
New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars Quote
05-11-2013 , 04:10 PM
cristi13, edit this line
Code:
;_FILE := "E:\sitout.txt"
New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars Quote
05-11-2013 , 07:46 PM
Quote:
Originally Posted by Max1mums
cristi13, edit this line
Code:
;_FILE := "E:\sitout.txt"
I don't understand, the line is there, change it to what?
sorry, i'm not very good at writing code.
New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars Quote

      
m