Please test, at my ACR tables the script works. Normally Winamax shouldn't work now.
Code:
;***************************************************************************************
; BET POT - GG WPN Combo
; By Annuit20
; Aug 2023
;v1.4
; Thanks to Sheetah, Dave, Juk, probably some other 2+2 coders and Autohotkey forums folks
;***************************************************************************************
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
CoordMode, Pixel, Relative
; ******************************* PARAMETERS *****************************************
; If you want something to edit/fine tune this is where you should look.
; All coordintaes are 'percentage' coords based on client (not ahk native window)
MouseOverPop := True ; if true => table will be put to front if mouse over
xRBGG := 0.80
yRBGG := 0.92
xTBGG := 0.817
yTBGG := 0.931
xRBWPN := 0.54
yRBWPN := 0.94
xTBWPN := 0.703
yTBWPN := 0.961
xMBWPN := 0.90
yMBWPN := 0.94
xXBWPN := 0.72
yXBWPN := 0.94
;***************************************************************************************
;******************************* GLOBAL VARIABLES **********************************
w_client := 0
h_client := 0
if(MouseOverPop == true)
SetTimer, WatchCursor, 300
; ******************************* HOTKEYS **************************************
$RButton::
MouseGetPos,,,hwnd
if(ValidateTableGG(hwnd) != true) And (ValidateTableWPN(hwnd) != true)
Send, {RButton}
else
if(ValidateTableActionGG(hwnd) == true)
ClientClickGG(hwnd,xRBGG,yRBGG)
else if (ValidateTableGG(hwnd) == true)
Send, {F1}
else if (ValidateTableActionWPN(hwnd) == true)
ClientClickWPN(hwnd,xTBWPN,yTBWPN)
;msgbox, True
else if (ValidateTableWPN(hwnd) == true)
ClientClickWPN(hwnd,xRBWPN,yRBWPN)
;msgbox, false
return
~MButton::
MouseGetPos,,,hwnd
if(ValidateTableGG(hwnd) == true)
Send, {F3}
Else if (ValidateTableWPN(hwnd) == true)
Send, {F3}
return
~XButton1::
MouseGetPos,,,hwnd
if(ValidateTableGG(hwnd) == true)
Send, {F2}
Else if (ValidateTableWPN(hwnd) == true)
Send, {F2}
return
~XButton2::
MouseGetPos,,,hwnd
if(ValidateTableGG(hwnd) == true)
Send, {F4}
Else if(ValidateTableWPN(hwnd) == true)
Send, {F4}
sleep,300
Send, {F3}
return
; ****************************** FUNCTIONS ***************************************
ClientClickGG(hwnd,x,y){
global w_client,h_client
xc := Round(x*w_client)
yc := Round(y*h_client)
PostLeftClick(xc,yc,hwnd)
}
ClientClickWPN(hwnd,x,y){
global w_client,h_client
xc := Round(x*w_client)
yc := Round(y*h_client)
PostLeftClick(xc,yc,hwnd)
}
ValidateTableGG(hwnd){
WinGetClass,wclass,ahk_id%hwnd%
WinGetTitle,wtitle,ahk_id%hwnd%
if(wclass = "ApolloRuntimeContentWindow")
return true
else
return false
}
ValidateTableActionGG(hwnd){
global w_client,h_client,xTBGG,yTBGG
GetClientSize(hwnd,w_client,h_client)
ClientToWin(hwnd,xpi,ypi)
xpi := (xTBGG*w_client)
ypi := (yTBGG*h_client)
PixelGetColor,color,xpi,ypi
RGB(color,r,g,b)
If(b > 150 and g > 150)
return true
else
return false
}
ValidateTableWPN(hwnd){
WinGetClass, wclass, ahk_id %hwnd%
WinGetTitle, wtitle, ahk_id %hwnd%
WinGet, ahx_exe, ProcessName, ahk_id %hwnd%
if (wclass = "Chrome_WidgetWin_1" && ahx_exe = "ACRPoker.exe")
return true
else
return false
}
ValidateTableActionWPN(hwnd){
global w_client,h_client,xTBWPN,yTBWPN
GetClientSize(hwnd,w_client,h_client)
ClientToWin(hwnd,xpiwpn,ypiqpn)
xpiwpn := (xTBWPN*w_client)
ypiwpn := (yTBWPN*h_client)
;MouseMove, xpiwpn, ypiwpn
PixelGetColor,color,xpiwpn,ypiwpn
RGB(color,r,g,b)
If(b > 150 and g > 150)
return true
else
return false
}
RGB(colour, byRef r, byRef g, byRef b)
{
r := colour >> 16
g := (colour >> 8) & 0xFF
b := colour & 0xFF
return
}
WatchCursor:
OnMM()
return
OnMM()
{
MouseGetPos,,,hwnd
if(ValidateTableGG(hwnd) == true) or (ValidateTableWPN(hwnd) == true)
WinActivate,ahk_id%hwnd%
}
; *********************** RANDOM USEFUL FUNCTIONS **************
PostLeftClick(x, y, table_id, activate=1) {
; ### JUK: Send the down left click, then the mouse-up messages.
; NOTE: This is relative to the top left of the client area and NOT the top left of the
; window (ie: It *doesn't* include the title-bar like AHK's MouseClick does!!!).
If activate
WinActivate, ahk_id%table_id%
PostMessage, 0x201, 0x0001, ((y<<16)^x), , ahk_id%table_id%
PostMessage, 0x202 , 0, ((y<<16)^x), , ahk_id%table_id%
}
GetClientSize(hwnd, ByRef w, ByRef h)
{
VarSetCapacity(rc, 16)
DllCall("GetClientRect", "uint", hwnd, "uint", &rc)
w := NumGet(rc, 8, "int")
h := NumGet(rc, 12, "int")
}
WinToClient(hwnd, ByRef x, ByRef y)
{
WinGetPos, wx, wy,,, ahk_id %hwnd%
VarSetCapacity(pt, 8)
NumPut(x + wx, pt, 0)
NumPut(y + wy, pt, 4)
DllCall("ScreenToClient", "uint", hwnd, "uint", &pt)
x := NumGet(pt, 0, "int")
y := NumGet(pt, 4, "int")
}
ClientToWin(hwnd, ByRef x, ByRef y)
{
VarSetCapacity(pt, 8)
NumPut(x, pt, 0)
NumPut(y, pt, 4)
DllCall("ClientToScreen", "uint", hwnd, "uint", &pt)
WinGetPos, wx, wy,,, ahk_id %hwnd%
x := NumGet(pt, 0, "int") - wx
y := NumGet(pt, 4, "int") - wy
}
GetClientRect(hwnd,ByRef X2, ByRef Y2)
{
VarSetCapacity(rc,16)
DllCall("GetClientRect", "Uint", hwnd, "Uint", &rc)
X2:=NumGet(rc,8,"Int")
Y2:=NumGet(rc,12,"Int")
}