;;;;;;;;;;;;;;;;; CODE STARTS HERE ;___ FOR Auto Hotkey n00bs: ;___ Any line that contains a ";" - this is the symbol for "comment" ;___ Anything following the ";", until the next line, is not processed. ;___ These lines are comments, for example - as are all the Msgbox ;___ commands present in this script. You can uncomment the Msgbox lines ;___ if you are altering the script and want to see what values are at ;___ that point of the function. ;___ ;___ Enjoy!, ;___ ;___ _dave_ #NoEnv SendMode Input SetTitleMatchMode 2 GroupAdd, tables, Good Luck,,, : Poker Lobby ;___ Change below to change how the table to act upon is detected. ;___ Default is 0 - table under cursor - set to 1 so that the ;___ active window receives the commands - try changing this if ;___ you have problems with the bet-pot / wheel not working at all. act_only_on_active_table :=0 return ;___ END AUTO EXECUTE SECTION ;____ SET HOTKEY BUTTONS BELOW ~WheelUp:: ;_______ Increase bet by 1 BB id := getid() IfWinExist, ahk_id%id% ahk_group tables { SetText(id,"up") Sleep -1 } return ~WheelDown:: ;_______ Decrease bet by 1 BB id := getid() IfWinExist, ahk_id%id% ahk_group tables { SetText(id,"down") Sleep -1 } return ~+WheelUp:: ;_______ Shift & WheelUp - Increase bet by 0.5 BB id := getid() IfWinExist, ahk_id%id% ahk_group tables { SetText(id,"up",0.5) Sleep -1 } return ~+WheelDown:: ;___ Shift & WheelDown - Decrease bet by 0.5 BB id := getid() IfWinExist, ahk_id%id% ahk_group tables { SetText(id,"down",0.5) Sleep -1 } return ~^WheelUp:: ;_______ CTRL & WheelUp - Increase bet by 5 BB id := getid() IfWinExist, ahk_id%id% ahk_group tables { SetText(id,"up",5) Sleep -1 } return ~^WheelDown:: ;_______ CTRL & WheelDown - Decrease bet by 5 BB id := getid() IfWinExist, ahk_id%id% ahk_group tables { SetText(id,"down",5) Sleep -1 } return ~XButton1:: ;__Bet 7/9 pot, deduct rake. id := getid() IfWinExist, ahk_id%id% ahk_group tables { Pot(id, 7/9, 0, 0, 1) } return ~XButton2:: ;__Bet 5/9 pot, deduct rake. id := getid() IfWinExist, ahk_id%id% ahk_group tables { Pot(id, 5/9, 0, 0, 1) } return ~MButton:: ;__Bet full pot, round to 2dp, autobet, deduct rake, use 4xBB+1/limper id := getid() IfWinExist, ahk_id%id% ahk_group tables { Pot(id, 1, 0, 0, 1) } return ~^MButton:: ;__ CTRL Middle click - Auto-Bet ALL-IN!!! 9999x the pot should enough :) id := getid() IfWinExist, ahk_id%id% ahk_group tables { Pot(id, 9999, 2, 0) } return ;___ END HOTKEY DEFENITIONS ;___ ____POT FUNCTION INSTRUCTIONS____ ;___ ;___ Function: Pot(id, frac=1, round_bet=2, auto_bet=0, deduct_rake=1, open_adjust=0) ; ;___ The Pot() function takes up to 6 paremeters. ;___ The first parameter is Required, the rest are optional (may be omitted) ;___ You do however need to specify optional parameters if you wish to ;___ set a value for a later parameter. ;___ ;___ These parameters are as follows: ;___ ;___ 1. id - unique ID# of the table to act on - retrieved via getid() function ;___ in this script ;___ ;___ 2. frac - Amount of pot to bet, can be fraction or decimal notation ;___ eg 1 = full-pot, 3/4 or 0.75 = 3/4 pot, and so on. ;___ DEFAULT is 1 (full pot) ;___ ;___ 3. round_bet - Decimal places to round to. Specify 0 to always bet whole ;___ Dollars. Specify 1 to round to the nearest 10c. ;___ DEFAULT is 2 (two decimal places, eg $3.43) ;___ SPECIAL OPTIONS: specify "smallblind" or "bigblind" ;___ (with quotes) to round to multiple of the current SB / BB ;___ ;___ 4. auto_bet - Set to 1 to auto-hit the bet/raise button - useful if you ;___ are confident in the size of bets this script makes... ;___ Set to -1 to not set anything, just calculate then return ;___ the pot-size - useful if using Pot() within other functions, ;___ such as the wheel up/down SetText() function :) ;___ DEFAULT is 0 - do not auto-bet (just fill in the textbox) ;___ ;___ 5. deduct rake - takes account of rake during potsize calculations. ;___ capped by the max_rake variable inside the pot() function. ;___ DEFAULT is 0 - no rake adjustment. Set to 1 to enable this, ;___ and take a look at max_rake, set as appropriate (default $3) ;___ ;___ 6. open_adjust - allows an override of the pot-sized bet should action be ;___ pre-flop, and no one has raised - limpers are ignored. ;___ this allows for players to set a preferred adjustment ;___ in $ to apply when they are the opener. ;___ DEFAULT is 0 - no adjustment. ;___ SPECIAL OPTIONS: specify "ssnl" (with quotes) to adjust an ;___ openraise by 4xBB + 1 / limper - standard SSNL guidelines ;___ ;___ ;___ ____SetText FUNCTION INSTRUCTIONS____ ;___ ;___ Function: SetText(id, dir, frac=1, unit="") ;___ ;___ The SetText() function takes up to 4 parameters. ;___ The first 2 are required, the rest are optional (may be omitted) ;___ You do however need to specify optional paremeters if you wish to ;___ set a value for a later paremeter. ;___ ;___ These parameters are as follows: ;___ ;___ 1. id - unique ID# of the table to act on - retrieved via getid() function ;___ in this script ;___ ;___ 2. dir - REQUIRED - "up" or "down" - direction in which to adjust the bet ;___ ;___ 3. frac - Fraction of unit to enter, can be fraction or decimal notation ;___ eg 1 = full-amount, 3/4 or 0.75 and so on. ;___ DEFAULT is 1 (full amount) ;___ ;___ 4. unit - Amount to adjust bet by per click - ypu can specify a number here ;___ amd that number of dollars will be used for bet adjustments. ;___ DEFAULT is 1 BB (big blind) ;___ SPECIAL OPTIONS: specify "sb" or "bb" ;___ (with quotes) to use the current SB / BB ;___ ;____ FUNCTIONS BELOW - DO NOT EDIT (unless you want to change behaviour) ;____ this function returns the size of the pot ;____ with rake (optionally) subtracted ;____ and pot fraction as an (optional) argument Pot(id, frac=1, round_bet=2, auto_bet=0, deduct_rake=1, open_adjust=0 ) { WinGetTitle, title, ahk_id%id% ;Msgbox %round_bet% nl_actions = calls [$,raises [$,bets [$,all-In [$,posts ante [$,posts small blind [$,posts big blind [$, posts big blind + dead [$ pot := 0 notraked := 0 maxrake := 3 preflop_openraise := 1 hero_bet := 0 bb := 0 sb := 0 ;______ Get hero's screen name from the window title StringMid, hero, title, InStr(title, "Luck ") + 5 StringMid, hero, hero, InStr(hero, "!")-2,, L ;Msgbox %hero% targetStr := "No player chat" ControlGet, currStr, Choice,, Combobox1, ahk_id%id% If currStr <> %targetStr% { Control, ChooseString, %targetStr%, Combobox1, ahk_id%id% Loop { ControlGetText, hh, RICHEDIT1, ahk_id%id% If hh { break } } Control, ChooseString, %currStr%, Combobox1, ahk_id%id% } else { ControlGetText, hh, RICHEDIT1, ahk_id%id% } StringTrimLeft, hh, hh, InStr(hh, "starts.", true, 0) ;Msgbox %hh% Loop, Parse, hh, `n { If a_loopfield contains %nl_actions% { StringMid, amount, a_loopfield, InStr(a_loopfield, "[") + 2, (InStr(a_loopfield, "]")-1) - InStr(a_loopfield, "[") - 1 pot += amount IfInString, a_loopfield, posts small blind [$ { StringMid, amount, a_loopfield, InStr(a_loopfield, "[") + 2, (InStr(a_loopfield, "]")-1) - InStr(a_loopfield, "[") - 1 sb := amount } Else IfInString, a_loopfield, posts big blind [$ { StringMid, amount, a_loopfield, InStr(a_loopfield, "[") + 2, (InStr(a_loopfield, "]")-1) - InStr(a_loopfield, "[") - 1 bb := amount } Else If(open_adjust <> 0 AND preflop_openraise = 1 AND InStr(a_loopfield, "raises [$", true, 0)) { preflop_openraise := 0 ;Msgbox "Pre flop Raise" } Else If(open_adjust <> 0 AND preflop_openraise = 1 AND InStr(a_loopfield, "all-In [$", true, 0)) { preflop_openraise := 0 ;Msgbox "Pre flop All-In" } } } hh2 := hh If InStr(hh2, "** Dealing River **") { StringTrimLeft, hh2, hh2, InStr(hh, "** Dealing River **", true, 0) preflop_openraise := 0 } Else If InStr(hh2, "** Dealing Turn **") { StringTrimLeft, hh2, hh2, InStr(hh, "** Dealing Turn **", true, 0) preflop_openraise := 0 } Else If InStr(hh2, "** Dealing Flop **") { StringTrimLeft, hh2, hh2, InStr(hh, "** Dealing Flop **", true, 0) preflop_openraise := 0 } Loop, Parse, hh2, `n { If a_loopfield contains %hero% { ;Msgbox %a_loopfield% If a_loopfield contains %nl_actions% { StringMid, amount, a_loopfield, InStr(a_loopfield, "[") + 2, (InStr(a_loopfield, "]")-1) - InStr(a_loopfield, "[") - 1 hero_bet += amount } } } ;Msgbox %hero_bet% ;Msgbox %deduct_rake% If(deduct_rake <> 0 AND InStr(hh, "** Dealing Flop")) { StringTrimLeft, hh, hh, InStr(hh, "** Dealing ", true, 0) c := InStr, hh, "** Dealing " ;Msgbox %hh% Loop, Parse, hh, `n { If a_loopfield contains %nl_actions% { StringMid, amount, a_loopfield, InStr(a_loopfield, "[") + 2, (InStr(a_loopfield, "]")-1) - InStr(a_loopfield, "[") - 1 notraked += amount } } rake := Floor(pot - notraked) * 0.05 If rake > %maxrake% { rake := maxrake } pot := pot - rake } ;MsgBox %pot% ;Msgbox hero contributions - $%hero_bet% If(preflop_openraise = 1 AND open_adjust = "ssnl") { ;Msgbox, "Adjusting PFR to SSNL style 4bb+1/limper" pot := pot + bb - sb } Else If(preflop_openraise = 1 AND open_adjust <> 0) { ;Msgbox, Adjusting PFR by $%open_adjust% pot := pot + open_adjust } match_mode = %a_titlematchmode% SettitleMatchMode 2 ControlGetText, call, Call, ahk_id%id% SettitleMatchMode %match_mode% StringMid, call, call, InStr(call, "(") + 1, InStr(call, ")") - InStr(call, "(") - 1 If call <> { ;Msgbox to call - $%call% pot := ((pot + call + hero_bet)*frac )+ call ;+ hero_bet } else { pot := ((pot + hero_bet)*frac) ;+ hero_bet } If(round_bet = "smallblind") { ;Msgbox "Rounding to SMALL blind" pot := Floor(pot / sb) * sb } Else If(round_bet = "bigblind") { ;Msgbox "Rounding to BIG blind" pot := Floor(pot / bb) * bb } Else { ;Msgbox Rounding to %round_bet% decimal places pot := Round(pot, round_bet) } If (auto_bet > -1) { ControlSetText, Edit3, %pot%, ahk_id%id% Sleep -1 } If(auto_bet = 1) { ControlClick, AfxWnd4219, ahk_id%id% } ;Msgbox %pot% return pot } SetText(id, dir, frac=1, unit="") { WinGetTitle, title, ahk_id%id% If (InStr(title, "NL") <> 0 AND InStr(title, "Buy-in") = 0) ;___if "NL" is in the title but "Buy-in" isn't... { StringMid, buyin, title, InStr(title, "$")+1, (InStr(title, ".") - InStr(title,"$") - 0) ;___retrieve buy-in ;Msgbox, %bb% } Else { return } bb := buyin / 100 sb := bb / 2 If(bb = 0.25) ;___this is for .10/.25 (unusual small SB) { sb := 0.1 } Else If(bb = 0.05) ;___this is for .02/.04 (beginner's game plays 125bb deep???) { bb := 0.04 sb := 0.02 } If (unit = "" or unit = "bb") { unit := bb } Else If (unit = = "sb") { unit := sb } amount := unit * frac ;Msgbox, %amount% ControlGetText, t, Edit3, ahk_id%id% ;___retrieve the text from the edit next to the slider If(dir = "up") { t := t + amount } Else If (dir = "down") { t := t - amount } If (t < 0) { t := 0 } If(t >= 0) { t := Round(t, 3) ControlSetText, Edit3, %t%, ahk_id%id% } } ;___ This function is used to select method of table detection getid() { global act_only_on_active_table id := "" If (act_only_on_active_table = 1) { ;MsgBox, Active Table Mode WinGet,id,,A } Else { ;MsgBox, Table Under Cursor Mode MouseGetPos, , , id } return id } ;;;;;;;;;;;;;;;;; CODE ENDS HERE