By Adde @ 2+2 forums (HstreamPoker at gmail dot com). The corresponding thread on 2+2 is here.


Bet Timer

A color coded timer box that counts seconds (up) when action buttons appear at your poker table.

Supported sites: PartyPoker, EmpirePoker, Full Tilt and WPEX.

This might be useful if you want your actions to always take the same amount of time, and thus don't give away any tells. For instance, you might want your continuation bets on all streets take the same amount of time, whether you hit or miss.

Default settings are customized for Full Tilt (auto-centered tables), but you can easily change them to work for any of the supported sites.

This script has Scriptpad support. Scriptpad is a tool where you can connect any number of scripts to a Scriptpad, a small pop-up window with buttons for all available commands in these scripts. You access the Scriptpad by clicking a hotkey, for instance the middle mouse button.

This script needs RolandsFunctions to work.

Troubleshooting

If things don't seem to work, restart the script from the system tray.

How To Use This Script

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

  2. Save the script code below in a file named "BetTimer.ahk"

  3. Download RolandsFunctions

  4. Open script file in a text editor and edit settings.

  5. Run the script (double-click the file).

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, choose "Reload this script".

Script Code

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;   Code begins here   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;------------------------------------------------------------------------------------------------
;       Bet Timer v1.00
;------------------------------------------------------------------------------------------------
;       Date: 2006-08-09
;       AHK version: 1.0.44.08
;------------------------------------------------------------------------------------------------
;       Author(s): Adde @ 2+2 forums
;       Also: Roland @ 2+2
;       Contact: HstreamPoker at gmail dot com
;
;       Based on Rolands code for Table Highlighter (and "RolandsFunctions")
;
;------------------------------------------------------------------------------------------------
;       A color coded timer box that counts seconds (up) when action buttons appear at your poker table.
;       See web page for more details.
;
;       All rights reserved. Use at your own risk.
;
;       http://overcards.com/wiki/moin.cgi/BetTimer
;------------------------------------------------------------------------------------------------



;________________________________________________________________________________________________
;
;       EDIT THESE SETTINGS
;________________________________________________________________________________________________

; Set timer box position and width/height within poker table window.
; Default values (in parenthesis) are customized for Full Tilt (auto-centered tables)

bt_timer_x := 347                                                       ; (347)
bt_timer_y := 530                                                       ; (530)
bt_timer_w := 112                                                       ; (112)
bt_timer_h := 20                                                        ; (20)

; Set font/style for text in timer box.

bt_timer_font_name := "Verdana"
bt_timer_font_style := "S10 Bold"

; Set time (in seconds) when timer box should change color.

bt_secs0 = 0
bt_secs1 = 1
bt_secs2 = 2
bt_secs3 = 3
bt_secs4 = 4
bt_secs5 = 5
bt_secs6 = 6
bt_secs7 = 7
bt_secs8 = 8
bt_secs9 = 9

; Set background color for timer box.

bt_bg_color0 = 000000
bt_bg_color1 = 0000FF
bt_bg_color2 = FF0000
bt_bg_color3 = 00FF00
bt_bg_color4 = FF9900
bt_bg_color5 = FFFF00
bt_bg_color6 = FFFF00
bt_bg_color7 = FFFF00
bt_bg_color8 = FFFF00
bt_bg_color9 = FFFF00

; Set foreground (text) color for timer box.

bt_fg_color0 = FFFFFF
bt_fg_color1 = FFFFFF
bt_fg_color2 = FFFFFF
bt_fg_color3 = 000000
bt_fg_color4 = 000000
bt_fg_color5 = 000000
bt_fg_color6 = 000000
bt_fg_color7 = 000000
bt_fg_color8 = 000000
bt_fg_color9 = 000000

; Set transparancy for timer box (0-255)

bt_trans = 255

;________________________________________________________________________________________________
;
;       DO NOT EDIT BELOW HERE
;________________________________________________________________________________________________

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;   auto-execute   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

#NoEnv
#SingleInstance Force
#Persistent

#Include Functions.ahk

IsCompiled()
CheckAHKVersion("1.0.44.08")

bt_GuiList := BT_GuiList()

bt_scriptpad_command_header = Other Tools
bt_scriptpad_command_name = Disable Bet Timer
bt_scriptpad_command_label = BT_Scriptpad_EnableDisable
bt_scriptpad_command_enabled = 1

SetTimer, BT_UpdateQueue, 200

goto BT_Scriptpad_End   

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;   functions   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

BT_Scriptpad_EnableDisable:
        if (bt_enabled)
        {
                bt_enabled := false
                bt_scriptpad_command_name = Enable Bet Timer
        }
        else
        {
                bt_enabled := true
                bt_scriptpad_command_name = Disable Bet Timer
        }
        Soundbeep, , 50
return


BT_UpdateQueue:
        bt_queue := BT_UpdateQueue()
        Loop, Parse, bt_HighLightList, `,
        {
                If ( ! IsIn(a_loopfield, bt_queue) && bt_gui%a_loopfield% )
                        BT_LightsOff(a_loopfield)
        }
        Loop, Parse, bt_queue, `, 
        {                       
                If ( ! IsIn(a_loopfield, bt_HighLightList) )  
                {  
                        BT_LightsOn(a_loopfield)
                }
        }
return           

BT_UpdateQueue() 
{
        local bt_tables
        static bt_queue, bt_queueEx
        bt_tables := BT_TableIDList(BT_LobbyIdParty())
        Loop, Parse, bt_tables, `, 
        {
                If ( IsIn(a_loopfield, bt_queue) && ( ! BT_IsTableWaiting(a_loopfield) ) ) 
                {
                        bt_queue := RemoveFromList(bt_queue, a_loopfield)
                        bt_startTime%a_loopfield% = 0
                        bt_time%a_loopfield% = 0
                }       
                else if ( ( ! IsIn(a_loopfield, bt_queue) ) && BT_IsTableWaiting(a_loopfield) ) 
                {
                        bt_queue := AddToList(bt_queue, a_loopfield)
                        If ( ! bt_startTime%a_loopfield% ) 
                                bt_startTime%a_loopfield% = %a_tickCount%
                }                
        If ( bt_startTime%a_loopfield% )
                        bt_time%a_loopfield% := a_tickCount - bt_startTime%a_loopfield%                
                BT_UpdateGui(a_loopfield)
        }
        Loop, Parse, bt_queue, `, 
                bt_queue := IIf( IsIn(a_loopfield, bt_tables), bt_queue, RemoveFromList(bt_queue, a_loopfield) )  
        Loop, Parse, bt_queueEx, `, 
                bt_queueEx := IIf( IsIn(a_loopfield, bt_tables), bt_queueEx, RemoveFromList(bt_queueEx, a_loopfield) )  
        return CleanList(AddToList(bt_queue, bt_queueEx))
}

BT_LightsOn(win)
{
        local gui
        gui := ExFromList(bt_GuiList, 1)
        bt_gui%win% = %gui%
        bt_GuiList := RemoveFromList(bt_GuiList, gui)
        bt_HighLightList := AddToList(bt_HighLightList, win)
        Gui %gui%: Default
        BT_BuildGui(win)
}

BT_LightsOff(win) 
{
        local gui
        gui := bt_gui%win% 
        if (gui > 99 or gui < 1)
                return
        Gui %gui%:Destroy
        bt_GuiList := AddToList(bt_GuiList, bt_gui%win%)
        bt_HighLightList := RemoveFromList(bt_HighLightList, win)
}

BT_UpdateGui(win)
{
        local gui, x, y, w, h, t, secs, tx, ty, i, bg, fg
        
        gui := bt_gui%win%
        if (! gui)
                return
        Gui %gui%:Default
        
        t := bt_time%win%
        secs := t / 1000
        secs := Floor(secs)
        if (secs = bt_secs_last%win%)
                return  
        bt_secs_last%win% := secs       
        
        bg := bt_bg_color0
        fg := bt_fg_color0      
        
        i := 0
        Loop, 9
        {
                i := i + 1
                if (secs >= bt_secs%i%)
                {
                        bg := bt_bg_color%i%
                        fg := bt_fg_color%i%
                }
        }       
        
        tx := (bt_timer_w/2) -5
        tx := Floor(tx)
        if (secs >= 10)
                tx := tx - 5
        ty := 1
                
        Gui, Add, Text, c%fg% x%tx% y%ty% , %secs%
        Gui, Color, %bg%
        Gui, Show, NoActivate
}       

BT_BuildGui(win) 
{
        local gui, x, y, w, h, t, secs, tx, ty
        
        WinGetPos, x, y, w, h, ahk_id%win%
        Gui, +Lastfound +AlwaysOnTop +Toolwindow
        Gui, Color, %bt_bg_color0%
        WinSet, Transparent, %bt_trans%
        Gui, -Caption
                        
        x := x + bt_timer_x
        y := y + bt_timer_y
        w := bt_timer_w
        h := bt_timer_h
        
        t := bt_time%win%
        secs := t / 1000
        secs := Floor(secs)
        bt_secs_last%win% := secs
        
        tx := (bt_timer_w/2) -5
        tx := Floor(tx)
        if (secs >= 10)
                tx := tx - 5
        ty := 1

        Gui, font, %bt_timer_font_style%, %bt_timer_font_name%
        Gui, Add, Text, c%bt_fg_color0% x%tx% y%ty%, %secs%                             
        Gui, Show, w%w% h%h% x%x% y%y% NoActivate
}

BT_IsTableWaiting(id) 
{
        WinGetClass, class, ahk_id %id%
        if (class = "#32770")
                return (BT_IsTableWaitingParty(id))
        if (class = "FTC_TableViewFull")
                return (BT_IsTableWaitingFulltilt(id))
        if (class = "TDlgTableHoldem")
                return (BT_IsTableWaitingWpex(id))
        if (class = "TDlgTableStud")
                return (BT_IsTableWaitingWpex(id))
        return 0
}

BT_IsTableWaitingParty(id) 
{
        return ( IsVisCtrl("Fold ",id,3) 
                                || IsVisCtrl("Post B", id, 1) 
                                || IsVisCtrl("Post S", id, 1) )
}

BT_IsTableWaitingFulltilt(id) 
{
        return ( IsVisCtrl("FTCSkinButton11",id,3))
}

BT_IsTableWaitingWpex(id) 
{
        CoordMode, Pixel, Screen
        WinGetPos, x, y, w, h, ahk_id %id%
        If ( GetPixelCount(x+143, y+538, x+145, y+540, 0x1816B6) >= 1 ) 
                return 1
        If ( GetPixelCount(x+409, y+538, x+411, y+540, 0x1817B6) >= 1 ) 
                return 1
        return 0
}

BT_IsTableWaitingEx(id) 
{
        WinGetClass, class, ahk_id %id%
        if (class = "#32770")
                return (BT_IsTableWaitingExParty(id))
        if (class = "FTC_TableViewFull")
                return (BT_IsTableWaitingExFulltilt(id))
        if (class = "TDlgTableHoldem")
                return (BT_IsTableWaitingExWpex(id))
        if (class = "TDlgTableStud")
                return (BT_IsTableWaitingExWpex(id))
        return 0
}

BT_IsTableWaitingExParty(id) 
{
        If ( ! IsVisCtrl("Fold",id,3) )
                return 0
        If ( IsButtonCheckedParty("Fold",id,3) 
                || IsButtonCheckedParty("Check/Fold",id,1) 
                || IsButtonCheckedParty("Check",id,3) 
                || IsButtonCheckedParty("Call",id,1) 
                || IsButtonCheckedParty("Bet",id,1) 
                || IsButtonCheckedParty("Bet/Raise",id,1) 
                || IsButtonCheckedParty("Raise (",id,1) 
                || IsButtonCheckedParty("Raise Any",id,3) )
                return 0
        return 1
}

BT_IsTableWaitingExFulltilt(id) 
{
        If ( ! IsVisCtrl("FTCButton19",id,3) )
                return 0 
        CoordMode, Pixel, Screen
        WinGetPos, x1, y1,,, ahk_id %id%
        dx := 4
        dy := 4
        If ( GetPixelCount(x1+501, y1+525, x1+501+dx, y1+525+dy, 0x000000) >= 1 ) 
                return 0
        If ( GetPixelCount(x1+601, y1+525, x1+601+dx, y1+525+dy, 0x000000) >= 1 ) 
                return 0
        If ( GetPixelCount(x1+701, y1+525, x1+701+dx, y1+525+dy, 0x000000) >= 1 ) 
                return 0
        If ( GetPixelCount(x1+601, y1+550, x1+601+dx, y1+550+dy, 0x000000) >= 1 ) 
                return 0
        If ( GetPixelCount(x1+701, y1+550, x1+701+dx, y1+550+dy, 0x000000) >= 1 ) 
                return 0
        return 1
} 

BT_IsTableWaitingExWpex(id) 
{
        If ( ! IsVisCtrl("THTMLRadioButton3",id,3))
                return 0  
        CoordMode, Pixel, Screen
        WinGetPos, x1, y1,,, ahk_id %id%
        If ( GetPixelCount(x1+144, y1+530, x1+145, y1+531, 0x000000) >= 1 ) 
                return 0
        If ( GetPixelCount(x1+144, y1+550, x1+145, y1+551, 0x000000) >= 1 ) 
                return 0
        If ( GetPixelCount(x1+234, y1+530, x1+235, y1+531, 0x000000) >= 1 ) 
                return 0
        If ( GetPixelCount(x1+234, y1+550, x1+235, y1+551, 0x000000) >= 1 ) 
                return 0
        If ( GetPixelCount(x1+324, y1+530, x1+325, y1+531, 0x000000) >= 1 ) 
                return 0
        If ( GetPixelCount(x1+324, y1+550, x1+325, y1+551, 0x000000) >= 1 ) 
                return 0                
        return 1
} 

BT_LobbyIdParty() 
{
        SetTitleMatchMode 1
        WinGet, id, id, PartyPoker.com: ahk_class#32770
        If ( ! id )
                WinGet, id, id, EmpirePoker: Poker Lobby ahk_class#32770
        return id
}

BT_TableIDList(lobbyID) 
{
        SetTitleMatchMode, 2                                                ; ---------- Partypoker
        WinGet, pid, PID, ahk_id%lobbyID%
        WinGet, list, list, Good Luck ahk_pid%pid%
        Loop %list% 
        {
                If ( list%a_index% != lobbyID )
                        ids := AddToList(ids,list%a_index%)
        } 
        SetTitleMatchMode, 2                                                ; ---------- Fulltilt
        WinGet, list, list, Logged In As ahk_class FTC_TableViewFull
        Loop %list% 
        {
        ids := AddToList(ids,list%a_index%)
        } 
        SetTitleMatchMode, 2                                                ; ---------- Wpex
        WinGet, list, list, ahk_class TDlgTableHoldem
        Loop %list% 
        {
        ids := AddToList(ids,list%a_index%)
        } 
        WinGet, list, list, ahk_class TDlgTableStud
        Loop %list% 
        {
        ids := AddToList(ids,list%a_index%)
        } 
        return ids
}

BT_GuiList() {
        local i
        i = 39
        Loop 20
        {
                i++
                bt_GuiList := AddToList(bt_GuiList, i)
        }
        return bt_GuiList
}

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;   scriptpad   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

BT_Scriptpad_End:
        ; Do nothing. This is needed to work with Scriptpad.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;   Code ends here   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

CategoryAutoHotKey

BetTimer (last edited 2007-09-06 06:13:58 by S0106000e08e8c87e)