By Roland, Adde, APerfect10, HalvSame, PietM @ 2+2 forums. The corresponding thread on 2+2 is here.


Table Highlighter

Add a Highlight Bar on all poker tables that need your attention.

Supported poker sites: PartyPoker, EmpirePoker, Full Tilt, WPEX, Prima NL, Crypto NL, PokerStars (currently only NL), PokerRoom, HollywoodPoker and iPoker(no advance buttons support).

You can choose to have a red bar over the window title bar, or anywhere on the table, for instance a larger blue at the bottom, over the chat box area. Here's a screenshot that shows how both of these would look (note that you can only use one Highlight Bar at a time; the image is "faked" to show an example of both).

thsmall20ot

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.

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 RolandsFunctions

  4. Save script code below in a file named "TableHighlighter.ahk"

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

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

  7. Right-click system tray icon to choose Color and Transparency, and to set up buttons for iPoker.

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, exit script and start it again.

Spam Alert

Note that this page has been frequently spammed. It is intended to be an open page and you are welcome to contribute, but you will need to create a user account and then request to be added to the list of permitted editors on this page. If you would like access, feel free to post to the Fourms with your Wiki user name and someone will be happy to add you. If you get no response, feel free to PM MogobuTheFool.

Current ACL: acl MogobuTheFool:read,write,delete,revert DaveAgain:read,write,delete,revert Thomas:read,write,delete,revert tht:read,write,delete,revert HopeForNutsread,write,delete,revert RolandAgain:read,write,delete,revert Adde:read,write,delete,revert APerfect10:read,write,delete,revert Adde:read,write,delete,revert Chris:read,write,delete,revert PietM:read,write,delete,revert Adde:read,write,delete,revert MattiasKjetselberg:read,write,delete,revert jukofyork:read,write,delete,revert All:read

Script Code

;-------------------------------------------------------------- 
;------------------- TableHighlighter2 v1.21 ------------------
;--------------------------------------------------------------

; Date: Wednesday, December 5, 2007
; Authors: Roland, Adde, APerfect10
; Idea: Adde
; Contributions by SamIAm, HalvSame, PietM

th_version_text = TableHighlighter v1.21

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

SetWorkingDir %a_ScriptDir%

;###### Configuration ######
debug_enabled = 0                               ; set to 1 to enabling writing debug log file

AQ_Ex = 0                                       ; set to 0 to ignore advance action buttons
timeBeep = 15                                    ; beep once if you have x seconds left - set to 0 to never beep
timeContBeep = 5                                ; beep - beep - beep - beep ...
timeFlash = 1                                   ; flashes the gui instead of beeping (though you can have both)
shiftColors = 0                                 ; set to 1 to use move through a range of color (written by SamIAm)
style = BottomBar                               ; options: Bar, BottomBar, Chatbox, or WholeWindow
barX = 3                                        ; these apply only to "BottomBar" style
barY = 550                                      ; they are dynamic - configure them on a table of normal size,
barW = 790                                      ; then use with any table size
barH = 25                                       ;

roundCorners = 0                                ; set to 1 if you want rounded corners on TopBar (does not apply to BottomBar and others)
skipUnderMouse = 0                              ; set to 1 if window under mouse should not be highlighted
skipUnderMouseTitle = 0                         ; set to 1 if window with mouse under window titlebar should not be highlighted
buttonFlash = 0                                 ; set to 1 to flash bar when non-advance buttons are shown
barTopH = 0                                     ; set height of TopBar; set to 0 to use default height of window titlebar
barTopY = 0                                     ; set Y coordinate where TopBar should be located
activate_on_mouse_over = 0                      ; set to 1 to activate table when mouse is over highlight bar
flash_speed = 2                                 ; set flash speed (1=fast, 2=medium, 3=slower, etc)
active_windows_only    = 0                      ; set to 1 to only work on active table
activate_waiting_table = 0                      ; set to 1 to make a waiting table active

;###### Configuration - End ######


IsCompiled()
CheckAHKVersion("1.0.46.09")
Settings()
TrayMenu()
GuiList := GuiList()

th_scriptpad_command_header = Other Tools
th_scriptpad_command_name = Disable Table Highlighter
th_scriptpad_command_label = TH_Scriptpad_EnableDisable
th_scriptpad_command_enabled = 1

s =
(
Settings:
AQ_Ex = %AQ_Ex%
timeBeep = %timeBeep%
timeContBeep =%timeContBeep%
timeFlash=%timeFlash%
shiftColors = %shiftColors%
style = %style%
barX = %barX%
barY = %barY%
barW = %barW%
barH = %barH%
roundCorners = %roundCorners%
skipUnderMouse = %skipUnderMouse%
skipUnderMouseTitle = %skipUnderMouseTitle%
buttonFlash = %buttonFlash%
barTopH = %barTopH%
barTopY = %barTopY%
activate_on_mouse_over = %activate_on_mouse_over%
flash_speed = %flash_speed%
)
    
Debug(s)

PrimaColor =

SetTimer, UpdateQueue, 250

goto TH_Scriptpad_End

;------------- end of auto-execute section -------------

Debug(str)
{      
      global
      if (debug_enabled)
      {
        t := A_Now
        FormatTime, t, t, hh:mm:ss
        s = %t%: %str% `n
        FileAppend, %s%, Debug.txt
      } 
}

;--------- scriptpad stuff ---------

TH_Scriptpad_EnableDisable:
        if (th_enabled)
        {
                th_enabled := false
                th_scriptpad_command_name = Enable Table Highlighter
        }
        else
        {
                th_enabled := true
                th_scriptpad_command_name = Disable Table Highlighter
        }
        Soundbeep, , 50
return

;--------- UpdateQueue ---------

UpdateQueue:
if (activate_on_mouse_over)
{
        WinGetClass, class, A
        if (class = "AutoHotkeyGUI")
        {
                WinGetTitle, title, A
                WinActivate, ahk_id %title%
        }
}
queue := UpdateQueue()
CoordMode, Pixel, Relative
MouseGetPos, mx, my, tableUnderMouseId
Loop, Parse, HighLightList, `,
        {
                If ( ! IsIn(a_loopfield, queue) && gui%a_loopfield% )
                         LightsOff(a_loopfield)
        }
Loop, Parse, queue, `, 
        {
                                if (skipUnderMouseTitle and my >= 0 and my <= caption)
                                {
                                        LightsOff(a_loopfield)
                                        continue
                                }
                                if (skipUnderMouse and a_loopfield = tableUnderMouseId)
                                {
                                        LightsOff(a_loopfield)
                                        continue
                                }                                                                       
                If ( ! IsIn(a_loopfield, HighLightList) )  
                                {  
                                                                        LightsOn(a_loopfield)
                }                    
                If ( ( ! Beep%a_loopfield% ) 
                                && ( time%a_loopfield% >= ( 25 - timeBeep ) * 1000 ) )
                        Beep(a_loopfield)
                If ( time%a_loopfield% >= ( 25 - timeContBeep ) * 1000 )        {
                                        Beep%a_loopfield% = 0
                                        Beep(a_loopfield)
                                }
                If ( time%a_loopfield% >= ( 25 - timeFlash ) * 1000 )
                        Flash(a_loopfield)
                else if (buttonFlash and IsTableWaiting(a_loopfield))
                        Flash(a_loopfield)
                else if ( shiftColors )
                        UpdateColor(a_loopfield, time%a_loopfield%)
        }
return

;------ Beep --------

Beep(win) {
global
if (timeBeep > 0)
        SoundBeep
Beep%win% = 1
}

;------- Flash --------

Flash(win) {
local gui, fw, fw_max, fw_mid
gui := gui%win%
fw := flash%win%
if (fw = "")
        fw := 0
fw := fw + 1
fw_max := flash_speed * 2
fw_mid := Floor(fw_max/2)       
If (fw > fw_max)
        fw := 1
If (fw <= fw_mid)
        Gui %gui%: Color, %flashColor%
else
        Gui %gui%: Color, %highLightColor%
flash%win% := fw
}
        
;--------- UpdateQueue() ---------

UpdateQueue() {
local tables
static queue,queueEx
tables := TableIDList()
Loop, Parse, tables, `, 
 {
 
/*
id := a_loopfield
CoordMode, Pixel, Screen
WinGetPos, x1, y1,,, ahk_id %id%
PixelGetColor, c, x1+12, y1+12
WInGetTitle, tt, ahk_id %id%
s = title=%tt%  x=%x1%  y=%y1%  c=%c%
Debug(s)
*/

  ; Update by PietM, dec 13th 2006
  WinGet, active_id, ID, A

  If (activate_waiting_table)
  {
    ; If current active window is NOT waiting, but there
    ; IS a table waiting, activate that one.
    If (! IsTableWaiting(active_id)
        && IsTableWaiting(a_loopfield) ) {
      WinActivate, ahk_id%a_loopfield%
      active_id = a_loopfield;
    }
  }
  ; End Update PietM


        If ( IsIn(a_loopfield, queue) 
                        && ( ! IsTableWaiting(a_loopfield) ) ) {
                                queue := RemoveFromList(queue, a_loopfield)
                                startTime%a_loopfield% = 0
                                time%a_loopfield% = 0
                        }       
  else if ( ( ! IsIn(a_loopfield, queue) ) 
                        && ( ! active_windows_only || active_id = a_loopfield) ; PietM update 12-13-2006
                                        && IsTableWaiting(a_loopfield) ) {
                        queue := AddToList(queue, a_loopfield)
                        If ( ! startTime%a_loopfield% ) 
                                startTime%a_loopfield% = %a_tickCount%
                }
        else if ( AQ_Ex && IsIn(a_loopfield, queueEx) 
                                        && ( ! IsTableWaitingEx(a_loopfield) ) )
                queueEx := RemoveFromList(queueEx, a_loopfield) 
  else if ( AQ_Ex && ( ! IsIn(a_loopfield, queueEx) ) 
                                        && IsTableWaitingEx(a_loopfield) ) 
                queueEx := AddToList(queueEx, a_loopfield)
                
        If ( startTime%a_loopfield% )
                time%a_loopfield% := a_tickCount - startTime%a_loopfield%
 }
Loop, Parse, queue, `, 
 queue := IIf( IsIn(a_loopfield, tables), queue, RemoveFromList(queue, a_loopfield) )  
Loop, Parse, queueEx, `, 
 queueEx := IIf( IsIn(a_loopfield, tables), queueEx, RemoveFromList(queueEx, a_loopfield) )  
return CleanList(AddToList(queue,queueEx))
}

;------- UpdateColor ---------

UpdateColor(win, time) {
global
gui := gui%win% 
Gui %gui%: Color, % GetColor(25 - ( time/1000 ) ) 
}

;------- LightsOn --------

LightsOn(win) {
local gui,wx,wy,x,y,w,h
gui := ExFromList(GuiList, 1)
gui%win% = %gui%
GuiList := RemoveFromList(GuiList, gui)
HighLightList := AddToList(HighLightList, win)
Gui %gui%:Default
BuildGui(win)
}

;------- LightsOff --------

LightsOff(win) {
local gui
gui := gui%win% 
if (gui > 99 or gui < 1)
        return
Gui %gui%:Destroy
GuiList := AddToList(GuiList, gui%win%)
HighLightList := RemoveFromList(HighLightList, win)
Beep%win% = 0
flash%win% = 0
}

;--------- BuildGui ------------

BuildGui(win) {
local wx,wy,x,y,w,h
WinGetPos, x, y, w, h, ahk_id%win%
Gui, +Lastfound +AlwaysOnTop +Toolwindow
Gui, Color, %highLightColor%
WinSet, Transparent, %highLightTrans%
Gui, -Caption
Gui, +E0x20 ; WS_EX_TRANSPARENT
gui_title := win
If ( style = "bar" ) {
                                rx := 20
                                if roundCorners = 0
                                        rx := 0
                                hy = %caption%
                                if (barTopH > 0)
                                        hy := barTopH
                                y := y + barTopY
                Gui, Show, w%w% h%hy% x%x% y%y% NoActivate, %gui_title%
                WinSet, Region, 
                                                (
                                                        w%w% h%hy% 0-0 %w%-0 
                                                        %w%-%caption% 0-%border% R%rx%-%rx%
                                                )
        } else if ( style = "chatbox" ) {
                ControlGetPos, wx, wy, w, h, RichEdit20W1, ahk_id%win%
                x += wx
                y += wy
                Gui, Show, x%x% y%y% w%w% h%h% NoActivate, %gui_title%
        } else if ( style = "bottomBar" ) {
                width := ( barW/796 ) * w
                height := ( barH/579 ) * h 
                posX := x + ( barX/796 ) * w
                posY := y + ( barY/579 ) * h
                Gui, Show, x%posX% y%posY% w%width% h%height% NoActivate, %gui_title%
        } else if ( style = "WholeWindow" ) {
                Gui, Show, x%x% y%y% w%w% h%h% NoActivate, %gui_title%
        }
}
                
;-------- Settings ------------

Settings() {
global
ini = TableHighlighter.ini
IniRead, highLightColor, %ini%, Settings, highLightColor, FFFF00
IniRead, flashColor, %ini%, Settings, flashColor, 00FF00
IniRead, highLightTrans, %ini%, Settings, Trans, 200
IniRead, IPokerBtnColor, %ini%, Settings, IPokerBtnColor
IniRead, IPokerBtnColor2, %ini%, Settings, IPokerBtnColor2
IniRead, IPokerAdvanceColor, %ini%, Settings, IPokerAdvanceColor
IniRead, IPokerAdvanceChkColor, %ini%, Settings, IPokerAdvanceChkColor
IniRead, IPokerAdvanceCallColor, %ini%, Settings, IPokerAdvanceCallColor
IniRead, IPokerAdvanceCallChkColor, %ini%, Settings, IPokerAdvanceCallChkColor
IniRead, iPokerMiniView, %ini%, Settings, IPokerMiniView, 0

IniRead, PokerStarsFoldX, %ini%, PokerStars, PokerStarsFoldX
IniRead, PokerStarsFoldY, %ini%, PokerStars, PokerStarsFoldY
IniRead, PokerStarsBtnColor, %ini%, PokerStars, PokerStarsBtnColor
IniRead, PokerStarsBtnColor2, %ini%, PokerStars, PokerStarsBtnColor2

iPokerFoldX := 305
iPokerFoldY := 525

if (iPokerMiniView = 1)
{
   iPokerFoldX := 220
   iPokerFoldY := 315
}

SysGet, border, 32
SysGet, caption, 4
caption := border + caption
}

;---------- TrayMenu -----------

TrayMenu() {
global ini, th_version_text
Menu, Tray, NoStandard
Menu, Tray, DeleteAll
Menu, Tray, Standard
Menu, Tray, Add, &Help, Help
Menu, Tray, Default, &Help
Menu, Tray, Add
Menu, Tray, Add, &About, About
Menu, Tray, Add
Menu, Tray, Add, &Color, Color
Menu, Tray, Add, &Transparency, Transparency
Menu, Tray, Add
Menu, Tray, Add, &iPoker Setup, IPokerSetup
Menu, Tray, Add, Poker&Stars Setup, PokerStarsSetup
Menu, Tray, Add
Menu, Tray, Add, &Exit, Exit
Menu, Tray, Tip, %th_version_text%
}

IPokerSetup:
msgbox, 1, iPoker Setup, To set up iPoker you must be seated at a table.
IfMsgBox Ok
{
        msgbox, 4, iPoker Setup, Use Mini View?
        IfMsgBox, Yes
                miniView = 1            
        else
                miniView = 0

        IniWrite, %miniView%, %ini%, Settings, IPokerMiniView
        Settings()

        msgbox, 1, iPoker Setup, Wait until it's your turn to act and the "Fold" button is visible on screen, then press Enter.
        IfMsgBox Ok
        {
                CoordMode, Pixel, Screen
                WinGet, id, id, ahk_class PTIODEVICE, , Nickname
                WinGetPos, x, y,,, ahk_id %id%
                WinActivate, ahk_id %id%

                PixelGetColor, foldCol, x + iPokerFoldX, y + iPokerFoldY
                IniWrite, %foldCol%, %ini%, Settings, IPokerBtnColor
        }
        msgbox, 1, iPoker Setup, Move the mouse cursor over the bottom part of the "Fold" button so that its highlighting changes, then press Enter.    
        IfMsgBox Ok
        {
                CoordMode, Pixel, Screen
                WinGet, id, id, ahk_class PTIODEVICE, , Nickname
                WinGetPos, x, y,,, ahk_id %id%
                WinActivate, ahk_id %id%
                PixelGetColor, foldcol2, x + iPokerFoldX, y + iPokerFoldY
                IniWrite, %foldCol2%, %ini%, Settings, IPokerBtnColor2  
        }
}
Settings()
return

PokerStarsSetup:

CoordMode, Mouse, Screen
CoordMode, Pixel, Screen

msgbox, 1, PokerStars Setup, To set up PokerStars you must be seated at a table.
IfMsgBox, Cancel
  return

msgbox, 1, PokerStars Setup, Wait until it's your turn to act, move the mouse cursor over the "Fold" button so that its highlighting changes, then press either ctrl key.
IfMsgBox, Cancel
  return

KeyWait Control, D

MouseGetPos, mx, my, id,,
getClientRect(x, y, w, h, id)

PixelGetColor, foldCol, mx, my

msgbox, 1, PokerStars Setup, Wait until it's your turn to act and the "Fold" button is visible on screen, then select OK.  Don't move the window.
IfMsgBox, Cancel
  return

PixelGetColor, foldcol2, mx, my

IniWrite, % (mx - x) * 1000 / w, %ini%, PokerStars, PokerStarsFoldX
IniWrite, % (my - y) * 1000 / h, %ini%, PokerStars, PokerStarsFoldY
IniWrite, %foldCol%, %ini%, PokerStars, PokerStarsBtnColor
IniWrite, %foldCol2%, %ini%, PokerStars, PokerStarsBtnColor2

Settings()
return

Help:
Run % Web() "http://www.overcards.com/wiki/moin.cgi/TableHighlighter"
return

About:
TrayTip, %th_version_text%, Author: Roland`nIdea:Adde`nE-mail: roland@overcards.com,,1
return

Color:
ColorGui()
return

Transparency:
Thread NoTimers
t := InputBox("Please enter the new transparency (0 - 255):"
                     , "bold w200 -Owner", "Transparency", highLightTrans)
If ( ! t )
        return
highLightTrans = %t%
IniWrite, %t%, %ini%, Settings, Trans
return

Exit:
ExitApp

;-------- IsTableWaiting ---------

IsTableWaiting(id) {
If ( isIn(id, tablesPokerRoom()) )
  return isTableWaitingPokerRoom(id)
WinGetClass, class, ahk_id %id%
if (class = "#32770")
        return (IsTableWaitingParty(id))
if (class = "FTC_TableViewFull")
        return (IsTableWaitingFulltilt(id))
if (class = "TDlgTableHoldem")
        return (IsTableWaitingWpex(id))
if (class = "TDlgTableStud")
        return (IsTableWaitingWpex(id))
if (class = "POPUP_INT_DLG_WINDOW")
        return (IsTableWaitingPrima(id))
if (class = "ATL:00424070")
        return (IsTableWaitingCrypto(id))
if (class = "PokerStarsTableFrameClass")
        return (IsTableWaitingPokerStars(id))
if (class = "PTIODEVICE")
        return (IsTableWaitingIPoker(id))
return 0
}

IsTableWaitingIPoker(id)
{
        global
        CoordMode, Pixel, Screen
        WinGetPos, x, y,,, ahk_id %id%
        
        PixelGetColor, foldCol, x + iPokerFoldX, y + iPokerFoldY
        if(foldCol = IPokerBtnColor or foldCol = IPokerBtnColor2)
        {
          s = iPoker table waiting = %id%
          Debug(s)
          return true
        }
}

IsTableWaitingParty(id) {
  if ( ! IsVisCtrl("I am Back",id,1) && ! IsVisCtrl("Unjoin Wait List",id,1) && ! IsVisCtrl("Join Wait List",id,1)&& (IsVisCtrl("AfxWnd42u17",id,1) ; call button is visible
              || IsVisCtrl("Post B", id, 1) ;post big blind button is visible
                   || IsVisCtrl("Post S", id, 1) )) ;post small blind button is visible
  {
    s = Party table waiting = %id% 
    Debug(s)
    return 1
  }
}

IsTableWaitingFulltilt(id) {
        if ( IsVisCtrl("FTCSkinButton11",id,3))
        {
          s = Full Tilt table waiting = %id%
          Debug(s)                
          return 1
        }
}

IsTableWaitingPrima(id)
{
  global PrimaColor
  CoordMode, Pixel, Screen
  WinGetPos, x, y, , ,ahk_id %id%
  PixelGetColor, col, x + 398, y + 441

  if ( IsVisCtrl("Edit1", id ) or col=PrimaColor)
  {
    IfWinActive, ahk_id %id% PixelGetColor, PrimaColor, x + 398, y + 441 
    
    s = Prima table waiting = %id%
    Debug(s)
    return 1
  } 
}

IsTableWaitingCrypto(id)
{
  if ( IsVisCtrl("Edit3", id ) )
  {
    s = Crypto table waiting = %id%
    Debug(s)  
    return 1
  }
}

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 )
        {
          s = WPEX table waiting = %id%
          Debug(s)
          return 1
        }
        If ( GetPixelCount(x+409, y+538, x+411, y+540, 0x1817B6) >= 1 )
        {
          s = WPEX table waiting = %id%
          Debug(s)
          return 1
        }
        return 0
}

IsTableWaitingPokerStars(id)
{
  global PokerStarsFoldX, PokerStarsFoldY, PokerStarsBtnColor, PokerStarsBtnColor2
  getClientRect(x, y, w, h, id)

  CoordMode, Pixel, Screen
  PixelGetColor, foldCol, x + PokerStarsFoldX * w / 1000, y + PokerStarsFoldY * h / 1000

  if(foldCol = PokerStarsBtnColor or foldCol = PokerStarsBtnColor2)
  {
    s = PokerStars table waiting = %id%
    Debug(s)
    return true
  }
}

IsTableWaitingPokerRoom(id) {
  if ( IsVisCtrl("Button28",id,3) )
  {
    s = PokerRoom table waiting = %id%
    Debug(s)
    return 1
  }
}

;-------- IsTableWaitingEx ---------

IsTableWaitingEx(id) {
If ( isIn(id, tablesPokerRoom()) ) {
  If InStr(WinGetTitle(lobbyIDPokerRoom()), "Hollywood")
    return isTableWaitingExHollywood(id)
  else
    return isTableWaitingExPokerRoom(id)
  }
WinGetClass, class, ahk_id %id%
if (class = "#32770")
        return (IsTableWaitingExParty(id))
if (class = "FTC_TableViewFull")
        return (IsTableWaitingExFulltilt(id))
if (class = "POPUP_INT_DLG_WINDOW")
        return (IsTableWaitingExPrima(id))
if (class = "ATL:00424070")
        return (IsTableWaitingExCrypto(id))
if (class = "TDlgTableHoldem")
        return (IsTableWaitingExWpex(id))
if (class = "TDlgTableStud")
        return (IsTableWaitingExWpex(id))
ps_class = Afx:400000:b:
IfInString, class, %ps_class%
        return (IsTableWaitingExPokerStars(id))
return 0
}

IsTableWaitingExParty(id) {
If ( ! IsVisCtrl("AfxWnd42u22",id,1))
  return 0

If ( IsButtonCheckedParty("AfxWnd42u22",id,3) ;fold button
 || IsButtonCheckedParty("AfxWnd42u26",id,3) ;Bet Pot button
 || IsButtonCheckedParty("AfxWnd42u25",id,3) ;Call BB button
 || IsButtonCheckedParty("Check/Fold",id,1) 
 || IsButtonCheckedParty("Check",id,3) 
 || IsButtonCheckedParty("AfxWnd42u24",id,3) 
 || IsButtonCheckedParty("Bet",id,1) 
 || IsButtonCheckedParty("Bet/Raise",id,1) 
 || IsButtonCheckedParty("Raise (",id,1) 
 || IsButtonCheckedParty("Raise Any",id,3) )
 {
   s = A Party advance button is checked
   Debug(s)
   return 0
 }
return 1
}

IsTableWaitingExFulltilt(id) {
If ( ! IsVisCtrl("FTCButton22",id,3) )
 return 0  
 
CoordMode, Pixel, Screen
WinGetPos, x1, y1,,, ahk_id %id%
x2 := x1 + 12
y2 := y1 + 12
PixelGetColor, c, x2, y2
;s = x=%x2%  y=%y2%  c=%c%
;Debug(s)

if (c <> "0xD4CDC8")
        return 0

dx := 4
dy := 4

If ( GetPixelCount(x1+501, y1+534, x1+501+dx, y1+534+dy, 0x000000) >= 1 )   ;--- fold checkbox
 return 0
If ( GetPixelCount(x1+601, y1+534, x1+601+dx, y1+534+dy, 0x000000) >= 1 )   ;--- call checkbox
 return 0
If ( GetPixelCount(x1+701, y1+534, x1+701+dx, y1+534+dy, 0x000000) >= 1 ) 
 return 0
If ( GetPixelCount(x1+601, y1+559, x1+601+dx, y1+559+dy, 0x000000) >= 1 ) 
 return 0
If ( GetPixelCount(x1+701, y1+559, x1+701+dx, y1+559+dy, 0x000000) >= 1 ) 
 return 0
return 1
}

IsTableWaitingExPrima(id) {
  CoordMode, Pixel, Screen
  WinGetPos, x, y,,, ahk_id %id%
  
  dx := 4
  dy := 4
 
  ;x2 := x+689
  ;y2 := y+522  
  ;PixelGetColor, c, x2, y2
  ;s = x=%x2%  y=%y2%  c=%c%
  ;Debug(s)
    
  If ( GetPixelCount(x+688, y+521, x+688+dx, y+521+dy, 0xFEFEFE) >= 1)     ;--- fold checkbox is visible
    {    
      If ( GetPixelCount(x+688, y+521, x+688+dx, y+521+dy, 0x000000) >= 1 )  ;--- fold checkbox is checked
       return 0
      If( GetPixelCount(x+580, y+521, x+580+dx, y+521+dy, 0x000000) >= 1 )  ;--- "check/fold" checkbox is checked
        return 0
      If ( GetPixelCount(x+580, y+590, x+580+dx, y+590+dy, 0x000000) >= 1 )  ;--- "call" checkbox is checked
       return 0
      If ( GetPixelCount(x+580, y+576, x+580+dx, y+576+dy, 0x000000) >= 1 )  ;--- "call any" checkbox is checked
       return 0
     If( GetPixelCount(x+688, y+560, x+688+dx, y+560+dy, 0x000000) >= 1 )  ;--- "bet/call minimum" checkbox is checked
      return 0
     If( GetPixelCount(x+580, y+540, x+580+dx, y+540+dy, 0x000000) >= 1 )  ;--- "check" checkbox is checked
      return 0      
      If( GetPixelCount(x+688, y+576, x+688+dx, y+576+dy, 0x000000) >= 1 )  ;--- "raise any" checkbox is checked
       return 0
    return 1
    }
  return 0
}

IsTableWaitingExCrypto(id) {
CoordMode, Pixel, Screen
  WinGetPos, x, y,,, ahk_id %id%
  
  dx := 4
  dy := 4
 
  ;x2 := x+439
  ;y2 := y+590  
  ;PixelGetColor, c, x2, y2
  ;s = x=%x2%  y=%y2%  c=%c%
  ;Debug(s)
  
  If ( GetPixelCount(x+439, y+590, x+439+dx, y+590+dy, 0x000000) >= 1)     ;--- fold checkbox is visible
  {
    If ( GetPixelCount(x+439, y+590, x+439+dx, y+590+dy, 0xFFFFFF) >= 1)    ;--- fold checkbox is checked
      return 0
    If ( GetPixelCount(x+439, y+555, x+439+dx, y+555+dy, 0xFFFFFF) >= 1)    ;--- check/fold checkbox is checked
      return 0
    If ( GetPixelCount(x+555, y+550, x+555+dx, y+550+dy, 0xFFFFFF) >= 1)    ;--- check/call checkbox is checked
      return 0
    If ( GetPixelCount(x+555, y+590, x+555+dx, y+590+dy, 0xFFFFFF) >= 1)    ;--- call any checkbox is checked
      return 0     
    return 1
  }  
}

IsTableWaitingExWpex(id) {
        If ( ! IsVisCtrl("THTMLRadioButton3",id,3))
                return 0  
        CoordMode, Pixel, Screen
        WinGetPos, x1, y1,,, ahk_id %id%          
        x2 := x1 + 12
        y2 := y1 + 12
        PixelGetColor, c, x2, y2
        ;s = x=%x2%  y=%y2%  c=%c%
        ;Debug(s)

        if (c <> "0x807874")
                return 0        
        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
}

IsTableWaitingExPokerStars(id)
{
/* This won't be working any more, it at least needs to handle resizeable tables
        CoordMode, Pixel, Screen
        WinGetPos, x1, y1,,, ahk_id %id%

        PixelGetColor, PixColor, x1+422, y1+532
        if(PixColor = "0xFFFFFF")
                return 1        

        PixelGetColor, PixColor, x1+422, y1+505
        if(PixColor = "0xFFFFFF")
                return 1
*/
        return 0
}

IsTableWaitingExPokerRoom(id) {
If ( isDisabledCtrl("Button47", id, 3) )
  return 0
CoordMode, pixel, screen
WinGetPos, x, y,,, ahk_id%id%
xList=178,298,418
y1:=529, y2:=549
Loop, Parse, xList, `,
  { Loop 2 {
        If ( pixelGetColor(x+a_loopfield+4
          , y+y%a_index%+6)="0xFFFFFF" )
          return 0
      }
  } return 1
}

IsTableWaitingExHollywood(id) {
If ( isDisabledCtrl("Button47", id, 3) )
  return 0
CoordMode, pixel, screen
WinGetPos, x, y,,, ahk_id%id%
xList=180,300,420
y1:=530, y2:=553
Loop, Parse, xList, `,
  { Loop 2 {
        If ( pixelGetColor(x+a_loopfield+6
          , y+y%a_index%+2)="0xFFFFFF" )
          return 0
      }
  } return 1
}
        

;------------ TableList -----------

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

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                                                ; ---------- Prima
WinGet, list, list, ahk_class POPUP_INT_DLG_WINDOW
Loop %list% {   
        ids := AddToList(ids,list%a_index%)
}

SetTitleMatchMode, 2                                                ; ---------- Crypto
WinGet, list, list, ahk_class ATL:00424070, , Lobby
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%)
 } 

SetTitleMatchMode, 2                                                ; ---------- PokerStars
WinGet, list, list, Logged In as, , PokerStars Lobby                
Loop %list% {
        ids := AddToList(ids,list%a_index%)
 } 

ids := addToList(ids, tablesPokerRoom())

SetTitleMatchMode, 2                                                ; ---------- iPoker
WinGet, list, list, ahk_class PTIODEVICE, , : Nickname: 
Loop %list%{
        ids := AddToList(ids,list%a_index%)
 } 


return ids
}

;----- GuiList -----

GuiList() {
local i
i = 19
Loop 20 {
                i++
                GuiList := AddToList(GuiList, i)
        }
return GuiList
}

;--------- GetColor() ------------

;Returns the color given %time_left% seconds remaining.
GetColor(time_left) {   ;by Sam
global highLightColor

max_time = 25
num_colors = 5

If (time_left >= max_time)
        return highLightColor

color_w := % max_time / (num_colors - 1)
;Find where the time lies between colors and how far.
color_cat := Floor(time_left/color_w)
color_frac_up := % Floor( 144 * (( time_left - ( color_cat * color_w )) / color_w ))
color_frac_down := % 144 - color_frac_up
hex_up := IntToHex(Floor(color_frac_up))
hex_down := IntToHex(Floor(color_frac_down))
;Red - Yellow
If color_cat = 0
        color = FF%hex_up%00
;Yellow -Green
If color_cat = 1
        color = %hex_down%FF00
;Green -Blue
If color_cat = 2
        color = 00%hex_down%%hex_up%
;Blue - Black
If color_cat = 3
        color = 0000%hex_down%
return color
}

;------- ColorGui ----------

ColorGui() {
global
Gui, +Lastfound +Toolwindow +AlwaysOnTop
Gui, Color, White
Gui, Font, bold, Comic Sans MS
Gui, Margin, 5, 5
Gui, Add, Text, Section, Color:
Gui, Add, Text,, FlashColor:
Gui, Add, ListView, 
                        (
                        vhighLightColor ys -Hdr r1 -Multi 
                        w100 Background%highLightColor% 
                        Altsubmit gConfColor
                        ), 1|2
Gui, Add, ListView, 
                        (
                        vflashColor -Hdr r1 -Multi 
                        w100 Background%flashColor% 
                        Altsubmit gConfColor
                        ), 1|2
Gui, Add, Button, xs h20 +default, Okay
Gui, Show,, TableHighlighter - Colors
WinWaitClose
return

ConfColor:
If ( a_guiControlEvent != "normal" )
        return
c := ColorPicker(%a_guiControl%, "", 1)
If ( c ) {
        If ( a_guiControl = "highLightColor" )
                highLightColor = %c%
        else
                flashColor = %c%
        GuiControl, +Background%c%, %a_guiControl%
        IniWrite, %c% , %ini%, Settings, %a_guiControl%
        Gui +Lastfound
        WinSet Redraw
}
return

ButtonOkay:
GuiClose:
Gui Destroy
return
}

;-------- IntToHex --------

;Takes an int and gives a hex.
IntToHex(int) {
SetFormat, integer, hex
int += 0
SetFormat, integer, d
Stringright,int,int,StrLen(int)-2
If (StrLen(int)=1)
        int=0%int%
return int
}

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

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

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

CategoryAutoHotKey

TableHighlighter (last edited 2007-12-18 18:53:37 by Nrmn)