Two Plus Two Publishing LLC Two Plus Two Publishing LLC
 

Go Back   Two Plus Two Poker Forums > Internet Poker > Software > Free Software

Notices

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

Reply
 
Thread Tools Display Modes
Old 12-25-2012, 11:01 PM   #151
newbie
 
Join Date: Jun 2012
Posts: 15
Re: New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars

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-25-2012 at 11:22 PM.
gaan64 is offline   Reply With Quote
Old 01-10-2013, 11:51 AM   #152
Pooh-Bah
 
Baobhan-Sith's Avatar
 
Join Date: Oct 2009
Location: ✮✮✮✮
Posts: 3,986
Re: New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars

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.
Baobhan-Sith is offline   Reply With Quote
Old 01-10-2013, 09:18 PM   #153
grinder
 
Join Date: Sep 2008
Posts: 570
Re: New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars

Quote:
Originally Posted by _dave_ View Post
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 09:24 PM.
Weegs is offline   Reply With Quote
Old 01-10-2013, 09:42 PM   #154
Carpal \'Tunnel
 
greg nice's Avatar
 
Join Date: Aug 2004
Location: "ban" in NVG = ban for you. AMHIK
Posts: 7,834
Re: New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars

Quote:
Originally Posted by Weegs View Post
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
greg nice is offline   Reply With Quote
Old 01-16-2013, 08:51 AM   #155
newbie
 
Join Date: Jan 2010
Posts: 17
Re: New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars

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
Distrat is offline   Reply With Quote
Old 01-20-2013, 05:33 PM   #156
old hand
 
LUVtehNL's Avatar
 
Join Date: Mar 2010
Location: bricking Rivers
Posts: 1,959
Re: New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars

Quote:
Originally Posted by Distrat View Post
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
LUVtehNL is online now   Reply With Quote
Old 01-21-2013, 11:05 AM   #157
Pooh-Bah
 
Baobhan-Sith's Avatar
 
Join Date: Oct 2009
Location: ✮✮✮✮
Posts: 3,986
Re: New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars

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 11:29 AM.
Baobhan-Sith is offline   Reply With Quote
Old 01-24-2013, 01:49 PM   #158
stranger
 
Join Date: Jan 2013
Posts: 2
Re: New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars

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)
}
egorriCh is offline   Reply With Quote
Old 03-12-2013, 08:38 AM   #159
stranger
 
Join Date: Oct 2011
Posts: 3
Re: New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars

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?
goldpoint is offline   Reply With Quote
Old 03-12-2013, 11:57 AM   #160
Pooh-Bah
 
Baobhan-Sith's Avatar
 
Join Date: Oct 2009
Location: ✮✮✮✮
Posts: 3,986
Re: New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars

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"
Baobhan-Sith is offline   Reply With Quote
Old 03-13-2013, 01:48 AM   #161
stranger
 
Join Date: Oct 2011
Posts: 3
Re: New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars

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 ?
goldpoint is offline   Reply With Quote
Old 03-30-2013, 05:49 PM   #162
enthusiast
 
Join Date: Jul 2007
Posts: 60
Re: New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars

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
skywalker1 is offline   Reply With Quote
Old 03-30-2013, 07:02 PM   #163
stranger
 
Join Date: Oct 2011
Posts: 3
Re: New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars

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.
goldpoint is offline   Reply With Quote
Old 04-04-2013, 01:16 PM   #164
journeyman
 
Join Date: May 2007
Posts: 280
Re: New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars

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.
mr_tea is offline   Reply With Quote
Old 04-04-2013, 07:32 PM   #165
enthusiast
 
Join Date: Jul 2007
Posts: 60
Re: New AHK: TimeOut Helper (Instant Sit Back In) and Auto Timebank for PokerStars

any help about how may work in FTP cash tables ???

many tks
skywalker1 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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -4. The time now is 11:21 PM.


Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.6.0 ©2011, Crawlability, Inc.
Copyright © 2008-2010, Two Plus Two Interactive