By HalvSame @ 2+2/FTR forums. The corresponding thread on 2+2 is here.


FullTiltAutoReloader 1.1 (test)

This script (actually, there are two scripts) reloads stacks to 100BB, either automatically or manually. It needs RolandsFunctions to work (included in zip).

Supported poker sites: Full Tilt NL

How To Use This Script

  1. Read instructions for AutoHotkey, and make sure you have the latest version installed.

  2. Read all instructions on this page.

  3. Download one the zip file and extract the files.

  4. The included images used to find the stack size are based on the standard player boxes. If you're other modified player boxes you'll have to edit the images to match them.

  5. Open the FullTiltAutoReloader file in a text editor and edit settings.

  6. Run the FullTiltAutoReloader script (double-click the file). The other one will start automatically.

A green AHK icon will show in the system tray as long as the script is running. Right-click this icon and choose "Exit" to exit the script. If the script seems to have gone wild, right click and choose "Reload This Script".

If you set the script to update automatically, you need to use the Auto-Center seat function in the FTP client. The player box with your stack size in it has to be visible for the script to be able to get the stack size. Using the auto-function is a bit more CPU-consuming, but I've tested 6-tabling with PT, PAHUD, and various other ahk-scripts running without any problems.

You can also assign a hotkey to update all the tables manually, by default this is set to F1.

Finally, if you only wish to be bought in full when sitting down and to reload to the maximum when clicking the Get Chips button, you can download and run the FullTiltReloader script and run it alone.

As always, test at microstakes first!

Changelog

1.1

1.0

Download

FullTiltAutoReloader1.1.zip Configured for unmodified avatar boxes, WinXP style and WinClassic style

FullTiltReloader Code

;---------------------------------------------------------
;------------------- FullTiltReloader --------------------
;---------------------------------------------------------

; Date: Nov 30, 2006
; Author: HalvSame@2p2/ftr
;
; olol scriptaments!1!!1!
; + "Good job" to those who deserve it! 
;
;

#NoEnv
#SingleInstance force

SetTitleMatchMode 2

debug_enabled = 0

Loop
{
  WinWait, Get Chips ahk_class #32770 
  ControlGet, en, Enabled, , Button2
      
  if en                
  { 
    Loop 
    {    
      ControlGet, chk, Checked, , Button2    
      
      if chk
        break
      
      ControlClick, Button2, Get Chips ahk_class #32770     ;keep clicking the max button until it's checked
    }
    
    Debug("Reloaded stack")      
    ControlSend, ahk_parent, {ENTER}         
  }
  
  else
  {
    Debug("Couldn't reload stack - max button not enabled")
    WinClose, Get Chips ahk_class #32770
  }
  
  WinWaitClose, Get Chips ahk_class #32770
}

;___ Writes a log entry
Debug(str)
{      
      global
      if (debug_enabled)
      {
        t := A_Now
        FormatTime, t, t, hh:mm:ss
        s = %t%: %str% `n
        FileAppend, %s%, FTReloaderDebug.txt
      } 
}

FullTiltAutoReloader Code

;---------------------------------------------------------
;------------------- FullTiltAutoReloader ----------------
;---------------------------------------------------------

; Date: Nov 30, 2006
; Author: HalvSame@2p2/ftr
;
;  A big thanks to all the fish that give me money
;  - oh, and to the whole poker software crowd, you know who you are! ;o)
;

#NoEnv
#SingleInstance force
#Include %a_scriptDir%
#Include Functions.ahk

SetTitleMatchMode 2
CoordMode, Pixel, Screen
SysGet, caption, 4

Run, FullTiltReloader.ahk       ;used for the actual reloading


;************ Start configuration (Don't edit above here!)

debug_enabled = 0             ;Set to 1 to enable logging to a text file
image_debug = 0               ;Set to 1 to enable visual debugging of image search areas

auto_mode := 1                ;Set to 1 to enable fully automated reloading
interval := 10                ;Set autoreload interval

BackgroundColor := 0x767574   ;this must be set to the color of the avatar box beneath the hero's cards
                              ;(pixel [375, 482] relative to the table window, use ahk's WindowSpy to determine the color)                              

if auto_mode
   UpdateStacks()

;___ This hotkey will manually update all the tables
F1::
  ManualUpdate()
return



;************ End configuration (Don't edit below here!)


UpdateStacks()
{
  Loop
  {
    global tables
    global interval
    UpdateTables()  
  
    Loop, Parse, tables, `,
    {
      id := a_loopfield
      StringSplit, id, id, "_"      ;spit list entry into table id an timestamp
      
      time := a_now
      age := (time - id2)
          
      if ( !id2 ||  ( age > interval ) )          ;get stack info again if timestamp is too old
      {        
        
        IfWinExist, ahk_id%id1%
        {
          fullStack := GetStakes(id1) * 100        
          stack:= GetStack(id1)
        
          if stack
          {
            if ( stack < fullStack )
            {
              s = Stack is %stack%, full stack is %fullStack%
              Debug(s)
                            
              ControlClick, FTCButton1, ahk_id%id1%              
            }
          
            tables := RemoveFromList(tables, a_loopfield, ",")    ;remove the old timestamp
          }      
        }
        
        id := 
        id1 :=
        id2 :=
      }      
    }
    sleep, 1000
  } 
}

GetStakes(id)
{
  WinGetTitle, title, ahk_id%id%
  StringSplit, title, title, "-"
  StringSplit, stakes, title2, "/"
  StringTrimLeft, stakes, stakes2, 1
  s= Table: %title%`, stakes: %stakes%
  Debug(s)
  return stakes
}


;__ gets a player's stack size.
;   id = the window id to scan.
;   x/y = coordinates of the upper left corner of the player box.
;   Default is the bottommost player 
GetStack(id, x = 348, y = 462)
{
  
  global tables
  global backgroundcolor
  global caption  

  y := y + caption
  
  WinGetPos, winX, winY, , , ahk_id%id%
  WinGetTitle, title, ahk_id%id%
  s = "%title%" at %winX%x%winY% 
  Debug(s)

  posX := winX + x
  posY := winY + y + 20
  posX2 := posX + 105
  posY2 := posY + 10
  
  stack =
  
  pixX := posX + 23
  pixY := posY - 30
  
  PixelGetColor, color, pixX, pixY
  if ( color != BackgroundColor )                               ;don't try to read the stack if the player has cards 
  {
    s = Player has cards or table not visible, aborting search (pixel color: %color%, wanted %BackgroundColor%)
    Debug(s)
    return
  }      
  
  ImageSearch, x, y, posX, posY, posX2, posY2, Images\dollar.png    ;find out where the stack starts
  debug_gui(win, posX, posY, posx2, posy2, 500)
  
  if errorlevel
     Debug("Couldn't find startpoint for stack")
  
  else
  {
    s = Stack starts at x %x% y %y%
    Debug(s)
    
    posX := x + 6
    posX2 := posX + 9   
    
    Loop
    {    
      stop = 1
            
      debug_gui(win, posX, posY, posX2, posY2, 1000)
         
      Loop, 11
      {                                                                   ;find next digit
        digit := a_index -2
        if digit < 0
          digit = dot
          
        fileName = Images\%digit%.png        
        
        ImageSearch, x, y, posX, posY, posX2, posY2, %fileName%
        
        if ( errorlevel = 0 )
        { 
          stop = 0
          
          w:= 6
          
          if (digit = 1 || digit = "dot")          
            w := 4                                         ;'1' and '.' images are a little less wide
            
          posX := x + w 
          posX2 := posX + 9
          
          if digit = dot
            digit := "."
               
          stack = %stack%%digit%
          
          s = Found new digit: %digit% at x %x% y %y%, Stack: %stack%                              
          Debug(s)
          break      
        }
      }
      
      if stop
      {        
        tables := RemoveFromList(tables, id, ",")
        stamped = %id%_%A_now%                      ;add a timestamp to mark when the stack was last found
        tables := AddToList(tables, stamped)
        
        s = Stack search ended. Found stack: %stack%. Timestamp: %stamped%       
        Debug(s)
        
        return stack
      }      
    }      
  } 
}

ManualUpdate()
{
  WinGet, list, list, ahk_class FTC_TableViewFull
  Loop %list%
    {
      table := list%a_index%
      ControlClick, FTCButton1, ahk_id%table%       ;open the get chips window for all tables
      WinWaitClose, Get Chips ahk_class #32770      ;let the Reloader finish           
      
      s = Manually reloaded table %table%
      Debug(s)
    }
}

UpdateTables()
{
    global
    WinGet, list, list, ahk_class FTC_TableViewFull
    
    Loop %list%
    {
        table := list%a_index%        
        
        IfNotInString, tables, %table%
        {          
          tables := AddToList(tables,table)          
          s = Added table %table% to list. Tables: %tables%
          Debug(s)          
        }
    }    
}

;___ Writes a log entry
Debug(str)
{      
      global
      if (debug_enabled)
      {
        t := A_Now
        FormatTime, t, t, hh:mm:ss
        s = %t%: %str% `n
        FileAppend, %s%, FTAutoReloaderDebug.txt
      } 
}

;___ shows a box on the screen where we are trying to find an image
debug_gui(id, x1, y1, x2, y2, delay=1500)
{
  global
  if image_debug
  {    
    WinGetPos, winX, winY, , , ahk_id %id%
    Gui, 2: +Alwaysontop +LastFound +Owner
    Gui, 2: Color, ffffff
    WinSet, Transparent, 200
    Gui, 2: -Caption
    w1 := x2 - x1
    h1 := y2 - y1
    
    x1 += winX
    y1 += winY
    
    Gui, 2: Show, w%w1% h%h1% x%x1% y%y1% NoActivate
    Sleep, %delay%
    Gui,2: Destroy
  }
}

CategoryAutoHotKey

FullTiltAutoReloader (last edited 2006-11-30 07:56:18 by m203h)