Here is what I have sofar (PartyPoker, NLHE cashgame). I simply took code from the original BetPot and adapted it, so thanks to all the contributors!
Wheel: change in bb
ctrl+Wheel: change in sb
left MouseButton+WheelDown: 1/2pot
left MouseButton+WheelUp: 2/3pot
right MouseButton+WheelDown: 3/4pot
right MouseButton+WheelUp: pot
Option to move MouseCursor to BetButton automatically.
Option to "Act on active table", instead of table under cursor.
Code:
#NoEnv
#SingleInstance force
#MaxHotkeysPerInterval 300|
SetTitleMatchMode, 2
BS_OnActiveTable=0
BS_moveMouse=1
#if (MouseIsOver("NL Hold ahk_exe PartyGaming.exe"))
~WheelUp::AlterAmount(getid(),"up")
~WheelDown::AlterAmount(getid(),"down")
~^WheelUp::AlterAmount(getid(),"up", "1", "sb")
^~WheelDown::AlterAmount(getid(),"down", "1", "sb")
~LButton & ~WheelDown::AlterAmount(getid(),"up", "0.5", "pot")
~LButton & ~WheelUp::AlterAmount(getid(),"up", "0.66", "pot")
~RButton & ~WheelDown::AlterAmount(getid(),"up", "0.75", "pot")
~RButton & ~WheelUp::AlterAmount(getid(),"up", "1", "pot")
return
AlterAmount(id, dir="", frac=1, unit="")
{ global party_uses_commas_for_decimals, BS_moveMouse
IfWinExist, ahk_id%id%
{ WinGetTitle, title, ahk_id%id%
if InStr(title, "/")
StringTrimLeft, bb, title, InStr(title, "/", true, 1)
if InStr(bb, ",")
{ StringReplace, bb, bb, `,,., All
party_uses_commas_for_decimals:=1
} else party_uses_commas_for_decimals:=0
StringReplace,bb,bb,$,,1
sb := sb(bb)
} else {
Send {%A_ThisHotkey%}
return
}
If (unit = "" or unit = "bb")
unit := bb
else if (unit = "sb")
unit := sb
else if (unit = "pot")
{ pot := 0
call := 0
hero_bet := 0
street := "pre"
hero_position := ""
open := 0
max := 10000000
IfWinExist, ahk_id%id%
{ ControlGetText, pot, Static16, ahk_id %id%
StringReplace,pot,pot,$,,1
StringTrimLeft, pot, pot, % InStr(pot,": ")
if (party_uses_commas_for_decimals)
StringReplace, pot, pot, `,,., All
unit:=pot
}
}
amount:=unit*frac
if (unit = pot)
amount-=bb
;traytip,, % "Pot: " . pot . "`r`n" . "frac: " . frac . "`r`n" . "unit: " . unit . "`r`n" . "amount: " . amount
if (dir="down")
amount:=amount-(2*amount)
IfWinExist, ahk_id%id%
{ ControlGetText, t, Edit2, ahk_id%id%
if (party_uses_commas_for_decimals)
StringReplace, t, t, `,,., All
else StringReplace, t, t, `,,, All
t+=amount
if (t < 0)
t := 0
transform, t, Round, t, 2
if (party_uses_commas_for_decimals)
StringReplace, t, t, .,`,, All
ControlSetText, Edit2, %t%, ahk_id%id%
if (BS_moveMouse)
{ ControlGet, vis, visible, , AfxWnd90u19, ahk_id%id%
if (vis)
{ IfWinNotActive, ahk_id%id%
WinActivate, ahk_id%id%
WinWaitActive, ahk_id%id% ,,3
If ErrorLevel
return
ControlGetPos, x, y, , , AfxWnd90u19, ahk_id%id%
MouseMove, x + 15, y + 10
}
}
}
}
sb(bb)
{ If bb = .25
sb := .10
else if bb = 15
sb = 10
else if bb = 0.05
sb = 0.02
else
sb := bb/2
if (sb > 1)
sb := Round(sb, 0)
else sb := Round(sb, 2)
return sb
}
getid()
{ global BS_OnActiveTable
id:= ""
if (BS_OnActiveTable = 1)
WinGet,id,,A
else MouseGetPos, , , id
return id
}
MouseIsOver(WinTitle)
{ MouseGetPos,,, id
return WinExist(WinTitle . " ahk_id " . id)
}
Hope that helps somebody.
Also, if anyone could help with "street", "hero_position" and "open", please do so
Sorry for the lack of comments in the script. If anyone is interested, Ill change that.
Cheers
Last edited by Show`nTell; 10-18-2013 at 03:50 PM.