Open Side Menu Go to the Top
Register
GGPoker AHK Script  Mouse Hotkey and check/fold - CLOSED GGPoker AHK Script  Mouse Hotkey and check/fold - CLOSED

02-06-2022 , 04:32 PM
DISCONTINUED - WARNING - DO NOT USE

Quote:
Originally Posted by Annuit20
okay found something here on 2+2.
Please stop using the script!

@Mods please close this thread with an disclaimer that it is not save to use this ahk on GGPoker.

https://forumserver.twoplustwo.com/2...otkey-1815921/




I have "coded" an ahk script for GGPoker the last days.
With this it is possible to use mouse buttons to access the hotkeys in GGPoker. But especially it is possible to use a hotkey for check/fold which does not use auto fold on check.
Also it is possible to use the right mouse button as hotkey without opening the color menu (with ctrl+right key you can still change the color).
It is a beta version, so please test on micros first!!!
The script must be run with admin rights!!!
Standard config, which you can customize in the script as you like (customize or add hotkeys):
right mouse button: sends check/fold (!!!IMPORTANT!!! Fold/Fold to any bet has set to F1 in GGPoker Client)
middle mouse button sends: F3
XButton1 sends: F2
XButton2 sends: F4

If the script works for you or not please leave a feedback.
If you like the possibility to check/fold with the right mouse button on ggpoker i would appreciate a donation via paypal.me/DominikDangendorf.

Code:
;***************************************************************************************
; BET POT - GGPoker
; By Annuit20
; Feb 2022
; v1.3
; 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
xRB := 0.80
yRB := 0.92
xTB := 0.818
yTB := 0.927

;***************************************************************************************
;******************************* GLOBAL VARIABLES **********************************

w_client := 0
h_client := 0


if(MouseOverPop == true)
	SetTimer, WatchCursor, 100


; ******************************* HOTKEYS **************************************

$RButton::
	MouseGetPos,,,hwnd
		if(ValidateTable(hwnd) != true)
			Send, {RButton}
		else
			if(ValidateTableAction(hwnd) == true)
				ClientClick(hwnd,xRB,yRB)
		else
			send, {F1}
	return
	
	
~MButton::
	MouseGetPos,,,hwnd
		if(ValidateTable(hwnd) == true)
			Send, {F3}
	return
	
	
~XButton1::
	MouseGetPos,,,hwnd
		if(ValidateTable(hwnd) == true)
			Send, {F2}
	return
	
	
~XButton2::
	MouseGetPos,,,hwnd
		if(ValidateTable(hwnd) == true)
			Send, {F4}
	return
	
	
; ****************************** FUNCTIONS ***************************************

ClientClick(hwnd,x,y){
	global w_client,h_client
	xc := Round(x*w_client)
	yc := Round(y*h_client)
	PostLeftClick(xc,yc,hwnd) 
}


ValidateTable(hwnd){
	WinGetClass,wclass,ahk_id%hwnd%
	WinGetTitle,wtitle,ahk_id%hwnd%
		if wtitle not contains NLH,PLO,Table,Hold'em,Spin,SD,Battle
			return false
		if(wclass = "ApolloRuntimeContentWindow")
			return true
		else
			return false	
}


ValidateTableAction(hwnd){
	global w_client,h_client,xTB,yTB
	GetClientSize(hwnd,w_client,h_client)
	ClientToWin(hwnd,xpi,ypi)
		xpi := (xTB*w_client)
		ypi := (yTB*h_client)
		PixelGetColor,color,xpi,ypi
		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(ValidateTable(hwnd) != false)
	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")
	
}

Last edited by _dave_; 09-05-2023 at 07:22 PM. Reason: Apparently against ToS, don't want people getting banned!
02-08-2022 , 10:07 AM
good work
02-08-2022 , 07:22 PM
Thanks! Did you take a similar approach for SAT?
04-25-2022 , 07:36 AM
I there Annuit20. Do you know if there any way to a script to click i'm back to never sit out on ggpoker if the table is stacked and not visible?
04-25-2022 , 09:18 AM
Hi, not sure but take a look at stackandtile or yurojin.
04-25-2022 , 10:07 AM
Thx but those aren't working for me.
04-29-2022 , 10:26 AM
Can you add copy nickname by just one click mouse?
07-10-2022 , 08:42 AM
Hello @Annuit20,

Could you update your script please? Is not working anymore.
GG did an update of there Hotkeys in the settings.

I think they changed second line "Check/Fold" into "Check/Call"


Thank you very much!
Appreciate it.
07-13-2022 , 09:52 AM
Quote:
Originally Posted by SMD123
Hello @Annuit20,

Could you update your script please? Is not working anymore.
GG did an update of there Hotkeys in the settings.

I think they changed second line "Check/Fold" into "Check/Call"


Thank you very much!
Appreciate it.
Hey,

I tested the script and for me its still working fine.
In the GG client the 2nd was always Check / Call. That's the main reason i wrote this script.
Try to increase or decrease the table size a bit.
07-17-2022 , 09:06 PM
Quote:
Originally Posted by Annuit20
Hey,

I tested the script and for me its still working fine.
In the GG client the 2nd was always Check / Call. That's the main reason i wrote this script.
Try to increase or decrease the table size a bit.
Hey!

My problem is that I can't increase or decrease the table size. Even a bit.
My tables size resolution is fix for all tables and look like to be 642x482.



Thanks in advance for your help!
07-17-2022 , 09:29 PM
So you say you can't even test it?
If you use some kind of special aspect ratio the script don't work without special adjustments, and no i won't do it for you sry.

Try this one:
Code:
;***************************************************************************************
; BET POT - GGPoker
; By Annuit20
; Feb 2022
;
; 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
xRB := 0.80
yRB := 0.92
xTB := 0.818
yTB := 0.927

;***************************************************************************************
;******************************* GLOBAL VARIABLES **********************************

w_client := 0
h_client := 0


if(MouseOverPop == true)
	SetTimer, WatchCursor, 100


; ******************************* HOTKEYS **************************************

$RButton::
	MouseGetPos,,,hwnd
		if(ValidateTable(hwnd) != true)
			Send, {RButton}
		else
			if(ValidateTableAction(hwnd) == true)
				ClientClick(hwnd,xRB,yRB)
				;msgbox, checkfold
					else
				;msgbox, seF1
				Send, {F1}
	return
	
	
~MButton::
	MouseGetPos,,,hwnd
	if(ValidateTable(hwnd) == true)
	Send, {F3}
	return
	
	
~XButton1::
	MouseGetPos,,,hwnd
	if(ValidateTable(hwnd) == true)
	Send, {F2}
	return
	
	
~XButton2::
	MouseGetPos,,,hwnd
	if(ValidateTable(hwnd) == true)
	Send, {F4}
	return
	
	
; ****************************** FUNCTIONS ***************************************

ClientClick(hwnd,x,y){
	global w_client,h_client
	xc := Round(x*w_client)
	yc := Round(y*h_client)
	PostLeftClick(xc,yc,hwnd) 
}


ValidateTable(hwnd){
	WinGetClass,wclass,ahk_id%hwnd%
	WinGetTitle,wtitle,ahk_id%hwnd%
		;if wtitle not contains NLH,PLO,Table,Hold'em,Spin,SD,Battle
			;return false
		if(wclass = "ApolloRuntimeContentWindow")
			return true
		else
			return false	
}


ValidateTableAction(hwnd){
	global w_client,h_client,xTB,yTB
	GetClientSize(hwnd,w_client,h_client)
	ClientToWin(hwnd,xpi,ypi)
		xpi := (xTB*w_client)
		ypi := (yTB*h_client)
		;MouseMove, xpi, ypi
		PixelGetColor,color,xpi,ypi
		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(ValidateTable(hwnd) != false)
	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")
	
}

Last edited by Annuit20; 07-17-2022 at 09:36 PM.
07-21-2022 , 09:18 PM
Hello @Annuit20!

I tried your new code but still the same issue.
For example when I press right click mouse, it Calls, instead of Folds

Regards
07-25-2022 , 06:33 AM
Need help
07-25-2022 , 07:46 AM
As i mentioned before: Test it with different aspect ratio to see if it works in generell. If yes you have to fine tune in 0,01 or even in 0,001 steps -->
xTB := 0.818
yTB := 0.927

The script looking for the the pixel color of the text in the "check" button.

You can remove the ";" for: ;MouseMove, xpi, ypi and you can see where the mouse pointer jumps to. Maybe you have to deactivate or delete some parts of the script for this test. Im not a coder so i can't remember what lines.

GL
07-26-2022 , 08:24 AM
Hey Annuit20

Thank you for GL bro but you talk to me in Chinese there... I don't understand a single thing.

I am not a coder too... But I sent you a screenshot of my tables size, so maybe can you try to do it for me please?
In fact just for information I can't change tables sizes cause I've a 2540x1440 monitor and I have pretty always 12 tables opened, so 4 tables in the width and 3 tables in height


Regards
07-29-2022 , 10:38 AM
Hello

I don't understand, what is xTB and what is yTB ?
07-29-2022 , 10:39 AM
Hello

I don't understand, what is xTB and what is yTB ?
07-29-2022 , 12:30 PM
Hey,

here a quick an dirty overview what the script does only for right click (check/fold) otehr stuff is self explaining than.

Checks if window (table) under mouse is GGPoker table. If not and right mouse button is clicked passthrough this click.
If yes it search for a pixel color on the middle button (coordinates xTB, yTB). On this location there are different actions for these button. If its named check the Pixel color we are looking for is white and not red anymore so the script knows in this moment it is check. If so the script send a left mouse click to this button (coordinates xRB, yRB). Otherwise it sends F1 (keyboard). F1 has to be fold in your GGPoker client hotkey settings!!!

The coordinates are relativ percentages! to the table upper left.
F.E.: xTB=0, yTB=0 is the most upper left corner. xTB=0.5, yTB=0.1 is middle from left to right and 10% pixels down from the top. We use percantges here because table size can differ (like in your case).

If we change the ration from f.e. 4/3 to 16/9 the script will fail.

What you have to do now is find the correct percentages (xTB, yTB) where the pixel color gets white when chech and is red when other options are available.

Last edited by Annuit20; 07-29-2022 at 12:39 PM.
07-29-2022 , 12:30 PM
...
07-29-2022 , 01:40 PM
Thank you.
How I can find the correct percentages xTB and yTB? and do I have to touch to yRB and yRB?
07-29-2022 , 01:40 PM
Thank you.
How I can find the correct percentages xTB and yTB? and do I have to touch to yRB and yRB?
07-29-2022 , 02:10 PM
As mentioned before:
You can remove the ";" for: ;MouseMove, xpi, ypi and you can see where the mouse pointer jumps to.

xRB and yRB should be not critical because the button is big enough. If it doesn't click it just trial an error.
But you can also use the move mouse pointer trick or use ahk windows spy.
08-03-2022 , 02:51 PM
Solved via PM.
For 640x480:

Code:
xRB := 0.80
yRB := 0.92
xTB := 0.818
yTB := 0.91
09-16-2022 , 09:03 PM
To stupid to edit OP.
New version with better coordinates because at some table sizes the script didn't work properly.

Code:
;***************************************************************************************
; BET POT - GGPoker
; By Annuit20
; Feb 2022
;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
xRB := 0.80
yRB := 0.92
xTB := 0.817 ;0.818
yTB := 0.931 ;0.927

;***************************************************************************************
;******************************* GLOBAL VARIABLES **********************************

w_client := 0
h_client := 0


if(MouseOverPop == true)
	SetTimer, WatchCursor, 100


; ******************************* HOTKEYS **************************************

$RButton::
	MouseGetPos,,,hwnd
		if(ValidateTable(hwnd) != true)
			Send, {RButton}
		else
			if(ValidateTableAction(hwnd) == true)
				ClientClick(hwnd,xRB,yRB)
				;msgbox, checkfold
					else
				;msgbox, seF1
				Send, {F1}
	return
	
	
~MButton::
	MouseGetPos,,,hwnd
	if(ValidateTable(hwnd) == true)
	Send, {F3}
	return
	
	
~XButton1::
	MouseGetPos,,,hwnd
	if(ValidateTable(hwnd) == true)
	Send, {F2}
	return
	
	
~XButton2::
	MouseGetPos,,,hwnd
	if(ValidateTable(hwnd) == true)
	Send, {F4}
	return
	
	
; ****************************** FUNCTIONS ***************************************

ClientClick(hwnd,x,y){
	global w_client,h_client
	xc := Round(x*w_client)
	yc := Round(y*h_client)
	PostLeftClick(xc,yc,hwnd) 
}


ValidateTable(hwnd){
	WinGetClass,wclass,ahk_id%hwnd%
	WinGetTitle,wtitle,ahk_id%hwnd%
		;if wtitle not contains NLH,PLO,Table,Hold'em,Spin,SD,Battle
			;return false
		if(wclass = "ApolloRuntimeContentWindow")
			return true
		else
			return false	
}


ValidateTableAction(hwnd){
	global w_client,h_client,xTB,yTB
	GetClientSize(hwnd,w_client,h_client)
	ClientToWin(hwnd,xpi,ypi)
		xpi := (xTB*w_client)
		ypi := (yTB*h_client)
		;MouseMove, xpi, ypi
		PixelGetColor,color,xpi,ypi
		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(ValidateTable(hwnd) != false)
	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")
	
}
10-07-2022 , 05:45 PM
Nice work
Closed Thread Subscribe
...

      
m