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

12-02-2010 , 09:22 AM
Quote:
Originally Posted by theimprover
I cant get this to work when i have HM importing, it will work fine with out it, any ideas?
That doesn't work for me either.
New Donationware Software: Entraction helper script Quote
12-02-2010 , 05:15 PM
Quote:
Originally Posted by crafty
Is there any possibility of implementing a hotkey, which places you in a waiting list?
Hi.

I don't plan on adding new features. It does almost all that I wanted, the only thing that I couldn't resolve is the issue with tables popping up when you have a decision to take at the active table.

If someone wants to add other features, feel free. The latest version's source of the script is in this thread, and anyone can improve it and post their modifications here.
New Donationware Software: Entraction helper script Quote
12-02-2010 , 05:19 PM
Quote:
Originally Posted by theimprover
I cant get this to work when i have HM importing, it will work fine with out it, any ideas?
Maybe you have the HUD for one of the players covering the area where the script tries to click (action buttons, pot percentage buttons, bet amount) ? Try changing the positioning a bit, see if that helps.
New Donationware Software: Entraction helper script Quote
12-16-2010 , 11:58 PM
is there a way to buy in for 20BB and to autorebuy only up to 20BB
New Donationware Software: Entraction helper script Quote
12-18-2010 , 11:29 PM
Is there no way to solve the popup problem? I guess i am not the only one who would pay some $ for that

This+the Tableskinner would make the software actually pretty good
New Donationware Software: Entraction helper script Quote
12-21-2010 , 07:58 AM
I've been using this which helps a little with the popups and is great for writing notes as even if a table activates it goes straight back to the window under the mouse so you can continue writing HEM notes (if you don't want to run the keyboard redirect script).

The script is very sensitive so can be annoying but it's paused easy enough by right clicking it's icon in the taskbar if it's interfering with something you are trying to do.

It needs to be run as a seperate script so save code in notepad as nameyouchoose.ahk

Code:
;
; AutoHotkey Version: 1.x
; Language:       English
; Platform:       Win9x/NT
; Author:         A.N.Other <myemail@nowhere.com>
;
; Script Function: Hover Activate
;


#persistent
setTimer, activator, 100
return

activator:
MouseGetPos, , , id, control
IfWinActive, ahk_id%id%
{
  return
}
else
{
  WinActivate, ahk_id %id%
}
return
New Donationware Software: Entraction helper script Quote
01-03-2011 , 05:48 AM
Quote:
Originally Posted by Rhibee
I've been using this which helps a little with the popups and is great for writing notes as even if a table activates it goes straight back to the window under the mouse so you can continue writing HEM notes (if you don't want to run the keyboard redirect script).

The script is very sensitive so can be annoying but it's paused easy enough by right clicking it's icon in the taskbar if it's interfering with something you are trying to do.

It needs to be run as a seperate script so save code in notepad as nameyouchoose.ahk

Code:
;
; AutoHotkey Version: 1.x
; Language:       English
; Platform:       Win9x/NT
; Author:         A.N.Other <myemail@nowhere.com>
;
; Script Function: Hover Activate
;


#persistent
setTimer, activator, 100
return

activator:
MouseGetPos, , , id, control
IfWinActive, ahk_id%id%
{
  return
}
else
{
  WinActivate, ahk_id %id%
}
return
Isn`t this just the known Keyboard-Redirect-script which holds the focus on the active table?
New Donationware Software: Entraction helper script Quote
01-03-2011 , 05:56 PM
Very nice script but having a problem - it does autoclose the window but only buy-in for 50bb instead of the max. (using the script from post #87)


Quote:
Originally Posted by MarcoA
is there a way to buy in for 20BB and to autorebuy only up to 20BB
New Donationware Software: Entraction helper script Quote
01-04-2011 , 01:51 PM
good way to take notes is to open notepad and write the note in there and copy/paste into HEM note window, couse it doesnt take focus out of notepad even if its your turn to act
New Donationware Software: Entraction helper script Quote
01-18-2011 , 09:06 PM
could anybody make this script auto buy in for 100bb, rebuy in for 100bb once you get stacked and if you want to top up whilst you still have chips back upto 100bb?

if anybody could do this i would pay some dollars.
New Donationware Software: Entraction helper script Quote
01-20-2011 , 12:59 PM
Quote:
Originally Posted by MarcoA
is there a way to buy in for 20BB and to autorebuy only up to 20BB
Yes there is. Buy in for 100bbs, play according to you skill level, back to 20bbs in no time!
New Donationware Software: Entraction helper script Quote
01-22-2011 , 08:27 PM
Quote:
Originally Posted by d0nk3y
Very nice script but having a problem - it does autoclose the window but only buy-in for 50bb instead of the max. (using the script from post #87)
Had the same problem with 24h Poker. You have to adjust the position of the Max buyin checkbox.

For 24h poker it is:

maxBuyInX := 0.32
maxBuyInY := 0.52
New Donationware Software: Entraction helper script Quote
03-05-2011 , 08:06 PM
my adition of original script
added autofocus tables and maked some change to improve perfomance )

could be buggy

use at you own risk

Code:
; Version 0.3R6

; percentage of the window width and height for center of buttons

checkForFreeWindowTitle := "Confirm fold"
autoCloseRebuyWindowTitle := "Auto Rebuy turned on"
autoConfirmWaitingListWindowTitle := "Waiting List"
autoConfirmLeaveTableWindowTitle:="Confirm leave"
autoConfirmLargeAllInWindowTitle := "Confirm Large All-In Raise"
skip_sizecheck:=0

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.55

confirmBuyInX := 0.7
confirmBuyInY := 0.89

rebuyOkX := 0.49
rebuyOkY := 0.74

confirmAllInX := 0.41
confirmAllInY := 0.73

confirmLeaveX := 0.45
confirmLeaveY := 0.73

waitlistx:=337
waitlisty:=510

confirmWaiting1X := 0.5
confirmWaiting1Y := 0.86

confirmWaiting2X := 0.41
confirmWaiting2Y := 0.86

buyin_procedure_running := 0

; End general settings

#SingleInstance, Force
#NoEnv
#MaxHotkeysPerInterval 200
SendMode Input
SetTitleMatchMode 2
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 (autoAutoFocus = 1 or)
    GoSub activateAutoFocus

GoSub activateCheckMessage




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, CheckBox, x5 y170 w200 h20 Checked%autoAutoFocus% vautoAutoFocus, Auto Focus tables under mouse 
   
    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



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

activateCheckMessage:
    SetTimer, CheckMessage, 100
return

RemoveToolTip:
    SetTimer, RemoveToolTip, Off
    ToolTip
return

activateAutoFocus:
    SetTimer, autoFocusF, 100
    
return


CheckMessage:

    
WinGet, id, list ,ahk_class SunAwtDialog,, Program Manager


Loop, %id%
{
    
   
    this_id := id%A_Index%
    
    WinGetTitle, window_title, ahk_id %this_id%
    
    ;msgbox %window_title%
    if (window_title=autoCloseRebuyWindowTitle and autoConfirmRebuy=1)
    {
        CoordMode, Mouse, Screen
        
        MouseGetPos, px, py      

        WinGetPos, WindowXpos, WindowYpos , confirm_width, confirm_height, ahk_id %this_id%
        WinGetClass, this_class, ahk_id %this_id%
        ;msgbox %this_class%
        ;MsgBox, Notepad is at %WindowXpos%`,%WindowYpos% size %confirm_width%, %confirm_height%
        if ((confirm_width=394 and confirm_height=125)or(skip_sizecheck=1))
        {
        
        ;msgbox here    
        ClickX := Round(confirm_width * rebuyOkX)
        ClickY := Round(confirm_height * rebuyOkY)
   
    
        absoluteX:=WindowXpos+ClickX
        absoluteY:=WindowYpos+ClickY
    
        ;MsgBox  %absoluteX% %absoluteY% %Xpos%` %Ypos%

        MouseClick,, absoluteX, absoluteY,, 0
    
        ;MouseMove, absoluteX,absoluteY, 0
        MouseMove, px, py, 0
        }
        
    }
    
    if (window_title=checkForFreeWindowTitle and allwaysCheckForFree=1)
    {
        
        CoordMode, Mouse, Screen
        
        MouseGetPos, px, py      

        WinGetPos, WindowXpos, WindowYpos , confirm_width, confirm_height, ahk_id %this_id%
        WinGetClass, this_class, ahk_id %this_id%
        ;msgbox %this_class%
        ;MsgBox, Notepad is at %WindowXpos%`,%WindowYpos% size %confirm_width%, %confirm_height%
        
        if ((confirm_width=387 and confirm_height=125)or(skip_sizecheck=1))
        {
        
        ;msgbox here    
        ClickX := Round(confirm_width * checkForFreeX)
        ClickY := Round(confirm_height * checkForFreeY)

        absoluteX:=WindowXpos+ClickX
        absoluteY:=WindowYpos+ClickY
    
        ;MsgBox  %absoluteX% %absoluteY% %Xpos%` %Ypos%

        MouseClick,, absoluteX, absoluteY,, 0
    
        ;MouseMove, absoluteX,absoluteY, 0
        MouseMove, px, py, 0
        
        }

    }

        
        if (window_title=autoConfirmWaitingListWindowTitle and autoConfirmWaitingList=1)
    {

        
        ; press "Ok" button
        CoordMode, Mouse, Screen
        MouseGetPos, px, py
        
        WinGetPos, WindowXpos, WindowYpos , confirm_width, confirm_height, ahk_id %this_id%
        
        if ((confirm_width=400 and confirm_height=265)or(skip_sizecheck=1))
        {
       
        ClickX := Round(confirm_width * confirmWaiting1X)
        ClickY := Round(confirm_height * confirmWaiting1Y)
        ;Tooltip, title: %title%`nX: %X%`nY: %Y%`nautoConfirmWaitingListWindowTitle: %autoConfirmWaitingListWindowTitle%
        ;SetTimer, RemoveToolTip, 5000
        
        absoluteX:=WindowXpos+ClickX
        absoluteY:=WindowYpos+ClickY
        
        MouseClick,, absoluteX, absoluteY,, 0
        
        ClickX := Round(confirm_width * confirmWaiting2X)
        ClickY := Round(confirm_height * confirmWaiting2Y)
       
        absoluteX:=WindowXpos+ClickX
        absoluteY:=WindowYpos+ClickY

        ;Tooltip, title: %title%`nX: %X%`nY: %Y%`nautoConfirmWaitingListWindowTitle: %autoConfirmWaitingListWindowTitle%
        ;SetTimer, RemoveToolTip, 5000
        MouseClick,, absoluteX, absoluteY,, 0
        
        CoordMode, Mouse, Screen
        MouseMove, px, py, 0
        
        }

    }

        if ((window_title="" and autoBuyInMax=1 and buyin_procedure_running=0)or(skip_sizecheck=1))
    {
        sleep 600
        
        ;msgbox buyin_procedure_running %buyin_procedure_running%

        buyin_procedure_running=1
        CoordMode, Mouse, Screen
        MouseGetPos, px, py
        ;msgbox buyin_procedure_running %buyin_procedure_running%
        
        WinGetPos, WindowXpos, WindowYpos , confirm_width, confirm_height, ahk_id %this_id%

        ClickX := Round(confirm_width * maxBuyInX)
        ClickY := Round(confirm_height * maxBuyInY)
            ;Tooltip, title: %title%`nX: %X%`nY: %Y%
            ;SetTimer, RemoveToolTip, 5000
            
        absoluteX:=WindowXpos+ClickX
        absoluteY:=WindowYpos+ClickY

        MouseClick,, absoluteX, absoluteY,, 0
        ;MouseMove, absoluteX,absoluteY, 0
        ;sleep 1000
        
        ClickX := Round(confirm_width * confirmBuyInX)
        ClickY := Round(confirm_height * confirmBuyInY)
                
        absoluteX:=WindowXpos+ClickX
        absoluteY:=WindowYpos+ClickY
         ;MouseMove, absoluteX,absoluteY, 0
        MouseClick,, absoluteX, absoluteY,, 0
        ;MouseMove, px, py, 0
        
        ;msgbox buyin_procedure_running %buyin_procedure_running%
        
        MouseMove, px, py, 0

        sleep 100
        
        buyin_procedure_running=0


    }



    if (window_title=autoConfirmLeaveTableWindowTitle and autoConfirmLeave=1)
    {
        
        CoordMode, Mouse, Screen
        MouseGetPos, px, py
        
        WinGetPos, WindowXpos, WindowYpos , confirm_width, confirm_height, ahk_id %this_id%
        
        if ((confirm_width=289 and confirm_height=125 )or(skip_sizecheck=1))
        {
            ;msgbox sddsd
    
            ClickX := Round(confirm_width * confirmLeaveX)
            ClickY := Round(confirm_height * confirmLeaveY)
    
            absoluteX:=WindowXpos+ClickX
            absoluteY:=WindowYpos+ClickY
    
            ;MsgBox  %absoluteX% %absoluteY% %Xpos%` %Ypos%

            MouseClick,, absoluteX, absoluteY,, 0
    
            MouseMove, px, py, 0
        }
    
    }

    if (window_title=autoConfirmLargeAllInWindowTitle and autoConfirmAllIn=1)
    {
        
        CoordMode, Mouse, Screen
        MouseGetPos, px, py
        
        WinGetPos, WindowXpos, WindowYpos , confirm_width, confirm_height, ahk_id %this_id%
        
        if ((confirm_width=277 and confirm_height=125 )or(skip_sizecheck=1))
        {
            ;msgbox sddsd
    
            ClickX := Round(confirm_width * confirmAllInX)
            ClickY := Round(confirm_height * confirmAllInY)
    
            absoluteX:=WindowXpos+ClickX
            absoluteY:=WindowYpos+ClickY
    
            ;MsgBox  %absoluteX% %absoluteY% %Xpos%` %Ypos%

            MouseClick,, absoluteX, absoluteY,, 0
    
            MouseMove, px, py, 0
        }
    
    }

}

return



autoFocusF:

MouseGetPos, , , ID2, control
WinGetClass, winClass11, ahk_id %ID2%


;msgbox %winClass11%
if (winClass11 = "l1l1.kf")
{

   SetMouseDelay, -1
   MouseGetPos,,,hovwin,hovcontrol
   WinGetClass, hovclass, ahk_id %hovwin%
   IfWinNotActive, ahk_id %hovwin%
      if hovclass <> #32769
      {
         WinActivate ahk_id %hovwin%
         ControlFocus %hovcontrol%, ahk_id %hovwin%
         return
}	
}

return




getTableID()
{
    global actOnActiveTable
  
    ID := ""
    if (actOnActiveTable = 1) {
        WinGet, ID,, A 
    } else {
        MouseGetPos,,,ID
    }
    
    WinGetClass, winClass, ahk_id %ID%
    if (winClass <> "l1l1.kf")
        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.jA
    ;{
     ;   Send {%key%}
      ;  return
    ;}

    Critical, On
    betSize := readBetBox(ID)
    
        ;MsgBox, betSize: %betSize% 
    
   
    if (amount = "bb") or (amount = "sb")
        raiseSize := getBlind(ID, amount)
    ;Msgbox, raiseSize: %raiseSize%
        
    if (direction = "up")
        newBetSize := betSize + raiseSize
    else
        newBetSize := betSize - raiseSize
    ;MsgBox %newBetSize%   
    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.jA
     ;   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.jA
     ;   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
    ;msgbox %key%
    ;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.jA
    ;{
        ;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, autoAutoFocus,  EntHelper.ini, Options,  autoAutoFocus, 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 := False
    allwaysCheckForFree := True
    autoBuyInMax := True
    autoConfirmRebuy := True
    autoConfirmAllIn := False
    autoConfirmLeave := False
    autoConfirmWaitingList := True
    autoAutoFocus:= 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 autoAutoFocus
        IniWrite, %autoAutoFocus%,  EntHelper.ini, Options,  autoAutoFocus        
        
    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
}

;#IfWinActive , FunMoney 319 (Texas Hold'em No Limit 2/4)  [Connection: Excellent]


#IfWinActive ,Texas Hold'em No Limit 


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
New Donationware Software: Entraction helper script Quote
03-07-2011 , 06:54 AM
fixed bugs
Feedback would be nice ))

Code:
; Version 0.3R6

; percentage of the window width and height for center of buttons

checkForFreeWindowTitle := "Confirm fold"
autoCloseRebuyWindowTitle := "Auto Rebuy turned on"
autoConfirmWaitingListWindowTitle := "Waiting List"
autoConfirmLeaveTableWindowTitle:="Confirm leave"
autoConfirmLargeAllInWindowTitle := "Confirm Large All-In Raise"
skip_sizecheck:=1



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.55

confirmBuyInX := 0.7
confirmBuyInY := 0.89

rebuyOkX := 0.49
rebuyOkY := 0.74

confirmAllInX := 0.41
confirmAllInY := 0.73

confirmLeaveX := 0.45
confirmLeaveY := 0.73

waitlistx:=337
waitlisty:=510

confirmWaiting1X := 0.5
confirmWaiting1Y := 0.86

confirmWaiting2X := 0.41
confirmWaiting2Y := 0.86

buyin_procedure_running := 0
rebuy_procedure_running := 0

; End general settings

#SingleInstance, Force
#NoEnv
#MaxHotkeysPerInterval 200
SendMode Input
SetTitleMatchMode 2
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 (autoAutoFocus = 1 or)
    GoSub activateAutoFocus

GoSub activateCheckMessage




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, CheckBox, x5 y170 w200 h20 Checked%autoAutoFocus% vautoAutoFocus, Auto Focus tables under mouse 
   
    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



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

activateCheckMessage:
    SetTimer, CheckMessage, 100
return

RemoveToolTip:
    SetTimer, RemoveToolTip, Off
    ToolTip
return

activateAutoFocus:
    SetTimer, autoFocusF, 100
    
return


CheckMessage:

    
WinGet, id, list ,ahk_class SunAwtDialog,, Program Manager


Loop, %id%
{
    
   
    this_id := id%A_Index%
    
    WinGetTitle, window_title, ahk_id %this_id%
    
    ;msgbox %window_title%
    if (window_title=autoCloseRebuyWindowTitle and autoConfirmRebuy=1 and rebuy_procedure_running=0)
    {
        rebuy_procedure_running=1
        
        CoordMode, Mouse, Screen
                
        MouseGetPos, px, py      

        WinGetPos, WindowXpos, WindowYpos , confirm_width, confirm_height, ahk_id %this_id%
        WinGetClass, this_class, ahk_id %this_id%
        ;msgbox %this_class%
        ;MsgBox, Notepad is at %WindowXpos%`,%WindowYpos% size %confirm_width%, %confirm_height%
        if ((confirm_width=394 and confirm_height=125)or(skip_sizecheck=1))
        {
        
        ;msgbox here    
        ClickX := Round(confirm_width * rebuyOkX)
        ClickY := Round(confirm_height * rebuyOkY)
   
    
        absoluteX:=WindowXpos+ClickX
        absoluteY:=WindowYpos+ClickY
    
        ;MsgBox  %absoluteX% %absoluteY% %Xpos%` %Ypos%

        MouseClick,, absoluteX, absoluteY,, 0
    
        ;MouseMove, absoluteX,absoluteY, 0
        MouseMove, px, py, 0
        sleep 150
        rebuy_procedure_running=0
        
        
        }

        
    }
    
    if (window_title=checkForFreeWindowTitle and allwaysCheckForFree=1)
    {
        
        CoordMode, Mouse, Screen
        
        MouseGetPos, px, py      

        WinGetPos, WindowXpos, WindowYpos , confirm_width, confirm_height, ahk_id %this_id%
        WinGetClass, this_class, ahk_id %this_id%
        ;msgbox %this_class%
        ;MsgBox, Notepad is at %WindowXpos%`,%WindowYpos% size %confirm_width%, %confirm_height%
        
        if ((confirm_width=387 and confirm_height=125)or(skip_sizecheck=1))
        {
        
        ;msgbox here    
        ClickX := Round(confirm_width * checkForFreeX)
        ClickY := Round(confirm_height * checkForFreeY)

        absoluteX:=WindowXpos+ClickX
        absoluteY:=WindowYpos+ClickY
    
        ;MsgBox  %absoluteX% %absoluteY% %Xpos%` %Ypos%

        MouseClick,, absoluteX, absoluteY,, 0
    
        ;MouseMove, absoluteX,absoluteY, 0
        MouseMove, px, py, 0
        
        sleep 150
        
        }

    }

        
        if (window_title=autoConfirmWaitingListWindowTitle and autoConfirmWaitingList=1)
    {

        
        ; press "Ok" button
        CoordMode, Mouse, Screen
        MouseGetPos, px, py
        
        WinGetPos, WindowXpos, WindowYpos , confirm_width, confirm_height, ahk_id %this_id%
        
        if ((confirm_width=400 and confirm_height=265)or(skip_sizecheck=1))
        {
       
        ClickX := Round(confirm_width * confirmWaiting1X)
        ClickY := Round(confirm_height * confirmWaiting1Y)
        ;Tooltip, title: %title%`nX: %X%`nY: %Y%`nautoConfirmWaitingListWindowTitle: %autoConfirmWaitingListWindowTitle%
        ;SetTimer, RemoveToolTip, 5000
        
        absoluteX:=WindowXpos+ClickX
        absoluteY:=WindowYpos+ClickY
        
        MouseClick,, absoluteX, absoluteY,, 0
        
        ClickX := Round(confirm_width * confirmWaiting2X)
        ClickY := Round(confirm_height * confirmWaiting2Y)
       
        absoluteX:=WindowXpos+ClickX
        absoluteY:=WindowYpos+ClickY

        ;Tooltip, title: %title%`nX: %X%`nY: %Y%`nautoConfirmWaitingListWindowTitle: %autoConfirmWaitingListWindowTitle%
        ;SetTimer, RemoveToolTip, 5000
        MouseClick,, absoluteX, absoluteY,, 0
        
        CoordMode, Mouse, Screen
        MouseMove, px, py, 0
        
        sleep 100
        
        }

    }

        if (window_title="" and autoBuyInMax=1 and buyin_procedure_running=0)
    {
        sleep 600
        
        ;msgbox buyin_procedure_running %buyin_procedure_running%

        buyin_procedure_running=1
        CoordMode, Mouse, Screen
        MouseGetPos, px, py
        ;msgbox buyin_procedure_running %buyin_procedure_running%
        
        WinGetPos, WindowXpos, WindowYpos , confirm_width, confirm_height, ahk_id %this_id%

        ClickX := Round(confirm_width * maxBuyInX)
        ClickY := Round(confirm_height * maxBuyInY)
            ;Tooltip, title: %title%`nX: %X%`nY: %Y%
            ;SetTimer, RemoveToolTip, 5000
            
        absoluteX:=WindowXpos+ClickX
        absoluteY:=WindowYpos+ClickY

        MouseClick,, absoluteX, absoluteY,, 0
        ;MouseMove, absoluteX,absoluteY, 0
        ;sleep 1000
        
        ClickX := Round(confirm_width * confirmBuyInX)
        ClickY := Round(confirm_height * confirmBuyInY)
                
        absoluteX:=WindowXpos+ClickX
        absoluteY:=WindowYpos+ClickY
         ;MouseMove, absoluteX,absoluteY, 0
        MouseClick,, absoluteX, absoluteY,, 0
        ;MouseMove, px, py, 0
        
        ;msgbox buyin_procedure_running %buyin_procedure_running%
        
        MouseMove, px, py, 0

        sleep 100
        
        buyin_procedure_running=0


    }



    if (window_title=autoConfirmLeaveTableWindowTitle and autoConfirmLeave=1)
    {
        
        CoordMode, Mouse, Screen
        MouseGetPos, px, py
        
        WinGetPos, WindowXpos, WindowYpos , confirm_width, confirm_height, ahk_id %this_id%
        
        if ((confirm_width=289 and confirm_height=125 )or(skip_sizecheck=1))
        {
            ;msgbox sddsd
    
            ClickX := Round(confirm_width * confirmLeaveX)
            ClickY := Round(confirm_height * confirmLeaveY)
    
            absoluteX:=WindowXpos+ClickX
            absoluteY:=WindowYpos+ClickY
    
            ;MsgBox  %absoluteX% %absoluteY% %Xpos%` %Ypos%

            MouseClick,, absoluteX, absoluteY,, 0
    
            MouseMove, px, py, 0
        }
    
    }

    if (window_title=autoConfirmLargeAllInWindowTitle and autoConfirmAllIn=1)
    {
        
        CoordMode, Mouse, Screen
        MouseGetPos, px, py
        
        WinGetPos, WindowXpos, WindowYpos , confirm_width, confirm_height, ahk_id %this_id%
        
        if ((confirm_width=277 and confirm_height=125 )or(skip_sizecheck=1))
        {
            ;msgbox sddsd
    
            ClickX := Round(confirm_width * confirmAllInX)
            ClickY := Round(confirm_height * confirmAllInY)
    
            absoluteX:=WindowXpos+ClickX
            absoluteY:=WindowYpos+ClickY
    
            ;MsgBox  %absoluteX% %absoluteY% %Xpos%` %Ypos%

            MouseClick,, absoluteX, absoluteY,, 0
    
            MouseMove, px, py, 0
        }
    
    }

}

return



autoFocusF:

MouseGetPos, , , ID2, control
WinGetClass, winClass11, ahk_id %ID2%


;msgbox %winClass11%
if (winClass11 = "l1l1.kf")
{

   SetMouseDelay, -1
   MouseGetPos,,,hovwin,hovcontrol
   WinGetClass, hovclass, ahk_id %hovwin%
   IfWinNotActive, ahk_id %hovwin%
      if hovclass <> #32769
      {
         WinActivate ahk_id %hovwin%
         ControlFocus %hovcontrol%, ahk_id %hovwin%
         return
}	
}

return




getTableID()
{
    global actOnActiveTable
  
    ID := ""
    if (actOnActiveTable = 1) {
        WinGet, ID,, A 
    } else {
        MouseGetPos,,,ID
    }
    
    WinGetClass, winClass, ahk_id %ID%
    if (winClass <> "l1l1.kf")
        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.jA
    ;{
     ;   Send {%key%}
      ;  return
    ;}

    Critical, On
    betSize := readBetBox(ID)
    
        ;MsgBox, betSize: %betSize% 
    
   
    if (amount = "bb") or (amount = "sb")
        raiseSize := getBlind(ID, amount)
    ;Msgbox, raiseSize: %raiseSize%
        
    if (direction = "up")
        newBetSize := betSize + raiseSize
    else
        newBetSize := betSize - raiseSize
    ;MsgBox %newBetSize%   
    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.jA
     ;   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.jA
     ;   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
    ;msgbox %key%
    ;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.jA
    ;{
        ;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, autoAutoFocus,  EntHelper.ini, Options,  autoAutoFocus, 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 := False
    allwaysCheckForFree := True
    autoBuyInMax := True
    autoConfirmRebuy := True
    autoConfirmAllIn := False
    autoConfirmLeave := False
    autoConfirmWaitingList := True
    autoAutoFocus:= 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 autoAutoFocus
        IniWrite, %autoAutoFocus%,  EntHelper.ini, Options,  autoAutoFocus        
        
    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
}

;#IfWinActive , FunMoney 319 (Texas Hold'em No Limit 2/4)  [Connection: Excellent]


#IfWinActive ,Texas Hold'em No Limit 


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
New Donationware Software: Entraction helper script Quote
03-14-2011 , 09:32 PM
hello soll, can u tell wat changes u did? auto rebuy to max is not working. if u can fix that would be nice.
tks for helping
New Donationware Software: Entraction helper script Quote
03-15-2011 , 05:17 PM
hello everyone, i use this program already a few months, i formated my computer and the program dont work anymore, im using now windows 7 64-bits.
someone can help me?
New Donationware Software: Entraction helper script Quote
03-15-2011 , 11:46 PM
Don't know what your problem could be Guga, auto rebuy works for me as do most things, using win 7 64 bits too. Have you installed AHK after reformatting?

Solid script. Will donate when I'm more robusto
New Donationware Software: Entraction helper script Quote
03-15-2011 , 11:55 PM
yes complex, already instaled ahk, i instaled the ahk from the secund page, what post did u copy the script?
New Donationware Software: Entraction helper script Quote
03-16-2011 , 03:19 PM
i made a few tests here, the script not work when i open the new version of HM, without the HM working fine
New Donationware Software: Entraction helper script Quote
03-16-2011 , 05:36 PM
I'd really like a sit out all tables button, and I'm back on all tables button. Or to make it an option to apply for all open tables

Quote:
Originally Posted by Guga Maia
yes complex, already instaled ahk, i instaled the ahk from the secund page, what post did u copy the script?
Post #139
New Donationware Software: Entraction helper script Quote
03-17-2011 , 10:58 PM
cant put it for work with HM dont metter what.
New Donationware Software: Entraction helper script Quote
03-19-2011 , 08:42 PM
richard where do you prefer i send a donation to for this wonderful piece of work?
New Donationware Software: Entraction helper script Quote
03-20-2011 , 05:56 PM
Anyone using this script having problems with the wrong table being acted sometimes? I had to turn off the "Auto Focus tables under mouse" feature because I got tired of folding KK preflop when the mouse was under another table.

I think it's not acting fast enough sometimes, or maybe at all? Sometimes it works instantaneously others not at all...

Quote:
Originally Posted by Solll
fixed bugs
Feedback would be nice ))

Code:
; Version 0.3R6

; percentage of the window width and height for center of buttons

checkForFreeWindowTitle := "Confirm fold"
autoCloseRebuyWindowTitle := "Auto Rebuy turned on"
autoConfirmWaitingListWindowTitle := "Waiting List"
autoConfirmLeaveTableWindowTitle:="Confirm leave"
autoConfirmLargeAllInWindowTitle := "Confirm Large All-In Raise"
skip_sizecheck:=1



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.55

confirmBuyInX := 0.7
confirmBuyInY := 0.89

rebuyOkX := 0.49
rebuyOkY := 0.74

confirmAllInX := 0.41
confirmAllInY := 0.73

confirmLeaveX := 0.45
confirmLeaveY := 0.73

waitlistx:=337
waitlisty:=510

confirmWaiting1X := 0.5
confirmWaiting1Y := 0.86

confirmWaiting2X := 0.41
confirmWaiting2Y := 0.86

buyin_procedure_running := 0
rebuy_procedure_running := 0

; End general settings

#SingleInstance, Force
#NoEnv
#MaxHotkeysPerInterval 200
SendMode Input
SetTitleMatchMode 2
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 (autoAutoFocus = 1 or)
    GoSub activateAutoFocus

GoSub activateCheckMessage




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, CheckBox, x5 y170 w200 h20 Checked%autoAutoFocus% vautoAutoFocus, Auto Focus tables under mouse 
   
    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



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

activateCheckMessage:
    SetTimer, CheckMessage, 100
return

RemoveToolTip:
    SetTimer, RemoveToolTip, Off
    ToolTip
return

activateAutoFocus:
    SetTimer, autoFocusF, 100
    
return


CheckMessage:

    
WinGet, id, list ,ahk_class SunAwtDialog,, Program Manager


Loop, %id%
{
    
   
    this_id := id%A_Index%
    
    WinGetTitle, window_title, ahk_id %this_id%
    
    ;msgbox %window_title%
    if (window_title=autoCloseRebuyWindowTitle and autoConfirmRebuy=1 and rebuy_procedure_running=0)
    {
        rebuy_procedure_running=1
        
        CoordMode, Mouse, Screen
                
        MouseGetPos, px, py      

        WinGetPos, WindowXpos, WindowYpos , confirm_width, confirm_height, ahk_id %this_id%
        WinGetClass, this_class, ahk_id %this_id%
        ;msgbox %this_class%
        ;MsgBox, Notepad is at %WindowXpos%`,%WindowYpos% size %confirm_width%, %confirm_height%
        if ((confirm_width=394 and confirm_height=125)or(skip_sizecheck=1))
        {
        
        ;msgbox here    
        ClickX := Round(confirm_width * rebuyOkX)
        ClickY := Round(confirm_height * rebuyOkY)
   
    
        absoluteX:=WindowXpos+ClickX
        absoluteY:=WindowYpos+ClickY
    
        ;MsgBox  %absoluteX% %absoluteY% %Xpos%` %Ypos%

        MouseClick,, absoluteX, absoluteY,, 0
    
        ;MouseMove, absoluteX,absoluteY, 0
        MouseMove, px, py, 0
        sleep 150
        rebuy_procedure_running=0
        
        
        }

        
    }
    
    if (window_title=checkForFreeWindowTitle and allwaysCheckForFree=1)
    {
        
        CoordMode, Mouse, Screen
        
        MouseGetPos, px, py      

        WinGetPos, WindowXpos, WindowYpos , confirm_width, confirm_height, ahk_id %this_id%
        WinGetClass, this_class, ahk_id %this_id%
        ;msgbox %this_class%
        ;MsgBox, Notepad is at %WindowXpos%`,%WindowYpos% size %confirm_width%, %confirm_height%
        
        if ((confirm_width=387 and confirm_height=125)or(skip_sizecheck=1))
        {
        
        ;msgbox here    
        ClickX := Round(confirm_width * checkForFreeX)
        ClickY := Round(confirm_height * checkForFreeY)

        absoluteX:=WindowXpos+ClickX
        absoluteY:=WindowYpos+ClickY
    
        ;MsgBox  %absoluteX% %absoluteY% %Xpos%` %Ypos%

        MouseClick,, absoluteX, absoluteY,, 0
    
        ;MouseMove, absoluteX,absoluteY, 0
        MouseMove, px, py, 0
        
        sleep 150
        
        }

    }

        
        if (window_title=autoConfirmWaitingListWindowTitle and autoConfirmWaitingList=1)
    {

        
        ; press "Ok" button
        CoordMode, Mouse, Screen
        MouseGetPos, px, py
        
        WinGetPos, WindowXpos, WindowYpos , confirm_width, confirm_height, ahk_id %this_id%
        
        if ((confirm_width=400 and confirm_height=265)or(skip_sizecheck=1))
        {
       
        ClickX := Round(confirm_width * confirmWaiting1X)
        ClickY := Round(confirm_height * confirmWaiting1Y)
        ;Tooltip, title: %title%`nX: %X%`nY: %Y%`nautoConfirmWaitingListWindowTitle: %autoConfirmWaitingListWindowTitle%
        ;SetTimer, RemoveToolTip, 5000
        
        absoluteX:=WindowXpos+ClickX
        absoluteY:=WindowYpos+ClickY
        
        MouseClick,, absoluteX, absoluteY,, 0
        
        ClickX := Round(confirm_width * confirmWaiting2X)
        ClickY := Round(confirm_height * confirmWaiting2Y)
       
        absoluteX:=WindowXpos+ClickX
        absoluteY:=WindowYpos+ClickY

        ;Tooltip, title: %title%`nX: %X%`nY: %Y%`nautoConfirmWaitingListWindowTitle: %autoConfirmWaitingListWindowTitle%
        ;SetTimer, RemoveToolTip, 5000
        MouseClick,, absoluteX, absoluteY,, 0
        
        CoordMode, Mouse, Screen
        MouseMove, px, py, 0
        
        sleep 100
        
        }

    }

        if (window_title="" and autoBuyInMax=1 and buyin_procedure_running=0)
    {
        sleep 600
        
        ;msgbox buyin_procedure_running %buyin_procedure_running%

        buyin_procedure_running=1
        CoordMode, Mouse, Screen
        MouseGetPos, px, py
        ;msgbox buyin_procedure_running %buyin_procedure_running%
        
        WinGetPos, WindowXpos, WindowYpos , confirm_width, confirm_height, ahk_id %this_id%

        ClickX := Round(confirm_width * maxBuyInX)
        ClickY := Round(confirm_height * maxBuyInY)
            ;Tooltip, title: %title%`nX: %X%`nY: %Y%
            ;SetTimer, RemoveToolTip, 5000
            
        absoluteX:=WindowXpos+ClickX
        absoluteY:=WindowYpos+ClickY

        MouseClick,, absoluteX, absoluteY,, 0
        ;MouseMove, absoluteX,absoluteY, 0
        ;sleep 1000
        
        ClickX := Round(confirm_width * confirmBuyInX)
        ClickY := Round(confirm_height * confirmBuyInY)
                
        absoluteX:=WindowXpos+ClickX
        absoluteY:=WindowYpos+ClickY
         ;MouseMove, absoluteX,absoluteY, 0
        MouseClick,, absoluteX, absoluteY,, 0
        ;MouseMove, px, py, 0
        
        ;msgbox buyin_procedure_running %buyin_procedure_running%
        
        MouseMove, px, py, 0

        sleep 100
        
        buyin_procedure_running=0


    }



    if (window_title=autoConfirmLeaveTableWindowTitle and autoConfirmLeave=1)
    {
        
        CoordMode, Mouse, Screen
        MouseGetPos, px, py
        
        WinGetPos, WindowXpos, WindowYpos , confirm_width, confirm_height, ahk_id %this_id%
        
        if ((confirm_width=289 and confirm_height=125 )or(skip_sizecheck=1))
        {
            ;msgbox sddsd
    
            ClickX := Round(confirm_width * confirmLeaveX)
            ClickY := Round(confirm_height * confirmLeaveY)
    
            absoluteX:=WindowXpos+ClickX
            absoluteY:=WindowYpos+ClickY
    
            ;MsgBox  %absoluteX% %absoluteY% %Xpos%` %Ypos%

            MouseClick,, absoluteX, absoluteY,, 0
    
            MouseMove, px, py, 0
        }
    
    }

    if (window_title=autoConfirmLargeAllInWindowTitle and autoConfirmAllIn=1)
    {
        
        CoordMode, Mouse, Screen
        MouseGetPos, px, py
        
        WinGetPos, WindowXpos, WindowYpos , confirm_width, confirm_height, ahk_id %this_id%
        
        if ((confirm_width=277 and confirm_height=125 )or(skip_sizecheck=1))
        {
            ;msgbox sddsd
    
            ClickX := Round(confirm_width * confirmAllInX)
            ClickY := Round(confirm_height * confirmAllInY)
    
            absoluteX:=WindowXpos+ClickX
            absoluteY:=WindowYpos+ClickY
    
            ;MsgBox  %absoluteX% %absoluteY% %Xpos%` %Ypos%

            MouseClick,, absoluteX, absoluteY,, 0
    
            MouseMove, px, py, 0
        }
    
    }

}

return



autoFocusF:

MouseGetPos, , , ID2, control
WinGetClass, winClass11, ahk_id %ID2%


;msgbox %winClass11%
if (winClass11 = "l1l1.kf")
{

   SetMouseDelay, -1
   MouseGetPos,,,hovwin,hovcontrol
   WinGetClass, hovclass, ahk_id %hovwin%
   IfWinNotActive, ahk_id %hovwin%
      if hovclass <> #32769
      {
         WinActivate ahk_id %hovwin%
         ControlFocus %hovcontrol%, ahk_id %hovwin%
         return
}    
}

return




getTableID()
{
    global actOnActiveTable
  
    ID := ""
    if (actOnActiveTable = 1) {
        WinGet, ID,, A 
    } else {
        MouseGetPos,,,ID
    }
    
    WinGetClass, winClass, ahk_id %ID%
    if (winClass <> "l1l1.kf")
        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.jA
    ;{
     ;   Send {%key%}
      ;  return
    ;}

    Critical, On
    betSize := readBetBox(ID)
    
        ;MsgBox, betSize: %betSize% 
    
   
    if (amount = "bb") or (amount = "sb")
        raiseSize := getBlind(ID, amount)
    ;Msgbox, raiseSize: %raiseSize%
        
    if (direction = "up")
        newBetSize := betSize + raiseSize
    else
        newBetSize := betSize - raiseSize
    ;MsgBox %newBetSize%   
    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.jA
     ;   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.jA
     ;   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
    ;msgbox %key%
    ;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.jA
    ;{
        ;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, autoAutoFocus,  EntHelper.ini, Options,  autoAutoFocus, 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 := False
    allwaysCheckForFree := True
    autoBuyInMax := True
    autoConfirmRebuy := True
    autoConfirmAllIn := False
    autoConfirmLeave := False
    autoConfirmWaitingList := True
    autoAutoFocus:= 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 autoAutoFocus
        IniWrite, %autoAutoFocus%,  EntHelper.ini, Options,  autoAutoFocus        
        
    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
}

;#IfWinActive , FunMoney 319 (Texas Hold'em No Limit 2/4)  [Connection: Excellent]


#IfWinActive ,Texas Hold'em No Limit 


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
New Donationware Software: Entraction helper script Quote
03-20-2011 , 07:12 PM
hello,
someone have the last version of HM running and the enthelper?
when i open HM and put for import, the script stop works
New Donationware Software: Entraction helper script Quote
03-29-2011 , 10:07 AM
I think there's been another update and things aren't working again, such as auto focus
New Donationware Software: Entraction helper script Quote

      
m