Open Side Menu Go to the Top
Register
New Donationware Software: Entraction helper script New Donationware Software: Entraction helper script

05-16-2010 , 04:31 PM
I'm glad you worked it out. Good luck on the tables
New Donationware Software: Entraction helper script Quote
05-18-2010 , 11:16 AM
OSRichard,

ive got a problem. i installed the latest update from HEM 1.11.01 so everytime i get the HUD opened the enthelper isnt working. can u help me pls
New Donationware Software: Entraction helper script Quote
05-18-2010 , 12:13 PM
Hi, maybe you have the same problem ghaz reported earlier. Have you checked that both HM and the autohotkey program have administrator privileges?
New Donationware Software: Entraction helper script Quote
05-18-2010 , 12:49 PM
hi, yes i have checked that but still not working
New Donationware Software: Entraction helper script Quote
05-18-2010 , 12:55 PM
Well, I've just upgraded HM also, and it works for me.

How do you use de ahk script? Did you compile it and made an exe file that you run as an administrator, or are you using the ahk directly, launching autohotkey.exe from Program Files as an admin?
New Donationware Software: Entraction helper script Quote
05-18-2010 , 02:03 PM
i copied the code into Editor and renamed it into EntHelper. i run it with autohotkey.exe which i launched as an admin

Last edited by r4zor111; 05-18-2010 at 02:15 PM.
New Donationware Software: Entraction helper script Quote
06-01-2010 , 11:52 AM
After todays entraction update, fold doesn't seem working.
New Donationware Software: Entraction helper script Quote
06-01-2010 , 12:41 PM
Here is an updated version, that should work:

Code:
; Version 0.3R5

; percentage of the window width and height for center of buttons
foldX := 0.48
foldY := 0.95

checkX := 0.62
checkY := 0.95

raiseX := 0.77
raiseY := 0.95

potX := 0.71
potY := 0.86

allinX := 0.79
allinY := 0.86

betBoxX := 0.47
betBoxY := 0.82

autoRebuyX := 0.88
autoRebuyY := 0.88

sitOutX := 0.88
sitOutY := 0.94

noBlindsX := 0.88
noBlindsY := 0.97

sitInX := 0.6
sitInY := 0.9

checkForFreeX := 0.58
checkForFreeY := 0.74

maxBuyInX := 0.31
maxBuyInY := 0.44

confirmBuyInX := 0.7
confirmBuyInY := 0.89

rebuyOkX := 0.49
rebuyOkY := 0.74

confirmAllInX := 0.41
confirmAllInY := 0.73

confirmLeaveX := 0.45
confirmLeaveY := 0.73

confirmWaiting1X := 0.5
confirmWaiting1Y := 0.86

confirmWaiting2X := 0.41
confirmWaiting2Y := 0.86
; End general settings

#SingleInstance, Force
#NoEnv
#MaxHotkeysPerInterval 200
SendMode Input
SetTitleMatchMode 3
SetBatchLines -1

Menu, Tray, NoStandard
Menu, Tray, Add, Settings, Settings
Menu, Tray, Default, Settings
Menu, Tray, Add, Reload, Reload
Menu, Tray, Add, About, About
Menu, Tray, Add, Exit, Close

readIniFile()
defineHotKeys()

if (allwaysCheckForFree = 1)
    GoSub activateAllwaysCheckForFree

if (autoBuyInMax = 1)
    GoSub autoBuyInForMax
    
if (autoConfirmRebuy = 1)
    GoSub activateAutoConfirmRebuy
    
if (autoConfirmAllIn = 1)
    GoSub activateAutoConfirmAllIn
    
if (autoConfirmLeave = 1)
    GoSub activateAutoConfirmLeave
     
if (autoConfirmWaitingList = 1)
    GoSub activateAutoConfirmWaitingList

return

    
; GUI to choose settings
Settings:
    ; add tabs
    Gui, Add, Tab, x-4 y0 w500 h750 , Table Hotkeys|Other Hotkeys|Options
    
    Gui, Add, Text, x10 y32 w100 h20 , Fold
    Gui, Add, Edit, x90 y30 w90 h20 vFold, %Fold%
    Gui, Add, Text, x10 y52 w100 h20 , Check/Call
    Gui, Add, Edit, x90 y50 w90 h20 vCheckCall, %CheckCall%
    Gui, Add, Text, x10 y72 w100 h20 , Raise
    Gui, Add, Edit, x90 y70 w90 h20 vRaise, %Raise%
    Gui, Add, Text, x10 y92 w100 h20 , All In
    Gui, Add, Edit, x90 y90 w90 h20 vBetAllIn, %BetAllIn%
    Gui, Add, CheckBox, x195 y90 w50 h20 Checked%InstantAllIn% vInstantAllIn, Instant
    Gui, Add, Text, x10 y112 w100 h20 , Bet Full Pot
    Gui, Add, Edit, x90 y110 w90 h20 vBetFullPot, %BetFullPot%
    Gui, Add, CheckBox, x195 y110 w50 h20 Checked%InstantFullPot% vInstantFullPot, Instant
    Gui, Add, Text, x10 y152 w20 h20 , Bet
    Gui, Add, Edit, x30 y150 w25 h20 vpercentage1, %percentage1%
    Gui, Add, Text, x56 y152 w40 h20 , `% pot
    Gui, Add, Edit, x90 y150 w90 h20 vBetPotPercentage1, %BetPotPercentage1%
    Gui, Add, Text, x10 y172 w20 h20 , Bet
    Gui, Add, Edit, x30 y170 w25 h20 vpercentage2, %percentage2%
    Gui, Add, Text, x56 y172 w40 h20 , `% pot
    Gui, Add, Edit, x90 y170 w90 h20 vBetPotPercentage2, %BetPotPercentage2%
    Gui, Add, Text, x10 y192 w20 h20 , Bet
    Gui, Add, Edit, x30 y190 w25 h20 vpercentage3, %percentage3%
    Gui, Add, Text, x56 y192 w40 h20 , `% pot
    Gui, Add, Edit, x90 y190 w90 h20 vBetPotPercentage3, %BetPotPercentage3%
    Gui, Add, Text, x10 y212 w20 h20 , Bet
    Gui, Add, Edit, x30 y210 w25 h20 vpercentage4, %percentage4%
    Gui, Add, Text, x56 y212 w40 h20 , `% pot
    Gui, Add, Edit, x90 y210 w90 h20 vBetPotPercentage4, %BetPotPercentage4%
    Gui, Add, Text, x10 y252 w20 h20 , Bet
    Gui, Add, Edit, x30 y250 w25 h20 vbbAmount1, %bbAmount1%
    Gui, Add, Text, x56 y252 w40 h20 , BBs
    Gui, Add, Edit, x90 y250 w90 h20 vBetBBAmount1, %BetBBAmount1%
    Gui, Add, Text, x10 y272 w20 h20 , Bet
    Gui, Add, Edit, x30 y270 w25 h20 vbbAmount2, %bbAmount2%
    Gui, Add, Text, x56 y272 w40 h20 , BBs
    Gui, Add, Edit, x90 y270 w90 h20 vBetBBAmount2, %BetBBAmount2%
    Gui, Add, Text, x10 y292 w100 h20 , Add 1 BB
    Gui, Add, Edit, x90 y290 w90 h20 vAdd1BB, %Add1BB%
    Gui, Add, Text, x10 y312 w100 h20 , Subtract 1 BB
    Gui, Add, Edit, x90 y310 w90 h20 vSubtract1BB, %Subtract1BB%
    Gui, Add, Text, x10 y332 w100 h20 , Add 1 SB
    Gui, Add, Edit, x90 y330 w90 h20 vAdd1SB, %Add1SB%
    Gui, Add, Text, x10 y352 w100 h20 , Subtract1 SB
    Gui, Add, Edit, x90 y350 w90 h20 vSubtract1SB, %Subtract1SB%
    
    Gui, Add, Button, x75 y400 w50 h20 gSave, Save 
    Gui, Add, Button, x135 y400 w50 h20 gCancel, Cancel
    
    Gui, Tab, Other Hotkeys
    Gui, Add, Text, x5 y32 w100 h20 , Auto Rebuy
    Gui, Add, Edit, x85 y30 w90 h20 vAutoRebuy, %AutoRebuy%
    Gui, Add, Text, x5 y52 w100 h20 , Sit Out
    Gui, Add, Edit, x85 y50 w90 h20 vSitOut, %SitOut%
    Gui, Add, Text, x5 y72 w100 h20 , No More Blinds
    Gui, Add, Edit, x85 y70 w90 h20 vNoMoreBlinds, %NoMoreBlinds%
    Gui, Add, Text, x5 y92 w100 h20 , Sit In
    Gui, Add, Edit, x85 y90 w90 h20 vSitIn, %SitIn%
    Gui, Add, Text, x5 y132 w100 h20 , Exit Application
    Gui, Add, Edit, x85 y130 w90 h20 vExitApplication, %ExitApplication%
    
    Gui, Add, Button, x75 y400 w50 h20 gSave, Save 
    Gui, Add, Button, x135 y400 w50 h20 gCancel, Cancel
    
    Gui, Tab, Options
    Gui, Add, CheckBox, x5 y30 w230 h20 Checked%actOnActiveTable% vactOnActiveTable, Act on active table (or table under mouse)
    Gui, Add, CheckBox, x5 y50 w200 h20 Checked%allwaysCheckForFree% vallwaysCheckForFree, Allways check for free
    Gui, Add, CheckBox, x5 y70 w200 h20 Checked%autoBuyInMax% vautoBuyInMax, Auto buy in for table maximum
    Gui, Add, CheckBox, x5 y90 w200 h20 Checked%autoConfirmRebuy% vautoConfirmRebuy, Auto confirm rebuy pop-up
    Gui, Add, CheckBox, x5 y110 w200 h20 Checked%autoConfirmAllIn% vautoConfirmAllIn, Auto confirm large all-in
    Gui, Add, CheckBox, x5 y130 w200 h20 Checked%autoConfirmLeave% vautoConfirmLeave, Auto confirm leave table pop-up
    Gui, Add, CheckBox, x5 y150 w200 h20 Checked%autoConfirmWaitingList% vautoConfirmWaitingList, Auto confirm waiting list pop-ups
    
    Gui, Add, Button, x75 y400 w50 h20 gSave, Save 
    Gui, Add, Button, x135 y400 w50 h20 gCancel, Cancel
    
    Gui, Show, x100 y50 h450 w260, EntHelper Settings
return

Save:
    Gui, Submit
    FileDelete, EntHelper.ini
    writeIni()
    Reload
return

Cancel:
    Gui, Destroy
return

GuiClose:
    Gui, Destroy
return

Fold:
    pressFoldButton(getTableID(), Fold)
return

CheckCall:
    pressCheckButton(getTableID(), CheckCall)
return

Raise:
    pressRaiseButton(getTableID(), Raise)
return

BetPotPercentage1:
    bet(getTableID(), percentage1, BetPotPercentage1)
return

BetPotPercentage2:
    bet(getTableID(), percentage2, BetPotPercentage2)
return

BetPotPercentage3:
    bet(getTableID(), percentage3, BetPotPercentage3)
return

BetPotPercentage4:
    bet(getTableID(), percentage4, BetPotPercentage4)
return

BetBBAmount1:
    betBB(getTableID(), bbAmount1, BetBBAmount1)
return

BetBBAmount2:
    betBB(getTableID(), bbAmount2, BetBBAmount2)
return

BetFullPot:
    bet(getTableID(), 100, BetFullPot)
    if (InstantFullPot = True)
        pressRaiseButton(getTableID(), "")
return

BetAllIn:
    pressAllInButton(getTableID(), BetAllIn)
    if (InstantAllIn = True)
        pressRaiseButton(getTableID(), "")
return

Add1BB:
    changeBet(getTableID(), "up", "bb", Add1BB)
return

Subtract1BB:
    changeBet(getTableID(), "down", "bb", Subtract1BB)
return

Add1SB:
    changeBet(getTableID(), "up", "sb", Add1SB)
return

Subtract1SB:
    changeBet(getTableID(), "down", "sb", Subtract1SB)
return

ExitApplication:
    GoSub Close
return

AutoRebuy:
    PressButton(getTableID(), autoRebuyX, autoRebuyY, AutoRebuy)
return

SitOut:
    PressButton(getTableID(), sitOutX, sitOutY, SitOut)
return

NoMoreBlinds:
    PressButton(getTableID(), noBlindsX, noBlindsY, NoMoreBlinds)
return

SitIn:
    PressButton(getTableID(), sitInX, sitInY, SitIn)
return

Reload:
    Reload
return

About:
    Msgbox,, About,
    (
    Entraction Helper, v0.3R4
    
    If you like this script please consider donating some money,
    using one of the following options:
    - transfer to OSRichard on PokerStars
    - transfer to YorickFTP on FullTilt
    - Moneybookers transfer to os.pstars@gmail.com
    
    If you have any suggestions/requests/comments,
    PM me on 2+2 forums @ OSRichard.
    )
return

Close:
    ExitApp
return

RemoveToolTip:
    SetTimer, RemoveToolTip, Off
    ToolTip
return

activateAllwaysCheckForFree:
    SetTimer, checkForFree, 500
return

autoBuyInForMax:
    SetTimer, buyInForMax, 500
return

activateAutoConfirmRebuy:
    SetTimer, autoCloseRebuy, 500
return

activateAutoConfirmAllIn:
    SetTimer, autoConfirmLargeAllIn, 500
return

activateAutoConfirmLeave:
    SetTimer, autoConfirmLeaveTable, 500
return

activateAutoConfirmWaitingList:
    SetTimer, autoConfirmWaitingListPp, 500
return

checkForFree:
    checkForFreeWindowTitle := "Confirm fold"

    IfWinExist, %checkForFreeWindowTitle%
    {
        
        ; press "Check" button
        CoordMode, Mouse, Screen
        MouseGetPos, px, py
        CoordMode, Mouse, Relative
        WinGetActiveStats, title, width, height, ax, ay
        X := Round(width * checkForFreeX)
        Y := Round(height * checkForFreeY)
        ;Tooltip, title: %title%`nX: %X%`nY: %Y%`ncheckForFreeWindowTitle: %checkForFreeWindowTitle%
        ;SetTimer, RemoveToolTip, 5000
        MouseClick,, X, Y,, 0
        CoordMode, Mouse, Screen
        MouseMove, px, py, 0
        CoordMode, Mouse, Relative
    }
return

buyInForMax:
    IfWinExist, ahk_class SunAwtDialog
    {
        WinGetActiveStats, title, width, height, ax, ay
        if (title = "") {
            CoordMode, Mouse, Screen
            MouseGetPos, px, py
            CoordMode, Mouse, Relative
            X := Round(width * maxBuyInX)
            Y := Round(height * maxBuyInY)
            ;Tooltip, title: %title%`nX: %X%`nY: %Y%
            ;SetTimer, RemoveToolTip, 5000
            MouseClick,, X, Y,, 0
            sleep 50
            X := Round(width * confirmBuyInX)
            Y := Round(height * confirmBuyInY)
            MouseClick,, X, Y,, 0
            CoordMode, Mouse, Screen
            MouseMove, px, py, 0
            CoordMode, Mouse, Relative
        }
    }
return

autoCloseRebuy:
    autoCloseRebuyWindowTitle := "Auto Rebuy turned on"

    IfWinExist, %autoCloseRebuyWindowTitle%
    {
        ; press "Ok" button
        CoordMode, Mouse, Screen
        MouseGetPos, px, py
        CoordMode, Mouse, Relative
        WinGetActiveStats, title, width, height, ax, ay
        X := Round(width * rebuyOkX)
        Y := Round(height * rebuyOkY)
        ;Tooltip, title: %title%`nX: %X%`nY: %Y%`nautoCloseRebuyWindowTitle: %autoCloseRebuyWindowTitle%
        ;SetTimer, RemoveToolTip, 5000
        MouseClick,, X, Y,, 0
        CoordMode, Mouse, Screen
        MouseMove, px, py, 0
        CoordMode, Mouse, Relative
    }
return

autoConfirmLargeAllIn:
    autoConfirmLargeAllInWindowTitle := "Confirm Large All-In Raise"

    IfWinExist, %autoConfirmLargeAllInWindowTitle%
    {
        ; press "Ok" button
        CoordMode, Mouse, Screen
        MouseGetPos, px, py
        CoordMode, Mouse, Relative
        WinGetActiveStats, title, width, height, ax, ay
        X := Round(width * confirmAllInX)
        Y := Round(height * confirmAllInY)
        ;Tooltip, title: %title%`nX: %X%`nY: %Y%`nautoConfirmLargeAllInWindowTitle: %autoConfirmLargeAllInWindowTitle%
        ;SetTimer, RemoveToolTip, 5000
        MouseClick,, X, Y,, 0
        CoordMode, Mouse, Screen
        MouseMove, px, py, 0
        CoordMode, Mouse, Relative
    }
return

autoConfirmLeaveTable:
    autoConfirmLeaveTableWindowTitle := "Confirm leave"

    IfWinExist, %autoConfirmLeaveTableWindowTitle%
    {
        ; press "Ok" button
        CoordMode, Mouse, Screen
        MouseGetPos, px, py
        CoordMode, Mouse, Relative
        WinGetActiveStats, title, width, height, ax, ay
        X := Round(width * confirmLeaveX)
        Y := Round(height * confirmLeaveY)
        ;Tooltip, title: %title%`nX: %X%`nY: %Y%`nautoConfirmLeaveTableWindowTitle: %autoConfirmLeaveTableWindowTitle%
        ;SetTimer, RemoveToolTip, 5000
        MouseClick,, X, Y,, 0
        CoordMode, Mouse, Screen
        MouseMove, px, py, 0
        CoordMode, Mouse, Relative
    }
return

autoConfirmWaitingListPp:
    autoConfirmWaitingListWindowTitle := "Waiting List"

    IfWinExist, %autoConfirmWaitingListWindowTitle%
    {
        WinActivate, %autoConfirmWaitingListWindowTitle%
        
        ; press "Ok" button
        CoordMode, Mouse, Screen
        MouseGetPos, px, py
        CoordMode, Mouse, Relative
        WinGetActiveStats, title, width, height, ax, ay
        
        X := Round(width * confirmWaiting1X)
        Y := Round(height * confirmWaiting1Y)
        ;Tooltip, title: %title%`nX: %X%`nY: %Y%`nautoConfirmWaitingListWindowTitle: %autoConfirmWaitingListWindowTitle%
        ;SetTimer, RemoveToolTip, 5000
        MouseClick,, X, Y,, 0
        
        X := Round(width * confirmWaiting2X)
        Y := Round(height * confirmWaiting2Y)
        ;Tooltip, title: %title%`nX: %X%`nY: %Y%`nautoConfirmWaitingListWindowTitle: %autoConfirmWaitingListWindowTitle%
        ;SetTimer, RemoveToolTip, 5000
        MouseClick,, X, Y,, 0
        
        CoordMode, Mouse, Screen
        MouseMove, px, py, 0
        CoordMode, Mouse, Relative
    }
return

getTableID()
{
    global actOnActiveTable
  
    ID := ""
    if (actOnActiveTable = 1) {
        WinGet, ID,, A 
    } else {
        MouseGetPos,,,ID
    }
    
    WinGetClass, winClass, ahk_id %ID%
    if (winClass <> "l1l1.jI")
        ID := ""
  
    return ID
}

bet(ID, percentage, key) {
    
    ;Traytip,, bet ID: %ID%
    if (ID = "") {
        if (key <> "")
            Send {%key%}
        return
    }
        
    Critical, On
    pressPotButton(ID, key)
    betSize := readBetBox(ID)
    newBetSize := Round(betSize * percentage / 100,2)
    ;Tooltip, ID: %ID%`nbetSize: %betSize%`npercentage: %percentage%`nnewBetSize: %newBetSize%
    ;SetTimer, RemoveToolTip, 5000
    writeBetBox(ID, newBetSize)
    Critical, Off
}

betBB(ID, amount, key) {
    
    ;Traytip,, bet ID: %ID%
    if (ID = "") {
        if (key <> "")
            Send {%key%}
        return
    }
        
    Critical, On
    bigBlind := getBlind(ID, "bb")
    newBetSize := Round(bigBlind * amount,2)
    ;Tooltip, ID: %ID%`nbetSize: %betSize%`npercentage: %percentage%`nnewBetSize: %newBetSize%
    ;SetTimer, RemoveToolTip, 5000
    writeBetBox(ID, newBetSize)
    Critical, Off
}

changeBet(ID, direction, amount, key) {
    global actOnActiveTable
    
    ;Traytip,, changebet ID: %ID%`nactOnActiveTable: %actOnActiveTable%
    if (ID = "") {
        if (key <> "")
            Send {%key%}
        return
    }
    
    if (actOnActiveTable <> 1) 
        WinActivate, ahk_id %ID%
    
    ;IfWinNotActive ahk_class l1l1.jI
    ;{
     ;   Send {%key%}
      ;  return
    ;}

    Critical, On
    betSize := readBetBox(ID)
   
    if (amount = "bb") or (amount = "sb")
        raiseSize := getBlind(ID, amount)
    ;Msgbox, raiseSize: %raiseSize%
        
    if (direction = "up")
        newBetSize := betSize + raiseSize
    else
        newBetSize := betSize - raiseSize
        
    writeBetBox(ID, newBetSize)
    Critical, Off
}

getBlind(ID, amount) {
    WinGetTitle, title, ahk_id %ID%
    StringSplit, title_array, title, (
    StringSplit, game_type_blinds_connection, title_array%title_array0%, )
    StringSplit, game_type_blinds, game_type_blinds_connection1, %A_Space%
    ;ttt := game_type_blinds%game_type_blinds0%
    ;Traytip,, title: %title%`nblinds: %ttt%
    StringSplit, blinds, game_type_blinds%game_type_blinds0%, /
    
    if (amount = "sb")
        return blinds1
    else
        return blinds2
}

readBetBox(ID) {
    global actOnActiveTable, betBoxX, betBoxY
    
    ;Traytip,, readbetbox ID: %ID%`nactOnActiveTable: %actOnActiveTable%
    if (ID = "") {
        return
    }
    
    if (actOnActiveTable <> 1) 
        WinActivate, ahk_id %ID%
    
    ;IfWinNotActive ahk_class l1l1.jI
     ;   return ""
        
    WinGetActiveStats, title, width, height, ax, ay
    X := Round(width * betBoxX)
    Y := Round(height * betBoxY)
    ;Traytip,, title: %title%`nX: %X%`nY: %Y%
    CoordMode, Mouse, Screen
    MouseGetPos, px, py
    CoordMode, Mouse, Relative
    MouseClick,, X, Y,, 0
    sleep 50
    
    oldClipBoard = %clipBoard%
    clipboard =  ; Start off empty to allow ClipWait to detect when the text has arrived.
    Send {HOME}+{END}
    Send ^c
    ClipWait 0.2 ; Wait for the clipboard to contain text.
    If !ErrorLevel 
	text := clipboard
    clipboard = %oldClipBoard%
    CoordMode, Mouse, Screen
    MouseMove, px, py, 0
    CoordMode, Mouse, Relative
    
    ;Tooltip, text: %text%
    ;SetTimer, RemoveToolTip, 3000
    
    return text
}

writeBetBox(ID, betSize) {
    global actOnActiveTable, betBoxX, betBoxY
    
    if (ID = "") {
        return
    }
    
    if (actOnActiveTable <> 1) 
        WinActivate, ahk_id %ID%
    
    ;IfWinNotActive ahk_class l1l1.jI
     ;   return
        
    WinGetActiveStats, title, width, height, ax, ay
    X := Round(width * betBoxX)
    Y := Round(height * betBoxY)
    ;Traytip,, title: %title%`nX: %X%`nY: %Y%
    CoordMode, Mouse, Screen
    MouseGetPos, px, py
    CoordMode, Mouse, Relative
    MouseClick,, X, Y,, 0
    sleep 50
    
    ;Tooltip, betSize: %betSize%
    ;SetTimer, RemoveToolTip, 3000
    
    Send {HOME}+{END}%betSize%
    CoordMode, Mouse, Screen
    MouseMove, px, py, 0
    CoordMode, Mouse, Relative

}

pressFoldButton(ID, key) {
    global FoldX, FoldY
    PressButton(ID, FoldX, FoldY, key)
}

pressCheckButton(ID, key) {
    global CheckX, CheckY
    PressButton(ID, CheckX, CheckY, key)
}

pressRaiseButton(ID, key) {
    global RaiseX, RaiseY
    PressButton(ID, RaiseX, RaiseY, key)
}

pressPotButton(ID, key) {
    global PotX, PotY
    PressButton(ID, PotX, PotY, key)
}

pressAllInButton(ID, key) {
    global AllInX, AllInY
    PressButton(ID, AllInX, AllInY, key)
}

PressButton(ID, qx, qy, key) {
    global actOnActiveTable
    
    ;Traytip,, button ID: %ID%`nactOnActiveTable: %actOnActiveTable%
    if (ID = "") {
        if (key <> "")
            Send {%key%}
        return
    }
     
    if (actOnActiveTable <> 1) 
        WinGetPos, ax, ay, width, height, ahk_id %ID%
    else
        WinGetActiveStats, title, width, height, ax, ay
    
    ;IfWinNotActive ahk_class l1l1.jI
    ;{
        ;TrayTip,, Sending %key%
        ;if (key <> "")
         ;   Send {%key%}
        ;return
    ;}
    
    X := Round(width * qx)
    Y := Round(height * qy)
    ;Traytip,, title: %title%`nX: %X%`nY: %Y%
    CoordMode, Mouse, Screen
    MouseGetPos, px, py
    CoordMode, Mouse, Relative
    MouseClick,, X, Y,, 0
    CoordMode, Mouse, Screen
    MouseMove, px, py, 0
    CoordMode, Mouse, Relative
}

readIniFile() {
    global
    IfNotExist, EntHelper.ini
    {
        createIni()
        ;Traytip,, Inifile created
        return
    }
    
    ; read general options
    IniRead, actOnActiveTable,  EntHelper.ini, Options,  actOnActiveTable, 0
    IniRead, allwaysCheckForFree,  EntHelper.ini, Options,  allwaysCheckForFree, 0
    IniRead, autoBuyInMax,  EntHelper.ini, Options,  autoBuyInMax, 0
    IniRead, autoConfirmRebuy,  EntHelper.ini, Options,  autoConfirmRebuy, 0
    IniRead, autoConfirmAllIn,  EntHelper.ini, Options,  autoConfirmAllIn, 0
    IniRead, autoConfirmLeave,  EntHelper.ini, Options,  autoConfirmLeave, 0
    IniRead, autoConfirmWaitingList,  EntHelper.ini, Options,  autoConfirmWaitingList, 0
    IniRead, InstantAllIn,  EntHelper.ini, Options,  InstantAllIn, 0
    IniRead, InstantFullPot,  EntHelper.ini, Options,  InstantFullPot, 0
    
    ; read pot percentages
    IniRead, percentage1, EntHelper.ini, PotPercentages, percentage1, 0
    IniRead, percentage2, EntHelper.ini, PotPercentages, percentage2, 0
    IniRead, percentage3, EntHelper.ini, PotPercentages, percentage3, 0
    IniRead, percentage4, EntHelper.ini, PotPercentages, percentage4, 0
    IniRead, bbAmount1, EntHelper.ini, PotPercentages, bbAmount1, 0
    IniRead, bbAmount2, EntHelper.ini, PotPercentages, bbAmount2, 0
    
    ; read hotkeys
    IniRead, Fold, EntHelper.ini, Hotkeys, Fold, %A_Space%
    IniRead, CheckCall, EntHelper.ini, Hotkeys, CheckCall, %A_Space%
    IniRead, Raise, EntHelper.ini, Hotkeys, Raise, %A_Space%
    
    IniRead, BetPotPercentage1, EntHelper.ini, Hotkeys, BetPotPercentage1, %A_Space%
    IniRead, BetPotPercentage2, EntHelper.ini, Hotkeys, BetPotPercentage2, %A_Space%
    IniRead, BetPotPercentage3, EntHelper.ini, Hotkeys, BetPotPercentage3, %A_Space%
    IniRead, BetPotPercentage4, EntHelper.ini, Hotkeys, BetPotPercentage4, %A_Space%
    IniRead, BetBBAmount1, EntHelper.ini, Hotkeys, BetBBAmount1, %A_Space%
    IniRead, BetBBAmount2, EntHelper.ini, Hotkeys, BetBBAmount2, %A_Space%
    
    IniRead, BetFullPot, EntHelper.ini, Hotkeys, BetFullPot, %A_Space%
    IniRead, BetAllIn, EntHelper.ini, Hotkeys, BetAllIn, %A_Space%
    
    IniRead, Add1BB, EntHelper.ini, Hotkeys, Add1BB, %A_Space%
    IniRead, Subtract1BB, EntHelper.ini, Hotkeys, Subtract1BB, %A_Space%
    IniRead, Add1SB, EntHelper.ini, Hotkeys, Add1SB, %A_Space%
    IniRead, Subtract1SB, EntHelper.ini, Hotkeys, Subtract1SB, %A_Space%

    IniRead, ExitApplication, EntHelper.ini, Hotkeys, ExitApplication, %A_Space%
    IniRead, AutoRebuy, EntHelper.ini, Hotkeys, AutoRebuy, %A_Space%
    IniRead, SitOut, EntHelper.ini, Hotkeys, SitOut, %A_Space%
    IniRead, NoMoreBlinds, EntHelper.ini, Hotkeys, NoMoreBlinds, %A_Space%
    IniRead, SitIn, EntHelper.ini, Hotkeys, SitIn, %A_Space%
}

createIni() {
    global

    ; set general options
    actOnActiveTable := True
    allwaysCheckForFree := True
    autoBuyInMax := True
    autoConfirmRebuy := True
    autoConfirmAllIn := True
    autoConfirmLeave := True
    autoConfirmWaitingList := True
    InstantAllIn := False
    InstantFullPot := False
    
    ; set pot percentages
    percentage1 := 66
    percentage2 := 75
    percentage3 := 90
    percentage4 := 115
    
    bbAmount1 := 2.5
    bbAmount2 := 4.5
    
    ;set hotkeys
    Fold = NumpadHome
    CheckCall = NumpadUp
    Raise = NumpadPgUp
    
    BetBBAmount1 = NumpadLeft 
    BetBBAmount2 = NumpadClear
    
    BetPotPercentage1 = NumpadRight
    BetPotPercentage2 = NumpadEnd
    BetPotPercentage3 = NumpadDown
    BetPotPercentage4 = NumpadPgDn
    
    BetFullPot = NumpadAdd
    BetAllIn = NumpadIns
    
    Add1BB = WheelUp
    Subtract1BB = WheelDown

    ExitApplication = F8
    AutoRebuy = F9
    SitOut = F10
    NoMoreBlinds = F11
    SitIn = F12
   
   
    writeIni()
}

writeIni() {
    global
    
    ; write general options
    if actOnActiveTable
        IniWrite, %actOnActiveTable%,  EntHelper.ini, Options,  actOnActiveTable
    if allwaysCheckForFree
        IniWrite, %allwaysCheckForFree%,  EntHelper.ini, Options,  allwaysCheckForFree
    if autoBuyInMax
        IniWrite, %autoBuyInMax%,  EntHelper.ini, Options,  autoBuyInMax
    if autoConfirmRebuy
        IniWrite, %autoConfirmRebuy%,  EntHelper.ini, Options,  autoConfirmRebuy
    if autoConfirmAllIn
        IniWrite, %autoConfirmAllIn%,  EntHelper.ini, Options,  autoConfirmAllIn
    if autoConfirmLeave
        IniWrite, %autoConfirmLeave%,  EntHelper.ini, Options,  autoConfirmLeave
    if autoConfirmWaitingList
        IniWrite, %autoConfirmWaitingList%,  EntHelper.ini, Options,  autoConfirmWaitingList
    if InstantAllIn
        IniWrite, %InstantAllIn%,  EntHelper.ini, Options,  InstantAllIn
    if InstantFullPot
        IniWrite, %InstantFullPot%,  EntHelper.ini, Options,  InstantFullPot
    
    ; write pot percentages
    if percentage1
        IniWrite, %percentage1%, EntHelper.ini, PotPercentages, percentage1
    if percentage2
        IniWrite, %percentage2%, EntHelper.ini, PotPercentages, percentage2
    if percentage3
        IniWrite, %percentage3%, EntHelper.ini, PotPercentages, percentage3
    if percentage4
        IniWrite, %percentage4%, EntHelper.ini, PotPercentages, percentage4
        
    if bbAmount1
        IniWrite, %bbAmount1%, EntHelper.ini, PotPercentages, bbAmount1
    if bbAmount2
        IniWrite, %bbAmount2%, EntHelper.ini, PotPercentages, bbAmount2
    
    ; write hotkeys
    if Fold
        IniWrite, %Fold%, EntHelper.ini, Hotkeys, Fold
    if CheckCall
        IniWrite, %CheckCall%, EntHelper.ini, Hotkeys, CheckCall
    if Raise
        IniWrite, %Raise%, EntHelper.ini, Hotkeys, Raise
        
    if BetPotPercentage1
        IniWrite, %BetPotPercentage1%, EntHelper.ini, Hotkeys, BetPotPercentage1
    if BetPotPercentage2
        IniWrite, %BetPotPercentage2%, EntHelper.ini, Hotkeys, BetPotPercentage2
    if BetPotPercentage3
        IniWrite, %BetPotPercentage3%, EntHelper.ini, Hotkeys, BetPotPercentage3
    if BetPotPercentage4
        IniWrite, %BetPotPercentage4%, EntHelper.ini, Hotkeys, BetPotPercentage4
    if BetBBAmount1
        IniWrite, %BetBBAmount1%, EntHelper.ini, Hotkeys, BetBBAmount1
    if BetBBAmount2
        IniWrite, %BetBBAmount2%, EntHelper.ini, Hotkeys, BetBBAmount2
        
    if BetFullPot
        IniWrite, %BetFullPot%, EntHelper.ini, Hotkeys, BetFullPot
    if BetAllIn
        IniWrite, %BetAllIn%, EntHelper.ini, Hotkeys, BetAllIn
        
    if Add1BB
        IniWrite, %Add1BB%, EntHelper.ini, Hotkeys, Add1BB
    if Subtract1BB
        IniWrite, %Subtract1BB%, EntHelper.ini, Hotkeys, Subtract1BB
    if Add1SB
        IniWrite, %Add1SB%, EntHelper.ini, Hotkeys, Add1SB
    if Subtract1SB
        IniWrite, %Subtract1SB%, EntHelper.ini, Hotkeys, Subtract1SB

    if ExitApplication
        IniWrite, %ExitApplication%, EntHelper.ini, Hotkeys, ExitApplication
    if AutoRebuy
        IniWrite, %AutoRebuy%, EntHelper.ini, Hotkeys, AutoRebuy
    if SitOut
        IniWrite, %SitOut%, EntHelper.ini, Hotkeys, SitOut
    if NoMoreBlinds
        IniWrite, %NoMoreBlinds%, EntHelper.ini, Hotkeys, NoMoreBlinds
    if SitIn
        IniWrite, %SitIn%, EntHelper.ini, Hotkeys, SitIn
    
}

defineHotKeys() {
    global

    if Fold
        HotKey, %Fold%, Fold
    if CheckCall
        HotKey, %CheckCall%, CheckCall
    if Raise
        HotKey, %Raise%, Raise
        
    if BetPotPercentage1
        HotKey, %BetPotPercentage1%, BetPotPercentage1
    if BetPotPercentage2
        HotKey, %BetPotPercentage2%, BetPotPercentage2
    if BetPotPercentage3
        HotKey, %BetPotPercentage3%, BetPotPercentage3
    if BetPotPercentage4
        HotKey, %BetPotPercentage4%, BetPotPercentage4
        
    if BetBBAmount1
        HotKey, %BetBBAmount1%, BetBBAmount1
    if BetBBAmount2
        HotKey, %BetBBAmount2%, BetBBAmount2
        
    if BetFullPot
        HotKey, %BetFullPot%, BetFullPot
    if BetAllIn
        HotKey, %BetAllIn%, BetAllIn
    
    if Add1BB
        HotKey, %Add1BB%, Add1BB
    if Subtract1BB
        HotKey, %Subtract1BB%, Subtract1BB
    if Add1SB
        HotKey, %Add1SB%, Add1SB
    if Subtract1SB
        HotKey, %Subtract1SB%, Subtract1SB
        
    if ExitApplication
        HotKey, %ExitApplication%, ExitApplication
    if AutoRebuy
        HotKey, %AutoRebuy%, AutoRebuy
    if SitOut
        HotKey, %SitOut%, SitOut
    if NoMoreBlinds
        HotKey, %NoMoreBlinds%, NoMoreBlinds
    if SitIn
        HotKey, %SitIn%, SitIn
}
New Donationware Software: Entraction helper script Quote
06-01-2010 , 01:41 PM
Thanks. It works.
New Donationware Software: Entraction helper script Quote
06-22-2010 , 08:41 AM
does it still work? after today update I cannot fold and call with hot keys
New Donationware Software: Entraction helper script Quote
06-22-2010 , 03:13 PM
Todays update messed it all up again...
New Donationware Software: Entraction helper script Quote
06-22-2010 , 03:21 PM
They changed the poker table window class, again. Try this:

Code:
; Version 0.3R6

; percentage of the window width and height for center of buttons
foldX := 0.48
foldY := 0.95

checkX := 0.62
checkY := 0.95

raiseX := 0.77
raiseY := 0.95

potX := 0.71
potY := 0.86

allinX := 0.79
allinY := 0.86

betBoxX := 0.47
betBoxY := 0.82

autoRebuyX := 0.88
autoRebuyY := 0.88

sitOutX := 0.88
sitOutY := 0.94

noBlindsX := 0.88
noBlindsY := 0.97

sitInX := 0.6
sitInY := 0.9

checkForFreeX := 0.58
checkForFreeY := 0.74

maxBuyInX := 0.31
maxBuyInY := 0.44

confirmBuyInX := 0.7
confirmBuyInY := 0.89

rebuyOkX := 0.49
rebuyOkY := 0.74

confirmAllInX := 0.41
confirmAllInY := 0.73

confirmLeaveX := 0.45
confirmLeaveY := 0.73

confirmWaiting1X := 0.5
confirmWaiting1Y := 0.86

confirmWaiting2X := 0.41
confirmWaiting2Y := 0.86
; End general settings

#SingleInstance, Force
#NoEnv
#MaxHotkeysPerInterval 200
SendMode Input
SetTitleMatchMode 3
SetBatchLines -1

Menu, Tray, NoStandard
Menu, Tray, Add, Settings, Settings
Menu, Tray, Default, Settings
Menu, Tray, Add, Reload, Reload
Menu, Tray, Add, About, About
Menu, Tray, Add, Exit, Close

readIniFile()
defineHotKeys()

if (allwaysCheckForFree = 1)
    GoSub activateAllwaysCheckForFree

if (autoBuyInMax = 1)
    GoSub autoBuyInForMax
    
if (autoConfirmRebuy = 1)
    GoSub activateAutoConfirmRebuy
    
if (autoConfirmAllIn = 1)
    GoSub activateAutoConfirmAllIn
    
if (autoConfirmLeave = 1)
    GoSub activateAutoConfirmLeave
     
if (autoConfirmWaitingList = 1)
    GoSub activateAutoConfirmWaitingList

return

    
; GUI to choose settings
Settings:
    ; add tabs
    Gui, Add, Tab, x-4 y0 w500 h750 , Table Hotkeys|Other Hotkeys|Options
    
    Gui, Add, Text, x10 y32 w100 h20 , Fold
    Gui, Add, Edit, x90 y30 w90 h20 vFold, %Fold%
    Gui, Add, Text, x10 y52 w100 h20 , Check/Call
    Gui, Add, Edit, x90 y50 w90 h20 vCheckCall, %CheckCall%
    Gui, Add, Text, x10 y72 w100 h20 , Raise
    Gui, Add, Edit, x90 y70 w90 h20 vRaise, %Raise%
    Gui, Add, Text, x10 y92 w100 h20 , All In
    Gui, Add, Edit, x90 y90 w90 h20 vBetAllIn, %BetAllIn%
    Gui, Add, CheckBox, x195 y90 w50 h20 Checked%InstantAllIn% vInstantAllIn, Instant
    Gui, Add, Text, x10 y112 w100 h20 , Bet Full Pot
    Gui, Add, Edit, x90 y110 w90 h20 vBetFullPot, %BetFullPot%
    Gui, Add, CheckBox, x195 y110 w50 h20 Checked%InstantFullPot% vInstantFullPot, Instant
    Gui, Add, Text, x10 y152 w20 h20 , Bet
    Gui, Add, Edit, x30 y150 w25 h20 vpercentage1, %percentage1%
    Gui, Add, Text, x56 y152 w40 h20 , `% pot
    Gui, Add, Edit, x90 y150 w90 h20 vBetPotPercentage1, %BetPotPercentage1%
    Gui, Add, Text, x10 y172 w20 h20 , Bet
    Gui, Add, Edit, x30 y170 w25 h20 vpercentage2, %percentage2%
    Gui, Add, Text, x56 y172 w40 h20 , `% pot
    Gui, Add, Edit, x90 y170 w90 h20 vBetPotPercentage2, %BetPotPercentage2%
    Gui, Add, Text, x10 y192 w20 h20 , Bet
    Gui, Add, Edit, x30 y190 w25 h20 vpercentage3, %percentage3%
    Gui, Add, Text, x56 y192 w40 h20 , `% pot
    Gui, Add, Edit, x90 y190 w90 h20 vBetPotPercentage3, %BetPotPercentage3%
    Gui, Add, Text, x10 y212 w20 h20 , Bet
    Gui, Add, Edit, x30 y210 w25 h20 vpercentage4, %percentage4%
    Gui, Add, Text, x56 y212 w40 h20 , `% pot
    Gui, Add, Edit, x90 y210 w90 h20 vBetPotPercentage4, %BetPotPercentage4%
    Gui, Add, Text, x10 y252 w20 h20 , Bet
    Gui, Add, Edit, x30 y250 w25 h20 vbbAmount1, %bbAmount1%
    Gui, Add, Text, x56 y252 w40 h20 , BBs
    Gui, Add, Edit, x90 y250 w90 h20 vBetBBAmount1, %BetBBAmount1%
    Gui, Add, Text, x10 y272 w20 h20 , Bet
    Gui, Add, Edit, x30 y270 w25 h20 vbbAmount2, %bbAmount2%
    Gui, Add, Text, x56 y272 w40 h20 , BBs
    Gui, Add, Edit, x90 y270 w90 h20 vBetBBAmount2, %BetBBAmount2%
    Gui, Add, Text, x10 y292 w100 h20 , Add 1 BB
    Gui, Add, Edit, x90 y290 w90 h20 vAdd1BB, %Add1BB%
    Gui, Add, Text, x10 y312 w100 h20 , Subtract 1 BB
    Gui, Add, Edit, x90 y310 w90 h20 vSubtract1BB, %Subtract1BB%
    Gui, Add, Text, x10 y332 w100 h20 , Add 1 SB
    Gui, Add, Edit, x90 y330 w90 h20 vAdd1SB, %Add1SB%
    Gui, Add, Text, x10 y352 w100 h20 , Subtract1 SB
    Gui, Add, Edit, x90 y350 w90 h20 vSubtract1SB, %Subtract1SB%
    
    Gui, Add, Button, x75 y400 w50 h20 gSave, Save 
    Gui, Add, Button, x135 y400 w50 h20 gCancel, Cancel
    
    Gui, Tab, Other Hotkeys
    Gui, Add, Text, x5 y32 w100 h20 , Auto Rebuy
    Gui, Add, Edit, x85 y30 w90 h20 vAutoRebuy, %AutoRebuy%
    Gui, Add, Text, x5 y52 w100 h20 , Sit Out
    Gui, Add, Edit, x85 y50 w90 h20 vSitOut, %SitOut%
    Gui, Add, Text, x5 y72 w100 h20 , No More Blinds
    Gui, Add, Edit, x85 y70 w90 h20 vNoMoreBlinds, %NoMoreBlinds%
    Gui, Add, Text, x5 y92 w100 h20 , Sit In
    Gui, Add, Edit, x85 y90 w90 h20 vSitIn, %SitIn%
    Gui, Add, Text, x5 y132 w100 h20 , Exit Application
    Gui, Add, Edit, x85 y130 w90 h20 vExitApplication, %ExitApplication%
    
    Gui, Add, Button, x75 y400 w50 h20 gSave, Save 
    Gui, Add, Button, x135 y400 w50 h20 gCancel, Cancel
    
    Gui, Tab, Options
    Gui, Add, CheckBox, x5 y30 w230 h20 Checked%actOnActiveTable% vactOnActiveTable, Act on active table (or table under mouse)
    Gui, Add, CheckBox, x5 y50 w200 h20 Checked%allwaysCheckForFree% vallwaysCheckForFree, Allways check for free
    Gui, Add, CheckBox, x5 y70 w200 h20 Checked%autoBuyInMax% vautoBuyInMax, Auto buy in for table maximum
    Gui, Add, CheckBox, x5 y90 w200 h20 Checked%autoConfirmRebuy% vautoConfirmRebuy, Auto confirm rebuy pop-up
    Gui, Add, CheckBox, x5 y110 w200 h20 Checked%autoConfirmAllIn% vautoConfirmAllIn, Auto confirm large all-in
    Gui, Add, CheckBox, x5 y130 w200 h20 Checked%autoConfirmLeave% vautoConfirmLeave, Auto confirm leave table pop-up
    Gui, Add, CheckBox, x5 y150 w200 h20 Checked%autoConfirmWaitingList% vautoConfirmWaitingList, Auto confirm waiting list pop-ups
    
    Gui, Add, Button, x75 y400 w50 h20 gSave, Save 
    Gui, Add, Button, x135 y400 w50 h20 gCancel, Cancel
    
    Gui, Show, x100 y50 h450 w260, EntHelper Settings
return

Save:
    Gui, Submit
    FileDelete, EntHelper.ini
    writeIni()
    Reload
return

Cancel:
    Gui, Destroy
return

GuiClose:
    Gui, Destroy
return

Fold:
    pressFoldButton(getTableID(), Fold)
return

CheckCall:
    pressCheckButton(getTableID(), CheckCall)
return

Raise:
    pressRaiseButton(getTableID(), Raise)
return

BetPotPercentage1:
    bet(getTableID(), percentage1, BetPotPercentage1)
return

BetPotPercentage2:
    bet(getTableID(), percentage2, BetPotPercentage2)
return

BetPotPercentage3:
    bet(getTableID(), percentage3, BetPotPercentage3)
return

BetPotPercentage4:
    bet(getTableID(), percentage4, BetPotPercentage4)
return

BetBBAmount1:
    betBB(getTableID(), bbAmount1, BetBBAmount1)
return

BetBBAmount2:
    betBB(getTableID(), bbAmount2, BetBBAmount2)
return

BetFullPot:
    bet(getTableID(), 100, BetFullPot)
    if (InstantFullPot = True)
        pressRaiseButton(getTableID(), "")
return

BetAllIn:
    pressAllInButton(getTableID(), BetAllIn)
    if (InstantAllIn = True)
        pressRaiseButton(getTableID(), "")
return

Add1BB:
    changeBet(getTableID(), "up", "bb", Add1BB)
return

Subtract1BB:
    changeBet(getTableID(), "down", "bb", Subtract1BB)
return

Add1SB:
    changeBet(getTableID(), "up", "sb", Add1SB)
return

Subtract1SB:
    changeBet(getTableID(), "down", "sb", Subtract1SB)
return

ExitApplication:
    GoSub Close
return

AutoRebuy:
    PressButton(getTableID(), autoRebuyX, autoRebuyY, AutoRebuy)
return

SitOut:
    PressButton(getTableID(), sitOutX, sitOutY, SitOut)
return

NoMoreBlinds:
    PressButton(getTableID(), noBlindsX, noBlindsY, NoMoreBlinds)
return

SitIn:
    PressButton(getTableID(), sitInX, sitInY, SitIn)
return

Reload:
    Reload
return

About:
    Msgbox,, About,
    (
    Entraction Helper, v0.3R4
    
    If you like this script please consider donating some money,
    using one of the following options:
    - transfer to OSRichard on PokerStars
    - transfer to YorickFTP on FullTilt
    - Moneybookers transfer to os.pstars@gmail.com
    
    If you have any suggestions/requests/comments,
    PM me on 2+2 forums @ OSRichard.
    )
return

Close:
    ExitApp
return

RemoveToolTip:
    SetTimer, RemoveToolTip, Off
    ToolTip
return

activateAllwaysCheckForFree:
    SetTimer, checkForFree, 500
return

autoBuyInForMax:
    SetTimer, buyInForMax, 500
return

activateAutoConfirmRebuy:
    SetTimer, autoCloseRebuy, 500
return

activateAutoConfirmAllIn:
    SetTimer, autoConfirmLargeAllIn, 500
return

activateAutoConfirmLeave:
    SetTimer, autoConfirmLeaveTable, 500
return

activateAutoConfirmWaitingList:
    SetTimer, autoConfirmWaitingListPp, 500
return

checkForFree:
    checkForFreeWindowTitle := "Confirm fold"

    IfWinExist, %checkForFreeWindowTitle%
    {
        
        ; press "Check" button
        CoordMode, Mouse, Screen
        MouseGetPos, px, py
        CoordMode, Mouse, Relative
        WinGetActiveStats, title, width, height, ax, ay
        X := Round(width * checkForFreeX)
        Y := Round(height * checkForFreeY)
        ;Tooltip, title: %title%`nX: %X%`nY: %Y%`ncheckForFreeWindowTitle: %checkForFreeWindowTitle%
        ;SetTimer, RemoveToolTip, 5000
        MouseClick,, X, Y,, 0
        CoordMode, Mouse, Screen
        MouseMove, px, py, 0
        CoordMode, Mouse, Relative
    }
return

buyInForMax:
    IfWinExist, ahk_class SunAwtDialog
    {
        WinGetActiveStats, title, width, height, ax, ay
        if (title = "") {
            CoordMode, Mouse, Screen
            MouseGetPos, px, py
            CoordMode, Mouse, Relative
            X := Round(width * maxBuyInX)
            Y := Round(height * maxBuyInY)
            ;Tooltip, title: %title%`nX: %X%`nY: %Y%
            ;SetTimer, RemoveToolTip, 5000
            MouseClick,, X, Y,, 0
            sleep 50
            X := Round(width * confirmBuyInX)
            Y := Round(height * confirmBuyInY)
            MouseClick,, X, Y,, 0
            CoordMode, Mouse, Screen
            MouseMove, px, py, 0
            CoordMode, Mouse, Relative
        }
    }
return

autoCloseRebuy:
    autoCloseRebuyWindowTitle := "Auto Rebuy turned on"

    IfWinExist, %autoCloseRebuyWindowTitle%
    {
        ; press "Ok" button
        CoordMode, Mouse, Screen
        MouseGetPos, px, py
        CoordMode, Mouse, Relative
        WinGetActiveStats, title, width, height, ax, ay
        X := Round(width * rebuyOkX)
        Y := Round(height * rebuyOkY)
        ;Tooltip, title: %title%`nX: %X%`nY: %Y%`nautoCloseRebuyWindowTitle: %autoCloseRebuyWindowTitle%
        ;SetTimer, RemoveToolTip, 5000
        MouseClick,, X, Y,, 0
        CoordMode, Mouse, Screen
        MouseMove, px, py, 0
        CoordMode, Mouse, Relative
    }
return

autoConfirmLargeAllIn:
    autoConfirmLargeAllInWindowTitle := "Confirm Large All-In Raise"

    IfWinExist, %autoConfirmLargeAllInWindowTitle%
    {
        ; press "Ok" button
        CoordMode, Mouse, Screen
        MouseGetPos, px, py
        CoordMode, Mouse, Relative
        WinGetActiveStats, title, width, height, ax, ay
        X := Round(width * confirmAllInX)
        Y := Round(height * confirmAllInY)
        ;Tooltip, title: %title%`nX: %X%`nY: %Y%`nautoConfirmLargeAllInWindowTitle: %autoConfirmLargeAllInWindowTitle%
        ;SetTimer, RemoveToolTip, 5000
        MouseClick,, X, Y,, 0
        CoordMode, Mouse, Screen
        MouseMove, px, py, 0
        CoordMode, Mouse, Relative
    }
return

autoConfirmLeaveTable:
    autoConfirmLeaveTableWindowTitle := "Confirm leave"

    IfWinExist, %autoConfirmLeaveTableWindowTitle%
    {
        ; press "Ok" button
        CoordMode, Mouse, Screen
        MouseGetPos, px, py
        CoordMode, Mouse, Relative
        WinGetActiveStats, title, width, height, ax, ay
        X := Round(width * confirmLeaveX)
        Y := Round(height * confirmLeaveY)
        ;Tooltip, title: %title%`nX: %X%`nY: %Y%`nautoConfirmLeaveTableWindowTitle: %autoConfirmLeaveTableWindowTitle%
        ;SetTimer, RemoveToolTip, 5000
        MouseClick,, X, Y,, 0
        CoordMode, Mouse, Screen
        MouseMove, px, py, 0
        CoordMode, Mouse, Relative
    }
return

autoConfirmWaitingListPp:
    autoConfirmWaitingListWindowTitle := "Waiting List"

    IfWinExist, %autoConfirmWaitingListWindowTitle%
    {
        WinActivate, %autoConfirmWaitingListWindowTitle%
        
        ; press "Ok" button
        CoordMode, Mouse, Screen
        MouseGetPos, px, py
        CoordMode, Mouse, Relative
        WinGetActiveStats, title, width, height, ax, ay
        
        X := Round(width * confirmWaiting1X)
        Y := Round(height * confirmWaiting1Y)
        ;Tooltip, title: %title%`nX: %X%`nY: %Y%`nautoConfirmWaitingListWindowTitle: %autoConfirmWaitingListWindowTitle%
        ;SetTimer, RemoveToolTip, 5000
        MouseClick,, X, Y,, 0
        
        X := Round(width * confirmWaiting2X)
        Y := Round(height * confirmWaiting2Y)
        ;Tooltip, title: %title%`nX: %X%`nY: %Y%`nautoConfirmWaitingListWindowTitle: %autoConfirmWaitingListWindowTitle%
        ;SetTimer, RemoveToolTip, 5000
        MouseClick,, X, Y,, 0
        
        CoordMode, Mouse, Screen
        MouseMove, px, py, 0
        CoordMode, Mouse, Relative
    }
return

getTableID()
{
    global actOnActiveTable
  
    ID := ""
    if (actOnActiveTable = 1) {
        WinGet, ID,, A 
    } else {
        MouseGetPos,,,ID
    }
    
    WinGetClass, winClass, ahk_id %ID%
    if (winClass <> "l1l1.jC")
        ID := ""
  
    return ID
}

bet(ID, percentage, key) {
    
    ;Traytip,, bet ID: %ID%
    if (ID = "") {
        if (key <> "")
            Send {%key%}
        return
    }
        
    Critical, On
    pressPotButton(ID, key)
    betSize := readBetBox(ID)
    newBetSize := Round(betSize * percentage / 100,2)
    ;Tooltip, ID: %ID%`nbetSize: %betSize%`npercentage: %percentage%`nnewBetSize: %newBetSize%
    ;SetTimer, RemoveToolTip, 5000
    writeBetBox(ID, newBetSize)
    Critical, Off
}

betBB(ID, amount, key) {
    
    ;Traytip,, bet ID: %ID%
    if (ID = "") {
        if (key <> "")
            Send {%key%}
        return
    }
        
    Critical, On
    bigBlind := getBlind(ID, "bb")
    newBetSize := Round(bigBlind * amount,2)
    ;Tooltip, ID: %ID%`nbetSize: %betSize%`npercentage: %percentage%`nnewBetSize: %newBetSize%
    ;SetTimer, RemoveToolTip, 5000
    writeBetBox(ID, newBetSize)
    Critical, Off
}

changeBet(ID, direction, amount, key) {
    global actOnActiveTable
    
    ;Traytip,, changebet ID: %ID%`nactOnActiveTable: %actOnActiveTable%
    if (ID = "") {
        if (key <> "")
            Send {%key%}
        return
    }
    
    if (actOnActiveTable <> 1) 
        WinActivate, ahk_id %ID%
    
    ;IfWinNotActive ahk_class l1l1.jC
    ;{
     ;   Send {%key%}
      ;  return
    ;}

    Critical, On
    betSize := readBetBox(ID)
   
    if (amount = "bb") or (amount = "sb")
        raiseSize := getBlind(ID, amount)
    ;Msgbox, raiseSize: %raiseSize%
        
    if (direction = "up")
        newBetSize := betSize + raiseSize
    else
        newBetSize := betSize - raiseSize
        
    writeBetBox(ID, newBetSize)
    Critical, Off
}

getBlind(ID, amount) {
    WinGetTitle, title, ahk_id %ID%
    StringSplit, title_array, title, (
    StringSplit, game_type_blinds_connection, title_array%title_array0%, )
    StringSplit, game_type_blinds, game_type_blinds_connection1, %A_Space%
    ;ttt := game_type_blinds%game_type_blinds0%
    ;Traytip,, title: %title%`nblinds: %ttt%
    StringSplit, blinds, game_type_blinds%game_type_blinds0%, /
    
    if (amount = "sb")
        return blinds1
    else
        return blinds2
}

readBetBox(ID) {
    global actOnActiveTable, betBoxX, betBoxY
    
    ;Traytip,, readbetbox ID: %ID%`nactOnActiveTable: %actOnActiveTable%
    if (ID = "") {
        return
    }
    
    if (actOnActiveTable <> 1) 
        WinActivate, ahk_id %ID%
    
    ;IfWinNotActive ahk_class l1l1.jC
     ;   return ""
        
    WinGetActiveStats, title, width, height, ax, ay
    X := Round(width * betBoxX)
    Y := Round(height * betBoxY)
    ;Traytip,, title: %title%`nX: %X%`nY: %Y%
    CoordMode, Mouse, Screen
    MouseGetPos, px, py
    CoordMode, Mouse, Relative
    MouseClick,, X, Y,, 0
    sleep 50
    
    oldClipBoard = %clipBoard%
    clipboard =  ; Start off empty to allow ClipWait to detect when the text has arrived.
    Send {HOME}+{END}
    Send ^c
    ClipWait 0.2 ; Wait for the clipboard to contain text.
    If !ErrorLevel 
	text := clipboard
    clipboard = %oldClipBoard%
    CoordMode, Mouse, Screen
    MouseMove, px, py, 0
    CoordMode, Mouse, Relative
    
    ;Tooltip, text: %text%
    ;SetTimer, RemoveToolTip, 3000
    
    return text
}

writeBetBox(ID, betSize) {
    global actOnActiveTable, betBoxX, betBoxY
    
    if (ID = "") {
        return
    }
    
    if (actOnActiveTable <> 1) 
        WinActivate, ahk_id %ID%
    
    ;IfWinNotActive ahk_class l1l1.jC
     ;   return
        
    WinGetActiveStats, title, width, height, ax, ay
    X := Round(width * betBoxX)
    Y := Round(height * betBoxY)
    ;Traytip,, title: %title%`nX: %X%`nY: %Y%
    CoordMode, Mouse, Screen
    MouseGetPos, px, py
    CoordMode, Mouse, Relative
    MouseClick,, X, Y,, 0
    sleep 50
    
    ;Tooltip, betSize: %betSize%
    ;SetTimer, RemoveToolTip, 3000
    
    Send {HOME}+{END}%betSize%
    CoordMode, Mouse, Screen
    MouseMove, px, py, 0
    CoordMode, Mouse, Relative

}

pressFoldButton(ID, key) {
    global FoldX, FoldY
    PressButton(ID, FoldX, FoldY, key)
}

pressCheckButton(ID, key) {
    global CheckX, CheckY
    PressButton(ID, CheckX, CheckY, key)
}

pressRaiseButton(ID, key) {
    global RaiseX, RaiseY
    PressButton(ID, RaiseX, RaiseY, key)
}

pressPotButton(ID, key) {
    global PotX, PotY
    PressButton(ID, PotX, PotY, key)
}

pressAllInButton(ID, key) {
    global AllInX, AllInY
    PressButton(ID, AllInX, AllInY, key)
}

PressButton(ID, qx, qy, key) {
    global actOnActiveTable
    
    ;Traytip,, button ID: %ID%`nactOnActiveTable: %actOnActiveTable%
    if (ID = "") {
        if (key <> "")
            Send {%key%}
        return
    }
     
    if (actOnActiveTable <> 1) 
        WinGetPos, ax, ay, width, height, ahk_id %ID%
    else
        WinGetActiveStats, title, width, height, ax, ay
    
    ;IfWinNotActive ahk_class l1l1.jC
    ;{
        ;TrayTip,, Sending %key%
        ;if (key <> "")
         ;   Send {%key%}
        ;return
    ;}
    
    X := Round(width * qx)
    Y := Round(height * qy)
    ;Traytip,, title: %title%`nX: %X%`nY: %Y%
    CoordMode, Mouse, Screen
    MouseGetPos, px, py
    CoordMode, Mouse, Relative
    MouseClick,, X, Y,, 0
    CoordMode, Mouse, Screen
    MouseMove, px, py, 0
    CoordMode, Mouse, Relative
}

readIniFile() {
    global
    IfNotExist, EntHelper.ini
    {
        createIni()
        ;Traytip,, Inifile created
        return
    }
    
    ; read general options
    IniRead, actOnActiveTable,  EntHelper.ini, Options,  actOnActiveTable, 0
    IniRead, allwaysCheckForFree,  EntHelper.ini, Options,  allwaysCheckForFree, 0
    IniRead, autoBuyInMax,  EntHelper.ini, Options,  autoBuyInMax, 0
    IniRead, autoConfirmRebuy,  EntHelper.ini, Options,  autoConfirmRebuy, 0
    IniRead, autoConfirmAllIn,  EntHelper.ini, Options,  autoConfirmAllIn, 0
    IniRead, autoConfirmLeave,  EntHelper.ini, Options,  autoConfirmLeave, 0
    IniRead, autoConfirmWaitingList,  EntHelper.ini, Options,  autoConfirmWaitingList, 0
    IniRead, InstantAllIn,  EntHelper.ini, Options,  InstantAllIn, 0
    IniRead, InstantFullPot,  EntHelper.ini, Options,  InstantFullPot, 0
    
    ; read pot percentages
    IniRead, percentage1, EntHelper.ini, PotPercentages, percentage1, 0
    IniRead, percentage2, EntHelper.ini, PotPercentages, percentage2, 0
    IniRead, percentage3, EntHelper.ini, PotPercentages, percentage3, 0
    IniRead, percentage4, EntHelper.ini, PotPercentages, percentage4, 0
    IniRead, bbAmount1, EntHelper.ini, PotPercentages, bbAmount1, 0
    IniRead, bbAmount2, EntHelper.ini, PotPercentages, bbAmount2, 0
    
    ; read hotkeys
    IniRead, Fold, EntHelper.ini, Hotkeys, Fold, %A_Space%
    IniRead, CheckCall, EntHelper.ini, Hotkeys, CheckCall, %A_Space%
    IniRead, Raise, EntHelper.ini, Hotkeys, Raise, %A_Space%
    
    IniRead, BetPotPercentage1, EntHelper.ini, Hotkeys, BetPotPercentage1, %A_Space%
    IniRead, BetPotPercentage2, EntHelper.ini, Hotkeys, BetPotPercentage2, %A_Space%
    IniRead, BetPotPercentage3, EntHelper.ini, Hotkeys, BetPotPercentage3, %A_Space%
    IniRead, BetPotPercentage4, EntHelper.ini, Hotkeys, BetPotPercentage4, %A_Space%
    IniRead, BetBBAmount1, EntHelper.ini, Hotkeys, BetBBAmount1, %A_Space%
    IniRead, BetBBAmount2, EntHelper.ini, Hotkeys, BetBBAmount2, %A_Space%
    
    IniRead, BetFullPot, EntHelper.ini, Hotkeys, BetFullPot, %A_Space%
    IniRead, BetAllIn, EntHelper.ini, Hotkeys, BetAllIn, %A_Space%
    
    IniRead, Add1BB, EntHelper.ini, Hotkeys, Add1BB, %A_Space%
    IniRead, Subtract1BB, EntHelper.ini, Hotkeys, Subtract1BB, %A_Space%
    IniRead, Add1SB, EntHelper.ini, Hotkeys, Add1SB, %A_Space%
    IniRead, Subtract1SB, EntHelper.ini, Hotkeys, Subtract1SB, %A_Space%

    IniRead, ExitApplication, EntHelper.ini, Hotkeys, ExitApplication, %A_Space%
    IniRead, AutoRebuy, EntHelper.ini, Hotkeys, AutoRebuy, %A_Space%
    IniRead, SitOut, EntHelper.ini, Hotkeys, SitOut, %A_Space%
    IniRead, NoMoreBlinds, EntHelper.ini, Hotkeys, NoMoreBlinds, %A_Space%
    IniRead, SitIn, EntHelper.ini, Hotkeys, SitIn, %A_Space%
}

createIni() {
    global

    ; set general options
    actOnActiveTable := True
    allwaysCheckForFree := True
    autoBuyInMax := True
    autoConfirmRebuy := True
    autoConfirmAllIn := True
    autoConfirmLeave := True
    autoConfirmWaitingList := True
    InstantAllIn := False
    InstantFullPot := False
    
    ; set pot percentages
    percentage1 := 66
    percentage2 := 75
    percentage3 := 90
    percentage4 := 115
    
    bbAmount1 := 2.5
    bbAmount2 := 4.5
    
    ;set hotkeys
    Fold = NumpadHome
    CheckCall = NumpadUp
    Raise = NumpadPgUp
    
    BetBBAmount1 = NumpadLeft 
    BetBBAmount2 = NumpadClear
    
    BetPotPercentage1 = NumpadRight
    BetPotPercentage2 = NumpadEnd
    BetPotPercentage3 = NumpadDown
    BetPotPercentage4 = NumpadPgDn
    
    BetFullPot = NumpadAdd
    BetAllIn = NumpadIns
    
    Add1BB = WheelUp
    Subtract1BB = WheelDown

    ExitApplication = F8
    AutoRebuy = F9
    SitOut = F10
    NoMoreBlinds = F11
    SitIn = F12
   
   
    writeIni()
}

writeIni() {
    global
    
    ; write general options
    if actOnActiveTable
        IniWrite, %actOnActiveTable%,  EntHelper.ini, Options,  actOnActiveTable
    if allwaysCheckForFree
        IniWrite, %allwaysCheckForFree%,  EntHelper.ini, Options,  allwaysCheckForFree
    if autoBuyInMax
        IniWrite, %autoBuyInMax%,  EntHelper.ini, Options,  autoBuyInMax
    if autoConfirmRebuy
        IniWrite, %autoConfirmRebuy%,  EntHelper.ini, Options,  autoConfirmRebuy
    if autoConfirmAllIn
        IniWrite, %autoConfirmAllIn%,  EntHelper.ini, Options,  autoConfirmAllIn
    if autoConfirmLeave
        IniWrite, %autoConfirmLeave%,  EntHelper.ini, Options,  autoConfirmLeave
    if autoConfirmWaitingList
        IniWrite, %autoConfirmWaitingList%,  EntHelper.ini, Options,  autoConfirmWaitingList
    if InstantAllIn
        IniWrite, %InstantAllIn%,  EntHelper.ini, Options,  InstantAllIn
    if InstantFullPot
        IniWrite, %InstantFullPot%,  EntHelper.ini, Options,  InstantFullPot
    
    ; write pot percentages
    if percentage1
        IniWrite, %percentage1%, EntHelper.ini, PotPercentages, percentage1
    if percentage2
        IniWrite, %percentage2%, EntHelper.ini, PotPercentages, percentage2
    if percentage3
        IniWrite, %percentage3%, EntHelper.ini, PotPercentages, percentage3
    if percentage4
        IniWrite, %percentage4%, EntHelper.ini, PotPercentages, percentage4
        
    if bbAmount1
        IniWrite, %bbAmount1%, EntHelper.ini, PotPercentages, bbAmount1
    if bbAmount2
        IniWrite, %bbAmount2%, EntHelper.ini, PotPercentages, bbAmount2
    
    ; write hotkeys
    if Fold
        IniWrite, %Fold%, EntHelper.ini, Hotkeys, Fold
    if CheckCall
        IniWrite, %CheckCall%, EntHelper.ini, Hotkeys, CheckCall
    if Raise
        IniWrite, %Raise%, EntHelper.ini, Hotkeys, Raise
        
    if BetPotPercentage1
        IniWrite, %BetPotPercentage1%, EntHelper.ini, Hotkeys, BetPotPercentage1
    if BetPotPercentage2
        IniWrite, %BetPotPercentage2%, EntHelper.ini, Hotkeys, BetPotPercentage2
    if BetPotPercentage3
        IniWrite, %BetPotPercentage3%, EntHelper.ini, Hotkeys, BetPotPercentage3
    if BetPotPercentage4
        IniWrite, %BetPotPercentage4%, EntHelper.ini, Hotkeys, BetPotPercentage4
    if BetBBAmount1
        IniWrite, %BetBBAmount1%, EntHelper.ini, Hotkeys, BetBBAmount1
    if BetBBAmount2
        IniWrite, %BetBBAmount2%, EntHelper.ini, Hotkeys, BetBBAmount2
        
    if BetFullPot
        IniWrite, %BetFullPot%, EntHelper.ini, Hotkeys, BetFullPot
    if BetAllIn
        IniWrite, %BetAllIn%, EntHelper.ini, Hotkeys, BetAllIn
        
    if Add1BB
        IniWrite, %Add1BB%, EntHelper.ini, Hotkeys, Add1BB
    if Subtract1BB
        IniWrite, %Subtract1BB%, EntHelper.ini, Hotkeys, Subtract1BB
    if Add1SB
        IniWrite, %Add1SB%, EntHelper.ini, Hotkeys, Add1SB
    if Subtract1SB
        IniWrite, %Subtract1SB%, EntHelper.ini, Hotkeys, Subtract1SB

    if ExitApplication
        IniWrite, %ExitApplication%, EntHelper.ini, Hotkeys, ExitApplication
    if AutoRebuy
        IniWrite, %AutoRebuy%, EntHelper.ini, Hotkeys, AutoRebuy
    if SitOut
        IniWrite, %SitOut%, EntHelper.ini, Hotkeys, SitOut
    if NoMoreBlinds
        IniWrite, %NoMoreBlinds%, EntHelper.ini, Hotkeys, NoMoreBlinds
    if SitIn
        IniWrite, %SitIn%, EntHelper.ini, Hotkeys, SitIn
    
}

defineHotKeys() {
    global

    if Fold
        HotKey, %Fold%, Fold
    if CheckCall
        HotKey, %CheckCall%, CheckCall
    if Raise
        HotKey, %Raise%, Raise
        
    if BetPotPercentage1
        HotKey, %BetPotPercentage1%, BetPotPercentage1
    if BetPotPercentage2
        HotKey, %BetPotPercentage2%, BetPotPercentage2
    if BetPotPercentage3
        HotKey, %BetPotPercentage3%, BetPotPercentage3
    if BetPotPercentage4
        HotKey, %BetPotPercentage4%, BetPotPercentage4
        
    if BetBBAmount1
        HotKey, %BetBBAmount1%, BetBBAmount1
    if BetBBAmount2
        HotKey, %BetBBAmount2%, BetBBAmount2
        
    if BetFullPot
        HotKey, %BetFullPot%, BetFullPot
    if BetAllIn
        HotKey, %BetAllIn%, BetAllIn
    
    if Add1BB
        HotKey, %Add1BB%, Add1BB
    if Subtract1BB
        HotKey, %Subtract1BB%, Subtract1BB
    if Add1SB
        HotKey, %Add1SB%, Add1SB
    if Subtract1SB
        HotKey, %Subtract1SB%, Subtract1SB
        
    if ExitApplication
        HotKey, %ExitApplication%, ExitApplication
    if AutoRebuy
        HotKey, %AutoRebuy%, AutoRebuy
    if SitOut
        HotKey, %SitOut%, SitOut
    if NoMoreBlinds
        HotKey, %NoMoreBlinds%, NoMoreBlinds
    if SitIn
        HotKey, %SitIn%, SitIn
}
New Donationware Software: Entraction helper script Quote
06-25-2010 , 05:29 AM
Since window title changes less frequently than window class, here is a bit of Indian code for your consideration, that changes dependency from window class to window title:


Code:
getTableID()
{
    global actOnActiveTable
  
    ID := ""
    if (actOnActiveTable = 1) {
        WinGet, ID,, A 
    } else {
        MouseGetPos,,,ID
    }
    
WinGetTitle, title, ahk_id %id%
Needle := ")  [Connection: "
IfInString, title, %Needle% 
{
    return ID
  }
    ID := ""
    return ID
}
!ATTENTION! That code win NOT work correctly with windows (not tables) that contain string ") [Connection: " in their title

Last edited by vovjkee; 06-25-2010 at 05:38 AM.
New Donationware Software: Entraction helper script Quote
07-11-2010 , 02:43 AM
Thanks, Richard
Do you still working on it?
New Donationware Software: Entraction helper script Quote
07-11-2010 , 08:47 AM
Hi.
No, not really, I think the current features are all it's gonna have.
New Donationware Software: Entraction helper script Quote
09-05-2010 , 09:27 PM
Thanks for this Richard, I'll try it out on pointpoker and see how it goes
New Donationware Software: Entraction helper script Quote
09-06-2010 , 03:52 PM
The hotkeys doesnt work for me, playing at stingbet.
Great work though.
New Donationware Software: Entraction helper script Quote
09-07-2010 , 06:30 PM
Hi all, i'm new here, so take it easy, can someone please tell me how i get this script to work, what exactly do i have to do.
Thanks in advance
New Donationware Software: Entraction helper script Quote
09-08-2010 , 12:59 AM
Quote:
Originally Posted by deucesUncracked
The hotkeys doesnt work for me, playing at stingbet.
Great work though.
They changed the window class again, so the tables are no longer detected. I've implemented the change suggested by vovjkee a few posts ago, so this would not be a problem in the future. Please see his post for further information.

Code:
; Version 0.3R7

; percentage of the window width and height for center of buttons
foldX := 0.48
foldY := 0.95

checkX := 0.62
checkY := 0.95

raiseX := 0.77
raiseY := 0.95

potX := 0.71
potY := 0.86

allinX := 0.79
allinY := 0.86

betBoxX := 0.47
betBoxY := 0.82

autoRebuyX := 0.88
autoRebuyY := 0.88

sitOutX := 0.88
sitOutY := 0.94

noBlindsX := 0.88
noBlindsY := 0.97

sitInX := 0.6
sitInY := 0.9

checkForFreeX := 0.58
checkForFreeY := 0.74

maxBuyInX := 0.31
maxBuyInY := 0.44

confirmBuyInX := 0.7
confirmBuyInY := 0.89

rebuyOkX := 0.49
rebuyOkY := 0.74

confirmAllInX := 0.41
confirmAllInY := 0.73

confirmLeaveX := 0.45
confirmLeaveY := 0.73

confirmWaiting1X := 0.5
confirmWaiting1Y := 0.86

confirmWaiting2X := 0.41
confirmWaiting2Y := 0.86
; End general settings

#SingleInstance, Force
#NoEnv
#MaxHotkeysPerInterval 200
SendMode Input
SetTitleMatchMode 3
SetBatchLines -1

Menu, Tray, NoStandard
Menu, Tray, Add, Settings, Settings
Menu, Tray, Default, Settings
Menu, Tray, Add, Reload, Reload
Menu, Tray, Add, About, About
Menu, Tray, Add, Exit, Close

readIniFile()
defineHotKeys()

if (allwaysCheckForFree = 1)
    GoSub activateAllwaysCheckForFree

if (autoBuyInMax = 1)
    GoSub autoBuyInForMax
    
if (autoConfirmRebuy = 1)
    GoSub activateAutoConfirmRebuy
    
if (autoConfirmAllIn = 1)
    GoSub activateAutoConfirmAllIn
    
if (autoConfirmLeave = 1)
    GoSub activateAutoConfirmLeave
     
if (autoConfirmWaitingList = 1)
    GoSub activateAutoConfirmWaitingList

return

    
; GUI to choose settings
Settings:
    ; add tabs
    Gui, Add, Tab, x-4 y0 w500 h750 , Table Hotkeys|Other Hotkeys|Options
    
    Gui, Add, Text, x10 y32 w100 h20 , Fold
    Gui, Add, Edit, x90 y30 w90 h20 vFold, %Fold%
    Gui, Add, Text, x10 y52 w100 h20 , Check/Call
    Gui, Add, Edit, x90 y50 w90 h20 vCheckCall, %CheckCall%
    Gui, Add, Text, x10 y72 w100 h20 , Raise
    Gui, Add, Edit, x90 y70 w90 h20 vRaise, %Raise%
    Gui, Add, Text, x10 y92 w100 h20 , All In
    Gui, Add, Edit, x90 y90 w90 h20 vBetAllIn, %BetAllIn%
    Gui, Add, CheckBox, x195 y90 w50 h20 Checked%InstantAllIn% vInstantAllIn, Instant
    Gui, Add, Text, x10 y112 w100 h20 , Bet Full Pot
    Gui, Add, Edit, x90 y110 w90 h20 vBetFullPot, %BetFullPot%
    Gui, Add, CheckBox, x195 y110 w50 h20 Checked%InstantFullPot% vInstantFullPot, Instant
    Gui, Add, Text, x10 y152 w20 h20 , Bet
    Gui, Add, Edit, x30 y150 w25 h20 vpercentage1, %percentage1%
    Gui, Add, Text, x56 y152 w40 h20 , `% pot
    Gui, Add, Edit, x90 y150 w90 h20 vBetPotPercentage1, %BetPotPercentage1%
    Gui, Add, Text, x10 y172 w20 h20 , Bet
    Gui, Add, Edit, x30 y170 w25 h20 vpercentage2, %percentage2%
    Gui, Add, Text, x56 y172 w40 h20 , `% pot
    Gui, Add, Edit, x90 y170 w90 h20 vBetPotPercentage2, %BetPotPercentage2%
    Gui, Add, Text, x10 y192 w20 h20 , Bet
    Gui, Add, Edit, x30 y190 w25 h20 vpercentage3, %percentage3%
    Gui, Add, Text, x56 y192 w40 h20 , `% pot
    Gui, Add, Edit, x90 y190 w90 h20 vBetPotPercentage3, %BetPotPercentage3%
    Gui, Add, Text, x10 y212 w20 h20 , Bet
    Gui, Add, Edit, x30 y210 w25 h20 vpercentage4, %percentage4%
    Gui, Add, Text, x56 y212 w40 h20 , `% pot
    Gui, Add, Edit, x90 y210 w90 h20 vBetPotPercentage4, %BetPotPercentage4%
    Gui, Add, Text, x10 y252 w20 h20 , Bet
    Gui, Add, Edit, x30 y250 w25 h20 vbbAmount1, %bbAmount1%
    Gui, Add, Text, x56 y252 w40 h20 , BBs
    Gui, Add, Edit, x90 y250 w90 h20 vBetBBAmount1, %BetBBAmount1%
    Gui, Add, Text, x10 y272 w20 h20 , Bet
    Gui, Add, Edit, x30 y270 w25 h20 vbbAmount2, %bbAmount2%
    Gui, Add, Text, x56 y272 w40 h20 , BBs
    Gui, Add, Edit, x90 y270 w90 h20 vBetBBAmount2, %BetBBAmount2%
    Gui, Add, Text, x10 y292 w100 h20 , Add 1 BB
    Gui, Add, Edit, x90 y290 w90 h20 vAdd1BB, %Add1BB%
    Gui, Add, Text, x10 y312 w100 h20 , Subtract 1 BB
    Gui, Add, Edit, x90 y310 w90 h20 vSubtract1BB, %Subtract1BB%
    Gui, Add, Text, x10 y332 w100 h20 , Add 1 SB
    Gui, Add, Edit, x90 y330 w90 h20 vAdd1SB, %Add1SB%
    Gui, Add, Text, x10 y352 w100 h20 , Subtract1 SB
    Gui, Add, Edit, x90 y350 w90 h20 vSubtract1SB, %Subtract1SB%
    
    Gui, Add, Button, x75 y400 w50 h20 gSave, Save 
    Gui, Add, Button, x135 y400 w50 h20 gCancel, Cancel
    
    Gui, Tab, Other Hotkeys
    Gui, Add, Text, x5 y32 w100 h20 , Auto Rebuy
    Gui, Add, Edit, x85 y30 w90 h20 vAutoRebuy, %AutoRebuy%
    Gui, Add, Text, x5 y52 w100 h20 , Sit Out
    Gui, Add, Edit, x85 y50 w90 h20 vSitOut, %SitOut%
    Gui, Add, Text, x5 y72 w100 h20 , No More Blinds
    Gui, Add, Edit, x85 y70 w90 h20 vNoMoreBlinds, %NoMoreBlinds%
    Gui, Add, Text, x5 y92 w100 h20 , Sit In
    Gui, Add, Edit, x85 y90 w90 h20 vSitIn, %SitIn%
    Gui, Add, Text, x5 y132 w100 h20 , Exit Application
    Gui, Add, Edit, x85 y130 w90 h20 vExitApplication, %ExitApplication%
    
    Gui, Add, Button, x75 y400 w50 h20 gSave, Save 
    Gui, Add, Button, x135 y400 w50 h20 gCancel, Cancel
    
    Gui, Tab, Options
    Gui, Add, CheckBox, x5 y30 w230 h20 Checked%actOnActiveTable% vactOnActiveTable, Act on active table (or table under mouse)
    Gui, Add, CheckBox, x5 y50 w200 h20 Checked%allwaysCheckForFree% vallwaysCheckForFree, Allways check for free
    Gui, Add, CheckBox, x5 y70 w200 h20 Checked%autoBuyInMax% vautoBuyInMax, Auto buy in for table maximum
    Gui, Add, CheckBox, x5 y90 w200 h20 Checked%autoConfirmRebuy% vautoConfirmRebuy, Auto confirm rebuy pop-up
    Gui, Add, CheckBox, x5 y110 w200 h20 Checked%autoConfirmAllIn% vautoConfirmAllIn, Auto confirm large all-in
    Gui, Add, CheckBox, x5 y130 w200 h20 Checked%autoConfirmLeave% vautoConfirmLeave, Auto confirm leave table pop-up
    Gui, Add, CheckBox, x5 y150 w200 h20 Checked%autoConfirmWaitingList% vautoConfirmWaitingList, Auto confirm waiting list pop-ups
    
    Gui, Add, Button, x75 y400 w50 h20 gSave, Save 
    Gui, Add, Button, x135 y400 w50 h20 gCancel, Cancel
    
    Gui, Show, x100 y50 h450 w260, EntHelper Settings
return

Save:
    Gui, Submit
    FileDelete, EntHelper.ini
    writeIni()
    Reload
return

Cancel:
    Gui, Destroy
return

GuiClose:
    Gui, Destroy
return

Fold:
    pressFoldButton(getTableID(), Fold)
return

CheckCall:
    pressCheckButton(getTableID(), CheckCall)
return

Raise:
    pressRaiseButton(getTableID(), Raise)
return

BetPotPercentage1:
    bet(getTableID(), percentage1, BetPotPercentage1)
return

BetPotPercentage2:
    bet(getTableID(), percentage2, BetPotPercentage2)
return

BetPotPercentage3:
    bet(getTableID(), percentage3, BetPotPercentage3)
return

BetPotPercentage4:
    bet(getTableID(), percentage4, BetPotPercentage4)
return

BetBBAmount1:
    betBB(getTableID(), bbAmount1, BetBBAmount1)
return

BetBBAmount2:
    betBB(getTableID(), bbAmount2, BetBBAmount2)
return

BetFullPot:
    bet(getTableID(), 100, BetFullPot)
    if (InstantFullPot = True)
        pressRaiseButton(getTableID(), "")
return

BetAllIn:
    pressAllInButton(getTableID(), BetAllIn)
    if (InstantAllIn = True)
        pressRaiseButton(getTableID(), "")
return

Add1BB:
    changeBet(getTableID(), "up", "bb", Add1BB)
return

Subtract1BB:
    changeBet(getTableID(), "down", "bb", Subtract1BB)
return

Add1SB:
    changeBet(getTableID(), "up", "sb", Add1SB)
return

Subtract1SB:
    changeBet(getTableID(), "down", "sb", Subtract1SB)
return

ExitApplication:
    GoSub Close
return

AutoRebuy:
    PressButton(getTableID(), autoRebuyX, autoRebuyY, AutoRebuy)
return

SitOut:
    PressButton(getTableID(), sitOutX, sitOutY, SitOut)
return

NoMoreBlinds:
    PressButton(getTableID(), noBlindsX, noBlindsY, NoMoreBlinds)
return

SitIn:
    PressButton(getTableID(), sitInX, sitInY, SitIn)
return

Reload:
    Reload
return

About:
    Msgbox,, About,
    (
    Entraction Helper, v0.3R7
    
    If you like this script please consider donating some money,
    using one of the following options:
    - transfer to OSRichard on PokerStars
    - transfer to YorickFTP on FullTilt
    - Moneybookers transfer to os.pstars@gmail.com
    
    If you have any suggestions/requests/comments,
    PM me on 2+2 forums @ OSRichard.
    )
return

Close:
    ExitApp
return

RemoveToolTip:
    SetTimer, RemoveToolTip, Off
    ToolTip
return

activateAllwaysCheckForFree:
    SetTimer, checkForFree, 500
return

autoBuyInForMax:
    SetTimer, buyInForMax, 500
return

activateAutoConfirmRebuy:
    SetTimer, autoCloseRebuy, 500
return

activateAutoConfirmAllIn:
    SetTimer, autoConfirmLargeAllIn, 500
return

activateAutoConfirmLeave:
    SetTimer, autoConfirmLeaveTable, 500
return

activateAutoConfirmWaitingList:
    SetTimer, autoConfirmWaitingListPp, 500
return

checkForFree:
    checkForFreeWindowTitle := "Confirm fold"

    IfWinExist, %checkForFreeWindowTitle%
    {
        
        ; press "Check" button
        CoordMode, Mouse, Screen
        MouseGetPos, px, py
        CoordMode, Mouse, Relative
        WinGetActiveStats, title, width, height, ax, ay
        X := Round(width * checkForFreeX)
        Y := Round(height * checkForFreeY)
        ;Tooltip, title: %title%`nX: %X%`nY: %Y%`ncheckForFreeWindowTitle: %checkForFreeWindowTitle%
        ;SetTimer, RemoveToolTip, 5000
        MouseClick,, X, Y,, 0
        CoordMode, Mouse, Screen
        MouseMove, px, py, 0
        CoordMode, Mouse, Relative
    }
return

buyInForMax:
    IfWinExist, ahk_class SunAwtDialog
    {
        WinGetActiveStats, title, width, height, ax, ay
        if (title = "") {
            CoordMode, Mouse, Screen
            MouseGetPos, px, py
            CoordMode, Mouse, Relative
            X := Round(width * maxBuyInX)
            Y := Round(height * maxBuyInY)
            ;Tooltip, title: %title%`nX: %X%`nY: %Y%
            ;SetTimer, RemoveToolTip, 5000
            MouseClick,, X, Y,, 0
            sleep 50
            X := Round(width * confirmBuyInX)
            Y := Round(height * confirmBuyInY)
            MouseClick,, X, Y,, 0
            CoordMode, Mouse, Screen
            MouseMove, px, py, 0
            CoordMode, Mouse, Relative
        }
    }
return

autoCloseRebuy:
    autoCloseRebuyWindowTitle := "Auto Rebuy turned on"

    IfWinExist, %autoCloseRebuyWindowTitle%
    {
        ; press "Ok" button
        CoordMode, Mouse, Screen
        MouseGetPos, px, py
        CoordMode, Mouse, Relative
        WinGetActiveStats, title, width, height, ax, ay
        X := Round(width * rebuyOkX)
        Y := Round(height * rebuyOkY)
        ;Tooltip, title: %title%`nX: %X%`nY: %Y%`nautoCloseRebuyWindowTitle: %autoCloseRebuyWindowTitle%
        ;SetTimer, RemoveToolTip, 5000
        MouseClick,, X, Y,, 0
        CoordMode, Mouse, Screen
        MouseMove, px, py, 0
        CoordMode, Mouse, Relative
    }
return

autoConfirmLargeAllIn:
    autoConfirmLargeAllInWindowTitle := "Confirm Large All-In Raise"

    IfWinExist, %autoConfirmLargeAllInWindowTitle%
    {
        ; press "Ok" button
        CoordMode, Mouse, Screen
        MouseGetPos, px, py
        CoordMode, Mouse, Relative
        WinGetActiveStats, title, width, height, ax, ay
        X := Round(width * confirmAllInX)
        Y := Round(height * confirmAllInY)
        ;Tooltip, title: %title%`nX: %X%`nY: %Y%`nautoConfirmLargeAllInWindowTitle: %autoConfirmLargeAllInWindowTitle%
        ;SetTimer, RemoveToolTip, 5000
        MouseClick,, X, Y,, 0
        CoordMode, Mouse, Screen
        MouseMove, px, py, 0
        CoordMode, Mouse, Relative
    }
return

autoConfirmLeaveTable:
    autoConfirmLeaveTableWindowTitle := "Confirm leave"

    IfWinExist, %autoConfirmLeaveTableWindowTitle%
    {
        ; press "Ok" button
        CoordMode, Mouse, Screen
        MouseGetPos, px, py
        CoordMode, Mouse, Relative
        WinGetActiveStats, title, width, height, ax, ay
        X := Round(width * confirmLeaveX)
        Y := Round(height * confirmLeaveY)
        ;Tooltip, title: %title%`nX: %X%`nY: %Y%`nautoConfirmLeaveTableWindowTitle: %autoConfirmLeaveTableWindowTitle%
        ;SetTimer, RemoveToolTip, 5000
        MouseClick,, X, Y,, 0
        CoordMode, Mouse, Screen
        MouseMove, px, py, 0
        CoordMode, Mouse, Relative
    }
return

autoConfirmWaitingListPp:
    autoConfirmWaitingListWindowTitle := "Waiting List"

    IfWinExist, %autoConfirmWaitingListWindowTitle%
    {
        WinActivate, %autoConfirmWaitingListWindowTitle%
        
        ; press "Ok" button
        CoordMode, Mouse, Screen
        MouseGetPos, px, py
        CoordMode, Mouse, Relative
        WinGetActiveStats, title, width, height, ax, ay
        
        X := Round(width * confirmWaiting1X)
        Y := Round(height * confirmWaiting1Y)
        ;Tooltip, title: %title%`nX: %X%`nY: %Y%`nautoConfirmWaitingListWindowTitle: %autoConfirmWaitingListWindowTitle%
        ;SetTimer, RemoveToolTip, 5000
        MouseClick,, X, Y,, 0
        
        X := Round(width * confirmWaiting2X)
        Y := Round(height * confirmWaiting2Y)
        ;Tooltip, title: %title%`nX: %X%`nY: %Y%`nautoConfirmWaitingListWindowTitle: %autoConfirmWaitingListWindowTitle%
        ;SetTimer, RemoveToolTip, 5000
        MouseClick,, X, Y,, 0
        
        CoordMode, Mouse, Screen
        MouseMove, px, py, 0
        CoordMode, Mouse, Relative
    }
return

getTableID()
{
    global actOnActiveTable
  
    ID := ""
    if (actOnActiveTable = 1) {
        WinGet, ID,, A 
    } else {
        MouseGetPos,,,ID
    }
    
    WinGetTitle, title, ahk_id %id%
    Needle := ")  [Connection: "
    IfInString, title, %Needle% 
    {
      return ID
    }
    
    ID := ""
    return ID
}

bet(ID, percentage, key) {
    
    ;Traytip,, bet ID: %ID%
    if (ID = "") {
        if (key <> "")
            Send {%key%}
        return
    }
        
    Critical, On
    pressPotButton(ID, key)
    betSize := readBetBox(ID)
    newBetSize := Round(betSize * percentage / 100,2)
    ;Tooltip, ID: %ID%`nbetSize: %betSize%`npercentage: %percentage%`nnewBetSize: %newBetSize%
    ;SetTimer, RemoveToolTip, 5000
    writeBetBox(ID, newBetSize)
    Critical, Off
}

betBB(ID, amount, key) {
    
    ;Traytip,, bet ID: %ID%
    if (ID = "") {
        if (key <> "")
            Send {%key%}
        return
    }
        
    Critical, On
    bigBlind := getBlind(ID, "bb")
    newBetSize := Round(bigBlind * amount,2)
    ;Tooltip, ID: %ID%`nbetSize: %betSize%`npercentage: %percentage%`nnewBetSize: %newBetSize%
    ;SetTimer, RemoveToolTip, 5000
    writeBetBox(ID, newBetSize)
    Critical, Off
}

changeBet(ID, direction, amount, key) {
    global actOnActiveTable
    
    ;Traytip,, changebet ID: %ID%`nactOnActiveTable: %actOnActiveTable%
    if (ID = "") {
        if (key <> "")
            Send {%key%}
        return
    }
    
    if (actOnActiveTable <> 1) 
        WinActivate, ahk_id %ID%
    
    Critical, On
    betSize := readBetBox(ID)
   
    if (amount = "bb") or (amount = "sb")
        raiseSize := getBlind(ID, amount)
    ;Msgbox, raiseSize: %raiseSize%
        
    if (direction = "up")
        newBetSize := betSize + raiseSize
    else
        newBetSize := betSize - raiseSize
        
    writeBetBox(ID, newBetSize)
    Critical, Off
}

getBlind(ID, amount) {
    WinGetTitle, title, ahk_id %ID%
    StringSplit, title_array, title, (
    StringSplit, game_type_blinds_connection, title_array%title_array0%, )
    StringSplit, game_type_blinds, game_type_blinds_connection1, %A_Space%
    ;ttt := game_type_blinds%game_type_blinds0%
    ;Traytip,, title: %title%`nblinds: %ttt%
    StringSplit, blinds, game_type_blinds%game_type_blinds0%, /
    
    if (amount = "sb")
        return blinds1
    else
        return blinds2
}

readBetBox(ID) {
    global actOnActiveTable, betBoxX, betBoxY
    
    ;Traytip,, readbetbox ID: %ID%`nactOnActiveTable: %actOnActiveTable%
    if (ID = "") {
        return
    }
    
    if (actOnActiveTable <> 1) 
        WinActivate, ahk_id %ID%
    
    WinGetActiveStats, title, width, height, ax, ay
    X := Round(width * betBoxX)
    Y := Round(height * betBoxY)
    ;Traytip,, title: %title%`nX: %X%`nY: %Y%
    CoordMode, Mouse, Screen
    MouseGetPos, px, py
    CoordMode, Mouse, Relative
    MouseClick,, X, Y,, 0
    sleep 50
    
    oldClipBoard = %clipBoard%
    clipboard =  ; Start off empty to allow ClipWait to detect when the text has arrived.
    Send {HOME}+{END}
    Send ^c
    ClipWait 0.2 ; Wait for the clipboard to contain text.
    If !ErrorLevel 
	text := clipboard
    clipboard = %oldClipBoard%
    CoordMode, Mouse, Screen
    MouseMove, px, py, 0
    CoordMode, Mouse, Relative
    
    ;Tooltip, text: %text%
    ;SetTimer, RemoveToolTip, 3000
    
    return text
}

writeBetBox(ID, betSize) {
    global actOnActiveTable, betBoxX, betBoxY
    
    if (ID = "") {
        return
    }
    
    if (actOnActiveTable <> 1) 
        WinActivate, ahk_id %ID%
    
    WinGetActiveStats, title, width, height, ax, ay
    X := Round(width * betBoxX)
    Y := Round(height * betBoxY)
    ;Traytip,, title: %title%`nX: %X%`nY: %Y%
    CoordMode, Mouse, Screen
    MouseGetPos, px, py
    CoordMode, Mouse, Relative
    MouseClick,, X, Y,, 0
    sleep 50
    
    ;Tooltip, betSize: %betSize%
    ;SetTimer, RemoveToolTip, 3000
    
    Send {HOME}+{END}%betSize%
    CoordMode, Mouse, Screen
    MouseMove, px, py, 0
    CoordMode, Mouse, Relative

}

pressFoldButton(ID, key) {
    global FoldX, FoldY
    PressButton(ID, FoldX, FoldY, key)
}

pressCheckButton(ID, key) {
    global CheckX, CheckY
    PressButton(ID, CheckX, CheckY, key)
}

pressRaiseButton(ID, key) {
    global RaiseX, RaiseY
    PressButton(ID, RaiseX, RaiseY, key)
}

pressPotButton(ID, key) {
    global PotX, PotY
    PressButton(ID, PotX, PotY, key)
}

pressAllInButton(ID, key) {
    global AllInX, AllInY
    PressButton(ID, AllInX, AllInY, key)
}

PressButton(ID, qx, qy, key) {
    global actOnActiveTable
    
    ;Traytip,, button ID: %ID%`nactOnActiveTable: %actOnActiveTable%
    if (ID = "") {
        if (key <> "")
            Send {%key%}
        return
    }
     
    if (actOnActiveTable <> 1) 
        WinGetPos, ax, ay, width, height, ahk_id %ID%
    else
        WinGetActiveStats, title, width, height, ax, ay
    
    X := Round(width * qx)
    Y := Round(height * qy)
    ;Traytip,, title: %title%`nX: %X%`nY: %Y%
    CoordMode, Mouse, Screen
    MouseGetPos, px, py
    CoordMode, Mouse, Relative
    MouseClick,, X, Y,, 0
    CoordMode, Mouse, Screen
    MouseMove, px, py, 0
    CoordMode, Mouse, Relative
}

readIniFile() {
    global
    IfNotExist, EntHelper.ini
    {
        createIni()
        ;Traytip,, Inifile created
        return
    }
    
    ; read general options
    IniRead, actOnActiveTable,  EntHelper.ini, Options,  actOnActiveTable, 0
    IniRead, allwaysCheckForFree,  EntHelper.ini, Options,  allwaysCheckForFree, 0
    IniRead, autoBuyInMax,  EntHelper.ini, Options,  autoBuyInMax, 0
    IniRead, autoConfirmRebuy,  EntHelper.ini, Options,  autoConfirmRebuy, 0
    IniRead, autoConfirmAllIn,  EntHelper.ini, Options,  autoConfirmAllIn, 0
    IniRead, autoConfirmLeave,  EntHelper.ini, Options,  autoConfirmLeave, 0
    IniRead, autoConfirmWaitingList,  EntHelper.ini, Options,  autoConfirmWaitingList, 0
    IniRead, InstantAllIn,  EntHelper.ini, Options,  InstantAllIn, 0
    IniRead, InstantFullPot,  EntHelper.ini, Options,  InstantFullPot, 0
    
    ; read pot percentages
    IniRead, percentage1, EntHelper.ini, PotPercentages, percentage1, 0
    IniRead, percentage2, EntHelper.ini, PotPercentages, percentage2, 0
    IniRead, percentage3, EntHelper.ini, PotPercentages, percentage3, 0
    IniRead, percentage4, EntHelper.ini, PotPercentages, percentage4, 0
    IniRead, bbAmount1, EntHelper.ini, PotPercentages, bbAmount1, 0
    IniRead, bbAmount2, EntHelper.ini, PotPercentages, bbAmount2, 0
    
    ; read hotkeys
    IniRead, Fold, EntHelper.ini, Hotkeys, Fold, %A_Space%
    IniRead, CheckCall, EntHelper.ini, Hotkeys, CheckCall, %A_Space%
    IniRead, Raise, EntHelper.ini, Hotkeys, Raise, %A_Space%
    
    IniRead, BetPotPercentage1, EntHelper.ini, Hotkeys, BetPotPercentage1, %A_Space%
    IniRead, BetPotPercentage2, EntHelper.ini, Hotkeys, BetPotPercentage2, %A_Space%
    IniRead, BetPotPercentage3, EntHelper.ini, Hotkeys, BetPotPercentage3, %A_Space%
    IniRead, BetPotPercentage4, EntHelper.ini, Hotkeys, BetPotPercentage4, %A_Space%
    IniRead, BetBBAmount1, EntHelper.ini, Hotkeys, BetBBAmount1, %A_Space%
    IniRead, BetBBAmount2, EntHelper.ini, Hotkeys, BetBBAmount2, %A_Space%
    
    IniRead, BetFullPot, EntHelper.ini, Hotkeys, BetFullPot, %A_Space%
    IniRead, BetAllIn, EntHelper.ini, Hotkeys, BetAllIn, %A_Space%
    
    IniRead, Add1BB, EntHelper.ini, Hotkeys, Add1BB, %A_Space%
    IniRead, Subtract1BB, EntHelper.ini, Hotkeys, Subtract1BB, %A_Space%
    IniRead, Add1SB, EntHelper.ini, Hotkeys, Add1SB, %A_Space%
    IniRead, Subtract1SB, EntHelper.ini, Hotkeys, Subtract1SB, %A_Space%

    IniRead, ExitApplication, EntHelper.ini, Hotkeys, ExitApplication, %A_Space%
    IniRead, AutoRebuy, EntHelper.ini, Hotkeys, AutoRebuy, %A_Space%
    IniRead, SitOut, EntHelper.ini, Hotkeys, SitOut, %A_Space%
    IniRead, NoMoreBlinds, EntHelper.ini, Hotkeys, NoMoreBlinds, %A_Space%
    IniRead, SitIn, EntHelper.ini, Hotkeys, SitIn, %A_Space%
}

createIni() {
    global

    ; set general options
    actOnActiveTable := True
    allwaysCheckForFree := True
    autoBuyInMax := True
    autoConfirmRebuy := True
    autoConfirmAllIn := True
    autoConfirmLeave := True
    autoConfirmWaitingList := True
    InstantAllIn := False
    InstantFullPot := False
    
    ; set pot percentages
    percentage1 := 66
    percentage2 := 75
    percentage3 := 90
    percentage4 := 115
    
    bbAmount1 := 2.5
    bbAmount2 := 4.5
    
    ;set hotkeys
    Fold = NumpadHome
    CheckCall = NumpadUp
    Raise = NumpadPgUp
    
    BetBBAmount1 = NumpadLeft 
    BetBBAmount2 = NumpadClear
    
    BetPotPercentage1 = NumpadRight
    BetPotPercentage2 = NumpadEnd
    BetPotPercentage3 = NumpadDown
    BetPotPercentage4 = NumpadPgDn
    
    BetFullPot = NumpadAdd
    BetAllIn = NumpadIns
    
    Add1BB = WheelUp
    Subtract1BB = WheelDown

    ExitApplication = F8
    AutoRebuy = F9
    SitOut = F10
    NoMoreBlinds = F11
    SitIn = F12
   
   
    writeIni()
}

writeIni() {
    global
    
    ; write general options
    if actOnActiveTable
        IniWrite, %actOnActiveTable%,  EntHelper.ini, Options,  actOnActiveTable
    if allwaysCheckForFree
        IniWrite, %allwaysCheckForFree%,  EntHelper.ini, Options,  allwaysCheckForFree
    if autoBuyInMax
        IniWrite, %autoBuyInMax%,  EntHelper.ini, Options,  autoBuyInMax
    if autoConfirmRebuy
        IniWrite, %autoConfirmRebuy%,  EntHelper.ini, Options,  autoConfirmRebuy
    if autoConfirmAllIn
        IniWrite, %autoConfirmAllIn%,  EntHelper.ini, Options,  autoConfirmAllIn
    if autoConfirmLeave
        IniWrite, %autoConfirmLeave%,  EntHelper.ini, Options,  autoConfirmLeave
    if autoConfirmWaitingList
        IniWrite, %autoConfirmWaitingList%,  EntHelper.ini, Options,  autoConfirmWaitingList
    if InstantAllIn
        IniWrite, %InstantAllIn%,  EntHelper.ini, Options,  InstantAllIn
    if InstantFullPot
        IniWrite, %InstantFullPot%,  EntHelper.ini, Options,  InstantFullPot
    
    ; write pot percentages
    if percentage1
        IniWrite, %percentage1%, EntHelper.ini, PotPercentages, percentage1
    if percentage2
        IniWrite, %percentage2%, EntHelper.ini, PotPercentages, percentage2
    if percentage3
        IniWrite, %percentage3%, EntHelper.ini, PotPercentages, percentage3
    if percentage4
        IniWrite, %percentage4%, EntHelper.ini, PotPercentages, percentage4
        
    if bbAmount1
        IniWrite, %bbAmount1%, EntHelper.ini, PotPercentages, bbAmount1
    if bbAmount2
        IniWrite, %bbAmount2%, EntHelper.ini, PotPercentages, bbAmount2
    
    ; write hotkeys
    if Fold
        IniWrite, %Fold%, EntHelper.ini, Hotkeys, Fold
    if CheckCall
        IniWrite, %CheckCall%, EntHelper.ini, Hotkeys, CheckCall
    if Raise
        IniWrite, %Raise%, EntHelper.ini, Hotkeys, Raise
        
    if BetPotPercentage1
        IniWrite, %BetPotPercentage1%, EntHelper.ini, Hotkeys, BetPotPercentage1
    if BetPotPercentage2
        IniWrite, %BetPotPercentage2%, EntHelper.ini, Hotkeys, BetPotPercentage2
    if BetPotPercentage3
        IniWrite, %BetPotPercentage3%, EntHelper.ini, Hotkeys, BetPotPercentage3
    if BetPotPercentage4
        IniWrite, %BetPotPercentage4%, EntHelper.ini, Hotkeys, BetPotPercentage4
    if BetBBAmount1
        IniWrite, %BetBBAmount1%, EntHelper.ini, Hotkeys, BetBBAmount1
    if BetBBAmount2
        IniWrite, %BetBBAmount2%, EntHelper.ini, Hotkeys, BetBBAmount2
        
    if BetFullPot
        IniWrite, %BetFullPot%, EntHelper.ini, Hotkeys, BetFullPot
    if BetAllIn
        IniWrite, %BetAllIn%, EntHelper.ini, Hotkeys, BetAllIn
        
    if Add1BB
        IniWrite, %Add1BB%, EntHelper.ini, Hotkeys, Add1BB
    if Subtract1BB
        IniWrite, %Subtract1BB%, EntHelper.ini, Hotkeys, Subtract1BB
    if Add1SB
        IniWrite, %Add1SB%, EntHelper.ini, Hotkeys, Add1SB
    if Subtract1SB
        IniWrite, %Subtract1SB%, EntHelper.ini, Hotkeys, Subtract1SB

    if ExitApplication
        IniWrite, %ExitApplication%, EntHelper.ini, Hotkeys, ExitApplication
    if AutoRebuy
        IniWrite, %AutoRebuy%, EntHelper.ini, Hotkeys, AutoRebuy
    if SitOut
        IniWrite, %SitOut%, EntHelper.ini, Hotkeys, SitOut
    if NoMoreBlinds
        IniWrite, %NoMoreBlinds%, EntHelper.ini, Hotkeys, NoMoreBlinds
    if SitIn
        IniWrite, %SitIn%, EntHelper.ini, Hotkeys, SitIn
    
}

defineHotKeys() {
    global

    if Fold
        HotKey, %Fold%, Fold
    if CheckCall
        HotKey, %CheckCall%, CheckCall
    if Raise
        HotKey, %Raise%, Raise
        
    if BetPotPercentage1
        HotKey, %BetPotPercentage1%, BetPotPercentage1
    if BetPotPercentage2
        HotKey, %BetPotPercentage2%, BetPotPercentage2
    if BetPotPercentage3
        HotKey, %BetPotPercentage3%, BetPotPercentage3
    if BetPotPercentage4
        HotKey, %BetPotPercentage4%, BetPotPercentage4
        
    if BetBBAmount1
        HotKey, %BetBBAmount1%, BetBBAmount1
    if BetBBAmount2
        HotKey, %BetBBAmount2%, BetBBAmount2
        
    if BetFullPot
        HotKey, %BetFullPot%, BetFullPot
    if BetAllIn
        HotKey, %BetAllIn%, BetAllIn
    
    if Add1BB
        HotKey, %Add1BB%, Add1BB
    if Subtract1BB
        HotKey, %Subtract1BB%, Subtract1BB
    if Add1SB
        HotKey, %Add1SB%, Add1SB
    if Subtract1SB
        HotKey, %Subtract1SB%, Subtract1SB
        
    if ExitApplication
        HotKey, %ExitApplication%, ExitApplication
    if AutoRebuy
        HotKey, %AutoRebuy%, AutoRebuy
    if SitOut
        HotKey, %SitOut%, SitOut
    if NoMoreBlinds
        HotKey, %NoMoreBlinds%, NoMoreBlinds
    if SitIn
        HotKey, %SitIn%, SitIn
}
New Donationware Software: Entraction helper script Quote
09-08-2010 , 01:04 AM
Quote:
Originally Posted by theimprover
Hi all, i'm new here, so take it easy, can someone please tell me how i get this script to work, what exactly do i have to do.
Thanks in advance
For the script to work, you need to have Autohotkey installed. You then save this script in a file with the ahk extension (make sure windows explorer does not hide the extension and it is not txt), click right on it and choose "Compile script" from the menu. This makes an executable file. Make sure you execute this file as an administrator. That's it
New Donationware Software: Entraction helper script Quote
09-13-2010 , 01:26 PM
Quote:
Originally Posted by OSRichard
For the script to work, you need to have Autohotkey installed. You then save this script in a file with the ahk extension (make sure windows explorer does not hide the extension and it is not txt), click right on it and choose "Compile script" from the menu. This makes an executable file. Make sure you execute this file as an administrator. That's it
Hi Richard, i have it all set up, but now my problem is using it, does this work with the mouse? because i cant seem to get it to work with it, all i can do is when i join a table it auto buys in for me but it wont auto top up, I'm not very good at setting up this kinda stuff so would appreciate a bit of help please.
cheers.
New Donationware Software: Entraction helper script Quote
09-14-2010 , 05:43 AM
I have this all sorted, but there is still a big problem with folding on the wrong table, can this be sorted out at all?
New Donationware Software: Entraction helper script Quote
09-17-2010 , 08:33 AM
just like to say thanks for this :-D Trying it out today!
New Donationware Software: Entraction helper script Quote
09-22-2010 , 04:26 PM
Hi Richard,
My name is Orlando, from Spain. I needed some features that your program does not include and therefore I edited your source code. Specifically I added the possibility to buy an amount of BBs. Im a shorstack player, then i often need this. I would like to share the changes I made, but i dont know the license with which you posted your software.
New Donationware Software: Entraction helper script Quote
09-22-2010 , 04:34 PM
Hi Orlando.

I didn't choose a specific license, please just post the modified code in this thread. You can post the full script, or just your modifications, and I'll integrate them.

If you have a suggestion for which license to use, please do, I don't know much about licensing.

Thanks
New Donationware Software: Entraction helper script Quote

      
m