Code:
#SingleInstance, Force
#NoEnv
OnExit exitSub
StringTrimRight, thisahk, A_ScriptName, 4
SetWorkingDir %A_ScriptDir%
Menu, Tray, NoStandard
Menu, Tray, Add, Settings, menugui
Menu, Tray, Add
Menu, Tray, Add, Reload, reload
Menu, Tray, Default, Settings
Menu, Tray, Add
Menu, Tray, Add, Suspend, Suspend
Menu, Tray, Add, Pause, TogglePause
Menu, Tray, Add
Menu, Tray, Add, Donate, Donation
Menu, Tray, Add, Exit, ExitSub
OnMessage(0x112,"WM_SYSCOMMAND")
WM_SYSCOMMAND(wParam)
{
if (A_Gui && wParam = 0xF020) ; SC_MINIMIZE
{
Gui, Destroy
return 0
}
}
SetBatchLines,-1
SetWinDelay,-1
SendMode Input
GroupAdd, TABLES, ahk_class DxWndClass
SetTimer, ClosePopUps, 500
GoSub,GetIni
if Top = 1
{
foldxa := 440
foldya := 570
potxa := 760
potya := 505
halfpotxa := 700
halfpotya := 505
autopostxa := 568
autopostya := 38
sitoutxa := 568
sitoutya := 53
}
if Classic = 1
{
foldxa := 290
foldya := 490
potxa := 650
potya := 480
autopostxa := 568
autopostya := 38
sitoutxa := 568
sitoutya := 53
}
return
;==========================================;
ClosePopUps:
IfWinExist, UB ahk_class #32770,, UB Browser
ControlClick, Button1
IfWinExist, Absolute Poker ahk_class #32770,, AP Browser
ControlClick, Button1
IfWinExist, Tournament Registration ahk_class #32770
ControlClick, Button1
IfWinExist, Alert ahk_class DXPopupWnd
ControlClick, Button1
IfWinExist, Waiting list ahk_class DXPopupWnd
ControlClick, Button1
return
;------------------------------------------;
BuildGUI:
Menu, MenuMenu, Add, About, About
Menu, MenuMenu, Add, Donate, Donation
Menu, MenuMenu, Add, Help, Help
Menu, Menubar, Add, Menu, :MenuMenu
Gui, Menu, MenuBar
Gui, Color, White
Gui, Add, Text, x15 y15, Fold/Autofold
Gui, Add, Edit, x160 y15 w70 h20 vFold, %Fold%
Gui, Add, Text, x15 y45, Check/Call
Gui, Add, Edit, x160 y45 w70 h20 vCall, %Call%
Gui, Add, Text, x15 y75, Bet/Raise
Gui, Add, Edit, x160 y75 w70 h20 vBet, %Bet%
Gui, Add, Text, x15 y105, Pot
Gui, Add, Edit, x160 y105 w70 h20 vBetPot, %BetPot%
Gui, Add, Text, x15 y135, Half Pot
Gui, Add, Edit, x160 y135 w70 h20 vBetHalfPot, %BetHalfPot%
Gui, Add, Text, x15 y165, Toggle AutoPost Blinds
Gui, Add, Edit, x160 y165 w70 h20 vAutoPostBlinds, %AutoPostBlinds%
Gui, Add, Text, x15 y195, Toggle Sit In
Gui, Add, Edit, x160 y195 w70 h20 vSitInOut, %SitInOut%
Gui, Add, Text, x15 y225, Stack Cycle
Gui, Add, Edit, x160 y225 w70 h20 vStackCycle, %StackCycle%
Gui, Add, Text, x15 y255, Register in Tournament
Gui, Add, Edit, x160 y255 w70 h20 vRegisterTournament, %RegisterTournament%
Gui, Add, Text, x15 y285, Table View
Gui, Add, Radio, x160 y305 w70 Checked%Classic% vClassic, Classic
Gui, Add, Radio, x160 y285 w70 Checked%Top% vTop, Top
Gui, Add, Text, x70 y345
Gui, Add, Button, gSave, Submit
Gui, Add, Button, x+10 gCancel, Cancel
Gui, Add, Text, x15 y390
;Gui, Show,, ub_gui
;GoSub,GetIni
Gui, Show,, %thisahk%
return
;------------------------------------------;
GetIni:
IfNotExist, %thisahk%.ini
GoSub, CreateIni
IniRead, Fold, %thisahk%.ini, Other, Fold, %A_Space%
IniRead, Call, %thisahk%.ini, Other, Call, %A_Space%
IniRead, Bet, %thisahk%.ini, Other, Bet, %A_Space%
IniRead, BetPot, %thisahk%.ini, Other, BetPot, %A_Space%
IniRead, BetHalfPot, %thisahk%.ini, Other, BetHalfPot, %A_Space%
IniRead, AutoPostBlinds, %thisahk%.ini, Other, AutoPostBlinds, %A_Space%
IniRead, SitInOut, %thisahk%.ini, Other, SitInOut, %A_Space%
IniRead, StackCycle, %thisahk%.ini, Other, StackCycle, %A_Space%
IniRead, RegisterTournament, %thisahk%.ini, Other, RegisterTournament, %A_Space%
IniRead, Classic, %thisahk%.ini, Other, Classic, %A_Space%
IniRead, Top, %thisahk%.ini, Other, Top, %A_Space%
if Fold
Hotkey, IfWinActive, ahk_group TABLES
Hotkey, %Fold%,Fold, UseErrorLevel On
if Call
Hotkey, IfWinActive, ahk_group TABLES
Hotkey, %Call%,Call, UseErrorLevel On
if Bet
Hotkey, IfWinActive, ahk_group TABLES
Hotkey, %Bet%,Bet, UseErrorLevel On
if BetPot
Hotkey, IfWinActive, ahk_group TABLES
Hotkey, %BetPot%,Betpot, UseErrorLevel On
if BetHalfPot
Hotkey, IfWinActive, ahk_group TABLES
Hotkey, %BetHalfPot%,BetHalfPot, UseErrorLevel On
if AutoPostBlinds
Hotkey, IfWinActive, ahk_group TABLES
Hotkey, %AutoPostBlinds%,AutoPostBlinds, UseErrorLevel On
if SitInOut
Hotkey, IfWinActive, ahk_group TABLES
Hotkey, %SitInOut%,SitInOut, UseErrorLevel On
if StackCycle
Hotkey, IfWinActive, ahk_group TABLES
Hotkey, %StackCycle%,StackCycle, UseErrorLevel On
if RegisterTournament
Hotkey, IfWinActive, ahk_group TABLES
Hotkey, %RegisterTournament%,RegisterTournament, UseErrorLevel On
return
;------------------------------------------;
MakeIni:
IniWrite, %Fold%, %thisahk%.ini, Other, Fold
IniWrite, %Call%, %thisahk%.ini, Other, Call
IniWrite, %Bet%, %thisahk%.ini, Other, Bet
IniWrite, %BetPot%, %thisahk%.ini, Other, BetPot
IniWrite, %BetHalfPot%, %thisahk%.ini, Other, BetHalfPot
IniWrite, %AutoPostBlinds%, %thisahk%.ini, Other, AutoPostBlinds
IniWrite, %SitInOut%, %thisahk%.ini, Other, SitInOut
IniWrite, %StackCycle%, %thisahk%.ini, Other, StackCycle
IniWrite, %RegisterTournament%, %thisahk%.ini, Other, RegisterTournament
IniWrite, %Top%, %thisahk%.ini, Other, Top
IniWrite, %Classic%, %thisahk%.ini, Other, Classic
return
;------------------------------------------;
CreateIni:
GoSub, MakeIni
GoSub, BuildGui
return
;------------------------------------------;
GuiClose:
GoSub, Cancel
return
;------------------------------------------;
MenuGui:
GoSub, GetIni
Winget,id,id, %thisahk% ahk_class AutoHotkeyGUI
if !DllCall( "IsWindowVisible", "UInt",id)
GoSub, BuildGui
Gui, Submit,NoHide
return
;------------------------------------------;
Reload:
Reload
return
;------------------------------------------;
Save:
Gui, Submit
FileDelete, %thisahk%.ini
GoSub, MakeIni
Reload
return
;------------------------------------------;
Cancel:
Gui, Destroy
Return
;------------------------------------------;
TogglePause:
Pause,Toggle
return
;------------------------------------------;
Suspend:
Suspend
return
;------------------------------------------;
Edit:
Edit
return
;------------------------------------------;
Donation:
IfWinExist , UB - Logged in as
{
WinMenuSelectItem, UB - Logged in as,, My Account, Cashier, Account Transfer...
WinWait, UB Browser ahk_class #32770, , 10
Sleep, 6000
MouseClick, left, 290, 310
Send PunchAKitten
Send {Tab}
Send Samuel
return
}
IfWinExist , Absolute Poker - Logged in as
{
WinMenuSelectItem, Absolute Poker - Logged in as,, My Account, Cashier, Account Transfer...
WinWait, Absolute Poker Browser ahk_class #32770, , 10
Sleep, 6000
MouseClick, left, 290, 310
Send PunchAKitten
Send {Tab}
Send Samuel
return
}
Else
{
MsgBox , 0, Donation, If you would like to make a donation my username is PunchAKitten first name Samuel on UB/AP or you can PM me on 2+2 for other options.
return
}
;------------------------------------------;
Help:
run http://www.autohotkey.com/docs/KeyList.html
return
;------------------------------------------;
About:
run http://forumserver.twoplustwo.com/45/software/absolute-ub-hotkeys-656662/
return
;------------------------------------------;
ExitSub:
ExitApp
return
;------------------------------------------;
RegisterTournament:
WinActivate, ahk_class QDPKGamesSystems
ControlClick, Button16, ahk_class QDPKGamesSystems
return
;------------------------------------------;
#IfWinActive ahk_class DxWndClass
;------------------------------------------;
Fold:
MouseGetPos,,,win
WinActivate, ahk_id %win%
MouseGetPos, xx, yy
WinGetPos,,, w, h, A
foldx:=w*(foldxa/800)
foldy:=h*(foldya/600)
MouseClick , left, foldx, foldy, 1, 0
Mousemove, %xx%, %yy%, 0
Sleep, 250
IfWinExist, Info
WinActivate, Info
Loop 3
{
ControlClick, Button2, Info
Sleep, 50
}
return
;------------------------------------------;
Call:
MouseGetPos,,,win
WinActivate, ahk_id %win%
Send {F2}{F4}
return
;------------------------------------------;
Bet:
MouseGetPos,,,win
WinActivate, ahk_id %win%
Send {F3}{F5}
return
;------------------------------------------;
StackCycle:
MouseGetPos,,,win
WinSet, Bottom,, ahk_id %win%
return
;------------------------------------------;
BetPot:
MouseGetPos,,,win
WinActivate, ahk_id %win%
MouseGetPos, xx, yy
WinGetPos,,, w, h, A
potx:=w*(potxa/800)
poty:=h*(potya/600)
MouseClick , left, potx, poty, 1, 0
Mousemove, %xx%, %yy%, 0
return
;------------------------------------------;
BetHalfPot:
MouseGetPos,,,win
WinActivate, ahk_id %win%
MouseGetPos, xx, yy
WinGetPos,,, w, h, A
halfpotx:=w*(halfpotxa/800)
halfpoty:=h*(halfpotya/600)
MouseClick , left, halfpotx, halfpoty, 1, 0
Mousemove, %xx%, %yy%, 0
return
;------------------------------------------;
AutoPostBlinds:
MouseGetPos,,,win
WinActivate, ahk_id %win%
MouseGetPos, xx, yy
WinGetPos,,, w, h, A
autopostx:=w*(autopostxa/800)
autoposty:=h*(autopostya/600)
MouseClick , left, autopostx, autoposty, 1, 0
Mousemove, %xx%, %yy%, 0
return
;------------------------------------------;
SitInOut:
MouseGetPos,,,win
WinActivate, ahk_id %win%
MouseGetPos, xx, yy
WinGetPos,,, w, h, A
sitoutx:=w*(sitoutxa/800)
sitouty:=h*(sitoutya/600)
MouseClick , left, sitoutx, sitouty, 1, 0
Mousemove, %xx%, %yy%, 0
return
;==========================================;
not tested on UB but should work in TOP view. autopost and sit in toggles will not work in classic view on UB