Here is Roland's old script. For some reason, I can only get it to work on Hyper Simple, not Classic theme. Its from 2008, maybe someone can help modify it to work with the current Pstars version.
BetTimer Stars
; date: 3:32 PM Thursday, July 31, 2008
; AHK version: 1.0.47.06
; author: Roland
; email:
roland@overcards.com
#NoEnv
#SingleInstance force
#Include %a_scriptDir%
#Include functions_v3.ahk
SetWorkingDir %a_scriptDir%
CoordMode, pixel, screen
OnMessage(0x201, "WM_LBUTTONDOWN") ; /// enable drag and drop
version:="1.02"
pixelColors:="0xCDC3B2,0xDFD9CE" ; /// these work for the hyper-simple theme
pixelX:=430, pixelY:=510
ini:="BetTimer.ini"
IniRead, font, % ini, style, font, % "face:Comic Sans MS;size:10;bold;;;;bg:400040;fg:FFFFFF"
IniRead, frame, % ini, style, frame, 1
IniRead, #ranges, % ini, ranges, #ranges, 1
Loop, % #ranges {
i:=a_index-1
IniRead, thisRange, % ini, ranges, range%i%, % "0;FFFFFF;000000"
StringSplit, d, thisRange, `;
range%i%time:=d1
range%i%fg:=d2
range%i%bg:=d3
}
Menu, Tray, noStandard
Menu, Tray, Add, &Settings, Settings
Menu, Tray, Default, &Settings
Menu, Tray, Add
Menu, Tray, Add, &About, About
Menu, Tray, Add, &Help, Help
Menu, Tray, Add
Menu, Tray, Add, &Donate, Donate
Menu, Tray, Add
Menu, Tray, Add, E&xit, Exit
Menu, Tray, Tip, BetTimer Stars v%version%
SetTimer, timer, 50
return
; ============================
Settings:
RunWait settings.ahk
Reload
About
:
TrayTip, BetTimer Stars v%version%, Author: Roland`nE-mail:
roland@overcards.com,, 1
return
Help:
Run % web() "http://www.overcards.com/wiki/moin.cgi/BetTimerStars"
return
Donate:
donate()
return
Exit:
exitApp
; ============================
timer:
timer()
return
; /// checks on all tables, maintaining a list
; /// of waiting tables and their time
timer() {
local tables, tbl, time
static waiting
tables:=rmt(tablesStars()) ; /// get a list of all tables, excluding minimized
Loop, Parse, tables, `,
{ tbl:=a_loopfield
if isWaiting(tbl) { ; /// if it is waiting
if !isIn(tbl, waiting) ; /// and not yet in list
listAdd(waiting, tbl), startTime%tbl%:=a_tickCount
} else { ; /// otherwise, delete it from list
if isIn(tbl, waiting)
listDelItem(waiting, tbl), hide(tbl) ; /// remove from list and hide gui
}
if hasWinMoved(tbl, 1) ; /// 1 for sizeOnly -> has table change size?
setPos(tbl) ; /// adjust gui position
}
Loop, Parse, waiting, `,
{ time:=round((a_tickCount-startTime%a_loopfield%)/1000) ; /// find the time
if ( time!=timePrev%a_loopfield% ) ; /// if needs updating..
update(a_loopfield, time), timePrev%a_loopfield%:=time ; /// ...update
}
}
; ============================
; /// update timer
update(tbl, time) {
local gui,range#
if !( gui%tbl% ) ; /// do we already have a gui?
gui%tbl%:=create(tbl), setPos(tbl) ; /// new table, create new gui and set positions
gui:=gui%tbl%
Gui, %gui%:default
GuiControl,, time, % time ; /// change the time
range#:=getRange#(time) ; /// get the range#
if ( range#!=range#Prev%tbl% ) { ; /// if we need to updae colors.
Gui, Color, % range%range#%bg
Gui, Font, % "c" range%range#%fg
GuiControl, Font, time
range#Prev%tbl%:=range#
} ifNotEqual, time, 0, Gui, Show, noActivate ; /// show gui
}
; ============================
getRange#(time) {
local range#:=0
Loop % #ranges {
i:=a_index-1
if ( time>=range%i%time )
range#:=i
} return range#
}
; ============================
; /// hides the gui
hide(tbl) {
local gui
gui:=gui%tbl%
Gui, %gui%: Hide
}
; ============================
; /// creates a gui for %tbl%
create(tbl) {
local gui
gui:=freeGui() ; /// find a free gui #
tbl%gui%:=tbl ; /// create reference from gui -> table
Gui, %gui%:default
Gui % "+toolwindow -caption " ( frame ? "+0x800000" : "" )
Gui, Margin, 0, 0
setFont(font) ; /// set the font
setParent(tbl, gui) ; /// make it a child window of target
Gui, Add, Text, vtime center, 00
Gui, Show, hide, BetTimerGui%tbl% ; /// show it in hidden state
return gui
}
; ============================
; /// changes the position of the gui
setPos(tbl) {
local x, y, w, h, gui
gui:=gui%tbl%
ifEqual, gui,, return ; /// no gui yet
getClientRect(x, y, w, h, tbl) ; /// get size of client area
IniRead, xPos, % ini, position, xPos, 582
IniRead, yPos, % ini, position, yPos, 448
x:=rxs(xPos, w), y:=rys(yPos, h) ; /// relative positions
Gui, %gui%: Show, x%x% y%y% noActivate hide ; /// set new position
}
; ============================
; /// deag & drop, save new position
WM_LBUTTONDOWN() {
local gx, gy, x, y, w
if !inStr(winGetTitle(winExist()), "BetTimerGui")
return
PostMessage, 0xA1, 2 ; /// for the dragging
KeyWait, LButton ; /// wait till user releases mouse button
WinGetPos, gx, gy ; /// get gui position
getClientRect(x, y, w, h, tbl%a_gui%) ; get table position
if ( w!=792 ) { ; /// not of dedault size
tip("Table is not of default size, so change will not be saved.", 3)
return
} IniWrite, % gx-x, % ini, position, xPos
IniWrite, % gy-y, % ini, position, yPos
setPos(tbl%gui%) ; /// set new position
tip("New position saved.", 3)
}
; ==============================
; /// will work for any mono-colored theme if you set the pixelColors
; /// adjusted to work when the mouse is over the
; /// fold button too
isWaiting(win) {
local x, y, w, h
if inStr(winGetTitle(win), "No Limit")
return isVisCtrl("PokerStarsSliderEditorClass1", win)
getClientRect(x, y, w, h, win)
x+=rxs(pixelX, w)
y+=rys(pixelY, h)
return ( isIn(pixelGetColor(x, y), pixelColors) )
}