By Adde @ 2+2 forums (HstreamPoker at gmail dot com). The corresponding thread on 2+2 is here.
NOTE: This version of Mouse Clicker does not include the clicker functionality from the previous version. I will create a new script that handles that. If you need the old version you can find it here: MouseClickerOld
Mouse Clicker
Mouse hotkeys for (advance) action buttons at PartyPoker, EmpirePoker, Full Tilt and WPEX.
Instead of clicking those action buttons (or advance action buttons/checkboxes), you simply move your mouse to the poker table (anywhere at the table), and click one of your mouse keys to automatically click the button. For instance, pushing the mouse scroll wheel down can click the Fold or Check button; mouse wheel up can click the Call or Check button; right mouse button can click the Bet or Raise button.
You can also assign mouse hotkeys for other common actions at the table: Sitout, Wait for BB, Post Blind, Deal me in, etc.
To use the script you need a mouse with at least 3 extra buttons. I have a Logitech MX1000, with the following configuration:
Down scroll wheel: check/fold
Right scroll wheel: bet/raise
Up scroll wheel: check/call
Since AutoHotkey has limited support for mouse hotkeys, I had to assign a keyboard commando to the right scroll wheel in mouse settings, and then assign the same commando to a hotkey in this script.
This script has Scriptpad support. Scriptpad is a tool where you can connect any number of scripts to a Scriptpad, a small pop-up window with buttons for all available commands in these scripts. You access the Scriptpad by clicking a hotkey, for instance the middle mouse button.
Image Files
To use this script with Full Tilt and WPEX you need to download these image files and put them in the same directory as the script.
That is, there should be a folder named "mc_image_files" (with all the pictures inside) in the same folder as the script file is located.
You need WinRar to open image files archive. There's a free trial version here: http://www.rarlab.com/download.htm
Troubleshooting
For this script to work at best, it is recommended that you install Microsoft Powertoys for Windows XP, and configure it to automatically activate the window under the mouse pointer.
How To Use This Script
Read instructions for AutoHotkey, and make sure you have the latest version installed.
Save the script code below in a file named "MouseClicker.ahk"
Download image files and put them in same directory as the script file.
Open script file in a text editor and edit settings.
Run the script (double-click the file).
A green AHK icon will show in the system tray as long as the script is running. Right-click this icon and choose "Exit" to exit the script. If the script seems to have gone wild, choose "Reload this script".
Script Code
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Code begins here ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;------------------------------------------------------------------------------------------------
; Mouse Clicker v2.12
;------------------------------------------------------------------------------------------------
; Date: 2006-12-10
;------------------------------------------------------------------------------------------------
; Author(s): Adde @ 2+2 forums
; Contact: HstreamPoker at gmail dot com
;------------------------------------------------------------------------------------------------
; Mouse hotkeys for clicking (advance) action buttons.
; See web page for more details.
;
; All rights reserved. Use at your own risk.
; TRY SCRIPT AT PLAY MONEY TABLES FIRST!
;
; http://overcards.com/wiki/moin.cgi/MouseClicker
;------------------------------------------------------------------------------------------------
mc_ahk_version = 1.0.44.12
mc_script_url = http://overcards.com/wiki/moin.cgi/MouseClicker
;________________________________________________________________________________________________
;
; EDIT THESE SETTINGS
;________________________________________________________________________________________________
; Set what hotkeys should click (advance) action buttons.
; Leave empty ("") if you don't want to use a specific hotkey/feature.
; LINK: http://www.autohotkey.com/docs/KeyList.htm
mc_action_hotkey_check_fold := "WheelDown"
mc_action_hotkey_check_call := "WheelUp"
mc_action_hotkey_bet_raise := "^!Right"
mc_action_hotkey_fold_to_any := "^!Left"
; Set what ACTION hotkeys above should be used for these buttons and checkboxes.
; Leave empty ("") if you don't want to use a specific hotkey/feature.
mc_button_sitout := "check_fold" ; "Sitout" button (not checkbox)
mc_button_wait_for_bb := "check_call" ; "Wait for BB" button
mc_button_post_blind := "bet_raise" ; "Post Blind" button (not checkbox)
mc_button_deal_me_in := "bet_raise" ; "Deal Me In" button
mc_button_play_now := "bet_raise" ; "Play Now" button
mc_button_i_am_back := "bet_raise" ; "I Am Back" button
mc_checkbox_sitout := "" ; "Sit Out" checkbox
mc_checkbox_auto_post := "bet_raise" ; "Auto Post Blind" checkbox
mc_button_yes := "check_call" ; Various "Yes" and "OK" dialog buttons
mc_button_no := "check_fold" ; Various "No", "Cancel" and "Close" dialog buttons
; -----------------------------------------------------------------------------------------------
;
; Settings below are different features for my personal use.
; I don't have the time to document them right now, so skip it if you
; don't know how to program AHK yourself.
;
; -----------------------------------------------------------------------------------------------
; Set left- and right mouse hotkeys. These clicker functions will perform various
; tasks depending on where in a window you clicked. See below for more info.
; Leave empty ("") if you don't want to use a specific hotkey/feature.
mc_clicker_hotkey_left := ""
mc_clicker_hotkey_right := "" ; "RButton"
; xxxxxxxxxxxxxxxxxxxxxxxxx
mc_clicker_mover := "right"
mc_clicker_leave := "right"
mc_clicker_waitlist := "right"
mc_clicker_waitlist_all := "right"
mc_clicker_chat := "right"
; xxxxxxxxxxxxxxxxxxxxxxxxx
mc_ftp_skip_take_seat_yes_no = 1
; xxxxxxxxxxxxxxxxxxxxxxxxx
mc_ftp_window_mover_table_x = 134
mc_ftp_window_mover_table_y = 22
mc_ftp_window_mover_table_w = 23
mc_ftp_window_mover_table_h = 23
mc_ftp_window_mover_lobby_x = 24
mc_ftp_window_mover_lobby_y = 56
mc_ftp_window_mover_lobby_w = 23
mc_ftp_window_mover_lobby_h = 23
mc_pty_window_mover_table_x = 4
mc_pty_window_mover_table_y = 26
mc_pty_window_mover_table_w = 38
mc_pty_window_mover_table_h = 38
mc_pty_window_mover_lobby_x = 3
mc_pty_window_mover_lobby_y = 27
mc_pty_window_mover_lobby_w = 25
mc_pty_window_mover_lobby_h = 25
mc_ftp_window_mover_coords = 0.0 / 800.0 / 1600.0 / 2400.0 / 0.572 / 800.572 / 1600.572 / 2400.572
mc_pty_window_mover_coords = 0.0 / 795.0 / 1600.0 / 2395.0 / 0.575 / 795.575 / 1600.575 / 2395.575
mc_wpx_window_mover_coords = 0.0 / 795.0 / 1600.0 / 2395.0 / 0.575 / 795.575 / 1600.575 / 2395.575
mc_ftp_chat_table_x = 283
mc_ftp_chat_table_y = 547
mc_ftp_chat_table_w = 23
mc_ftp_chat_table_h = 23
;________________________________________________________________________________________________
;
; DO NOT EDIT BELOW HERE
;________________________________________________________________________________________________
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; auto-execute ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
#NoEnv
#SingleInstance Force
#Persistent
AF_CheckAHKVersion(mc_ahk_version)
mc_scriptpad_command_header = Other Tools
mc_scriptpad_command_name = Disable Mouse Clicker
mc_scriptpad_command_label = MC_Scriptpad_EnableDisable
mc_scriptpad_command_enabled = 1
mc_ftp_action_area_x1 = 440
mc_ftp_action_area_y1 = 500
mc_ftp_action_area_x2 = 800
mc_ftp_action_area_y2 = 565
mc_wpx_action_area_x1 = 0
mc_wpx_action_area_y1 = 480
mc_wpx_action_area_x2 = 560
mc_wpx_action_area_y2 = 580
mc_window_mover_enable_hide = 0
MC_Init()
Hotkey, IfWinActive, ahk_class FTC_TableViewFull
Hotkey, %mc_action_hotkey_check_fold%, MC_FTP_CheckFold, UseErrorLevel
Hotkey, %mc_action_hotkey_check_call%, MC_FTP_CheckCall, UseErrorLevel
Hotkey, %mc_action_hotkey_bet_raise%, MC_FTP_BetRaise, UseErrorLevel
Hotkey, %mc_action_hotkey_fold_to_any%, MC_FTP_FoldToAny, UseErrorLevel
Hotkey, %mc_clicker_hotkey_left%, MC_FTP_ClickerLeft, UseErrorLevel
Hotkey, %mc_clicker_hotkey_right%, MC_FTP_ClickerRight, UseErrorLevel
Hotkey, IfWinActive, ahk_class FTCLobby
Hotkey, %mc_clicker_hotkey_left%, MC_FTP_ClickerLeft, UseErrorLevel
Hotkey, %mc_clicker_hotkey_right%, MC_FTP_ClickerRight, UseErrorLevel
Hotkey, IfWinActive, ahk_class TDlgTableHoldem
Hotkey, %mc_action_hotkey_check_fold%, MC_WPX_CheckFold, UseErrorLevel
Hotkey, %mc_action_hotkey_check_call%, MC_WPX_CheckCall, UseErrorLevel
Hotkey, %mc_action_hotkey_bet_raise%, MC_WPX_BetRaise, UseErrorLevel
Hotkey, IfWinActive, ahk_class #32770
Hotkey, %mc_action_hotkey_check_fold%, MC_PTY_CheckFold, UseErrorLevel
Hotkey, %mc_action_hotkey_check_call%, MC_PTY_CheckCall, UseErrorLevel
Hotkey, %mc_action_hotkey_bet_raise%, MC_PTY_BetRaise, UseErrorLevel
Hotkey, %mc_clicker_hotkey_left%, MC_PTY_ClickerLeft, UseErrorLevel
Hotkey, %mc_clicker_hotkey_right%, MC_PTY_ClickerRight, UseErrorLevel
/*
Hotkey, IfWinActive, ahk_class UltraMon Taskbar
Hotkey, WheelDown, MC_WinAmp_NextSong, UseErrorLevel
Hotkey, WheelUp, MC_WinAmp_PrevSong, UseErrorLevel
Hotkey, ^!Right, MC_WinAmp_VolUp, UseErrorLevel
Hotkey, ^!Left, MC_WinAmp_VolDown, UseErrorLevel
Hotkey, IfWinActive, ahk_class Progman
Hotkey, WheelDown, MC_WinAmp_NextSong, UseErrorLevel
Hotkey, WheelUp, MC_WinAmp_PrevSong, UseErrorLevel
Hotkey, ^!Right, MC_WinAmp_VolUp, UseErrorLevel
Hotkey, ^!Left, MC_WinAmp_VolDown, UseErrorLevel
Hotkey, IfWinActive, ahk_class Shell_TrayWnd
Hotkey, WheelDown, MC_WinAmp_NextSong, UseErrorLevel
Hotkey, WheelUp, MC_WinAmp_PrevSong, UseErrorLevel
Hotkey, ^!Right, MC_WinAmp_VolUp, UseErrorLevel
Hotkey, ^!Left, MC_WinAmp_VolDown, UseErrorLevel
*/
goto MC_Scriptpad_End
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;--------------------------------------------------------------- Misc functions ------------------
MC_Init()
{
local idx, item
StringSplit, mc_ftp_window_mover_coords, mc_ftp_window_mover_coords, /
Loop, %mc_ftp_window_mover_coords0%
{
idx := a_index
item := mc_ftp_window_mover_coords%idx%
item := AF_TrimWhiteSpace(item)
StringSplit, item, item, .
mc_ftp_window_mover_coords_x%idx% := item1
mc_ftp_window_mover_coords_y%idx% := item2
}
StringSplit, mc_pty_window_mover_coords, mc_pty_window_mover_coords, /
Loop, %mc_pty_window_mover_coords0%
{
idx := a_index
item := mc_pty_window_mover_coords%idx%
item := AF_TrimWhiteSpace(item)
StringSplit, item, item, .
mc_pty_window_mover_coords_x%idx% := item1
mc_pty_window_mover_coords_y%idx% := item2
}
StringSplit, mc_wpx_window_mover_coords, mc_wpx_window_mover_coords, /
Loop, %mc_wpx_window_mover_coords0%
{
idx := a_index
item := mc_wpx_window_mover_coords%idx%
item := AF_TrimWhiteSpace(item)
StringSplit, item, item, .
mc_wpx_window_mover_coords_x%idx% := item1
mc_wpx_window_mover_coords_y%idx% := item2
}
}
MC_Scriptpad_EnableDisable:
AF_Scriptpad_ToggleEnabled("mc", "Enable Mouse Clicker", "Disable Mouse Clicker", mc_enabled)
return
MC_AbortClicker(key)
{
StringUpper, key, key
if (key = "RIGHT")
{
click right down
click right up
}
if (key = "LEFT")
{
click left up
click left down
click left up
}
}
MC_ConsumeClicker(key)
{
StringUpper, temp, mc_action_hotkey_clicker
if (temp = "RBUTTON")
{
click right down
}
StringUpper, key, key
if (key = "RIGHT")
{
click right down
}
if (key = "LEFT")
{
click left down
}
}
MC_ClickYesOrNo(winID, key, class)
{
local class2, id1, id2, x, y
;return 0
SetTitleMatchMode, 3
WinGetClass, class2, ahk_id %winID%
if (class <> class2)
a=2 ; return 0
if (mc_ftp_skip_take_seat_yes_no)
{
WinGet, id1, ID, Seat Available, A seat is reserved for you
if (id1 <> "")
{
MouseGetPos, x, y, id2
if (id1 <> id2)
return 0
}
}
if (key = mc_button_yes)
{
ControlGet, result, Visible, , Yes, ahk_class #32770
if (result)
{
ControlFocus, Yes, ahk_class #32770
Send {SPACE}
return 1
}
ControlGet, result, Visible, , OK, ahk_class #32770
if (result)
{
ControlFocus, OK, ahk_class #32770
Send {SPACE}
return 1
}
ControlGet, result, Visible, , &Ja, ahk_class #32770
if (result)
{
ControlFocus, &Ja, ahk_class #32770
ControlClick, &Ja, ahk_class #32770
;Send {ENTER}
return 1
}
}
if (key = mc_button_no)
{
ControlGet, result, Visible, , No, ahk_class #32770
if (result)
{
ControlFocus, No, ahk_class #32770
Send {SPACE}
return 1
}
ControlGet, result, Visible, , Cancel, ahk_class #32770
if (result)
{
ControlFocus, Cancel, ahk_class #32770
Send {SPACE}
return 1
}
ControlGet, result, Visible, , Close, ahk_class #32770
if (result)
{
ControlFocus, Close, ahk_class #32770
Send {SPACE}
return 1
}
ControlGet, result, Visible, , &Nej, ahk_class #32770
if (result)
{
ControlFocus, &Nej, ahk_class #32770
ControlClick, &Nej, ahk_class #32770
;Send {SPACE}
return 1
}
}
return 0
}
MC_GetWindowMoverBoxnum(site, x, y, mode)
{
local x1, x2, x3, y1, xinc, yinc, xmin, xmax, ymin, ymax, boxnum
StringLower, site, site
if (mode = "table")
{
xinc := mc_%site%_window_mover_table_w
yinc := mc_%site%_window_mover_table_h
xmin := mc_%site%_window_mover_table_x
ymin := mc_%site%_window_mover_table_y
xmax := xmin + (4 * xinc)
ymax := ymin + (2 * yinc)
}
else
{
xinc := mc_%site%_window_mover_lobby_w
yinc := mc_%site%_window_mover_lobby_h
xmin := mc_%site%_window_mover_lobby_x
ymin := mc_%site%_window_mover_lobby_y
xmax := xmin + (4 * xinc)
ymax := ymin + (2 * yinc)
}
if (mc_window_mover_enable_hide)
{
xmax := xmax + xinc
}
if (x < xmin or x > xmax or y < ymin or y > ymax)
return 0
x1 := xmin + (1*xinc)
x2 := xmin + (2*xinc)
x3 := xmin + (3*xinc)
x4 := xmin + (4*xinc)
y1 := ymin + (1*yinc)
if (x <= x1)
boxnum := 1
else if (x <= x2)
boxnum := 2
else if (x <= x3)
boxnum := 3
else if (x <= x4)
boxnum := 4
else
boxnum := -99
if (y <= y1)
boxnum := boxnum
else
boxnum := boxnum + 4
if (boxnum < 0 and y > y1)
return 0
return (boxnum)
}
MC_GetChatBoxnum(site, x, y)
{
local x1, x2, x3, y1, xinc, yinc, xmin, xmax, ymin, ymax, boxnum
StringLower, site, site
xinc := mc_%site%_chat_table_w
yinc := mc_%site%_chat_table_h
xmin := mc_%site%_chat_table_x
ymin := mc_%site%_chat_table_y
xmax := xmin + (8 * xinc)
ymax := ymin + (1 * yinc)
if (x < xmin or x > xmax or y < ymin or y > ymax)
return 0
x1 := xmin + (1*xinc)
x2 := xmin + (2*xinc)
x3 := xmin + (3*xinc)
x4 := xmin + (4*xinc)
x5 := xmin + (5*xinc)
x6 := xmin + (6*xinc)
x7 := xmin + (7*xinc)
x8 := xmin + (8*xinc)
y1 := ymin + (1*yinc)
if (x <= x1)
boxnum := 1
else if (x <= x2)
boxnum := 2
else if (x <= x3)
boxnum := 3
else if (x <= x4)
boxnum := 4
else if (x <= x5)
boxnum := 5
else if (x <= x6)
boxnum := 6
else if (x <= x7)
boxnum := 7
else if (x <= x8)
boxnum := 8
else
boxnum := -99
if (boxnum < 0 and y > y1)
return 0
return (boxnum)
}
;-------------------------------------------------------------------- Full Tilt ------------------
MC_FTP_ClickActionButton(winID, buttonName, matchMode)
{
SetTitleMatchMode, %matchMode%
ControlGet, result, Visible, , %buttonName%, ahk_id %winID%
if (result = 0)
return 0
ControlClick, %buttonName%, ahk_id %winID%
return 1
}
MC_FTP_ClickMouse(winID, x, y)
{
ControlClick, x%x% y%y%, ahk_id %winID%
}
MC_FTP_FoldToAny:
MouseGetPos, , , mc_current_win_id
if (MC_FTP_ClickBeforeAnyAction(mc_current_win_id, "fold_to_any"))
return
if MC_FTP_ClickActionButton(mc_current_win_id, "FTCButton28", 3)
return
if (MC_FTP_ClickAfterAnyAction(mc_current_win_id, "fold_to_any"))
return
Send {%mc_action_hotkey_fold_to_any%}
return
MC_FTP_CheckFold:
MouseGetPos, , , mc_current_win_id
if (MC_FTP_ClickBeforeAnyAction(mc_current_win_id, "check_fold"))
return
if MC_FTP_ClickActionButton(mc_current_win_id, "FTCButton9", 3)
return
if MC_FTP_ClickActionButton(mc_current_win_id, "FTCButton22", 3)
return
if (MC_FTP_ClickAfterAnyAction(mc_current_win_id, "check_fold"))
return
Send {%mc_action_hotkey_check_fold%}
return
MC_FTP_CheckCall:
MouseGetPos, , , mc_current_win_id
if (MC_FTP_ClickBeforeAnyAction(mc_current_win_id, "check_call"))
return
if MC_FTP_ClickActionButton(mc_current_win_id, "FTCButton10", 3)
return
if MC_FTP_ClickActionButton(mc_current_win_id, "FTCButton24", 3)
return
if MC_FTP_ClickActionButton(mc_current_win_id, "FTCButton9", 3)
return
if (MC_FTP_ClickAfterAnyAction(mc_current_win_id, "check_call"))
return
Send {%mc_action_hotkey_check_call%}
return
MC_FTP_BetRaise:
MouseGetPos, , , mc_current_win_id
if (MC_FTP_ClickBeforeAnyAction(mc_current_win_id, "bet_raise"))
return
if MC_FTP_ClickActionButton(mc_current_win_id, "FTCButton11", 3)
return
if MC_FTP_ClickActionButton(mc_current_win_id, "FTCButton26", 3)
return
if (MC_FTP_ClickAfterAnyAction(mc_current_win_id, "bet_raise"))
return
Send {%mc_action_hotkey_bet_raise%}
return
MC_FTP_ClickBeforeAnyAction(winID, key)
{
local x0, y0
if (MC_ClickYesOrNo(winID, key, "#32770"))
return 1
CoordMode, Pixel, Relative
if (key = mc_button_sitout)
{
ImageSearch, x0, y0, mc_ftp_action_area_x1, mc_ftp_action_area_y1, mc_ftp_action_area_x2, mc_ftp_action_area_y2, mc_image_files\mc_ftp_sitout.bmp
if (x0 > 0)
{
MC_FTP_ClickMouse(winID, x0+5, y0+5)
return 1
}
}
if (key = mc_button_wait_for_bb)
{
ImageSearch, x0, y0, mc_ftp_action_area_x1, mc_ftp_action_area_y1, mc_ftp_action_area_x2, mc_ftp_action_area_y2, mc_image_files\mc_ftp_wait.bmp
if (x0 > 0)
{
MC_FTP_ClickMouse(winID, x0+5, y0+5)
return 1
}
}
if (key = mc_button_post_blind)
{
ImageSearch, x0, y0, mc_ftp_action_area_x1, mc_ftp_action_area_y1, mc_ftp_action_area_x2, mc_ftp_action_area_y2, mc_image_files\mc_ftp_post.bmp
if (x0 > 0)
{
MC_FTP_ClickMouse(winID, x0+5, y0+5)
return 1
}
}
if (key = mc_button_deal_me_in)
{
ImageSearch, x0, y0, mc_ftp_action_area_x1, mc_ftp_action_area_y1, mc_ftp_action_area_x2, mc_ftp_action_area_y2, mc_image_files\mc_ftp_deal.bmp
if (x0 > 0)
{
MC_FTP_ClickMouse(winID, x0+5, y0+5)
return 1
}
}
if (key = mc_button_play_now)
{
ImageSearch, x0, y0, mc_ftp_action_area_x1, mc_ftp_action_area_y1, mc_ftp_action_area_x2, mc_ftp_action_area_y2, mc_image_files\mc_ftp_play.bmp
if (x0 > 0)
{
MC_FTP_ClickMouse(winID, x0+5, y0+5)
return 1
}
}
return 0
}
MC_FTP_ClickAfterAnyAction(winID, key)
{
global
if (key = mc_checkbox_sitout)
{
if MC_FTP_ClickActionButton(mc_current_win_id, "FTCButton29", 3)
return 1
}
if (key = mc_checkbox_auto_post)
{
if MC_FTP_ClickActionButton(mc_current_win_id, "FTCButton30", 3)
return 1
}
return 0
}
MC_FTP_ClickerLeft:
MC_FTP_ClickerAny("left")
return
MC_FTP_ClickerRight:
MC_FTP_ClickerAny("right")
return
MC_FTP_ClickerAny(dir)
{
local x, y, winID, class
CoordMode, Mouse, Relative
MouseGetPos, x , y , winID, ctrl
WinGetClass, class, ahk_id %winID%
if (class <> "FTC_TableViewFull" and class <> "FTCLobby")
{
MC_AbortClicker(dir)
return
}
if (mc_clicker_mover = dir)
if (MC_FTP_ClickerCheckMover(winID, class, x, y))
return
if (mc_clicker_chat = dir)
if (MC_FTP_ClickerCheckChat(winID, class, x, y))
return
if (mc_clicker_leave = dir)
if (MC_FTP_ClickerCheckLeave(winID, class, ctrl))
return
if (mc_clicker_waitlist = dir)
if (MC_FTP_ClickerCheckWaitlist(winID, class, ctrl))
return
if (mc_clicker_waitlist_all = dir)
if (MC_FTP_ClickerCheckWaitlistAll(winID, class, ctrl))
return
MC_AbortClicker(dir)
return
}
MC_FTP_ClickerCheckMover(winID, class, x, y)
{
local x1, y1
if (class = "FTC_TableViewFull")
{
boxnum := MC_GetWindowMoverBoxnum("FTP", x, y, "table")
if (boxnum > 0)
{
x1 := mc_ftp_window_mover_coords_x%boxnum%
y1 := mc_ftp_window_mover_coords_y%boxnum%
AF_WinMoveID(winID, x1, y1)
return 1
}
if (boxnum < 0)
msgbox Hide window
}
if (class = "FTCLobby")
{
boxnum := MC_GetWindowMoverBoxnum("FTP", x, y, "lobby")
if (boxnum > 0)
{
x1 := mc_ftp_window_mover_coords_x%boxnum%
y1 := mc_ftp_window_mover_coords_y%boxnum%
AF_WinMoveID(winID, x1, y1)
return 1
}
if (boxnum < 0)
msgbox Hide window
}
return 0
}
MC_FTP_ClickerCheckLeave(winID, class, ctrl)
{
local x1, x1, y1, y2, result
if (class = "FTC_TableViewFull" and ctrl = "FTCButton5")
{
ControlGet, result, Visible, , FTCButton27, ahk_id %winID%
if (not result)
{
WinClose, ahk_id %winID%
return 1
}
ImageSearch, x0, y0, mc_ftp_action_area_x1, mc_ftp_action_area_y1, mc_ftp_action_area_x2, mc_ftp_action_area_y2, mc_image_files\mc_ftp_deal.bmp
ImageSearch, x1, y1, mc_ftp_action_area_x1, mc_ftp_action_area_y1, mc_ftp_action_area_x2, mc_ftp_action_area_y2, mc_image_files\mc_ftp_play.bmp
if (x0 > 0 or x2 > 0)
{
MC_FTP_ClickActionButton(winID, "FTCButton5", 3)
sleep, 50
ControlGet, result, Visible, , Yes, ahk_class #32770
if (result)
{
ControlFocus, Yes, ahk_class #32770
Send {ENTER}
sleep, 50
WinClose, ahk_id %winID%
return 1
}
}
MC_FTP_ClickActionButton(winID, "FTCButton5", 3)
sleep, 200
ControlGet, result, Visible, , Yes, ahk_class #32770
if (result)
{
Loop
{
if (result = "" or result = 0)
break
sleep, 50
ControlGet, result, Visible, , Yes, ahk_class #32770
;msgbox %result%
}
sleep, 1000
ControlGet, result, Visible, , FTCButton27, ahk_id %winID%
if (result = "" or result = 0)
{
WinClose, ahk_id %winID%
return 1
}
}
return 1
}
return 0
}
MC_FTP_ClickerCheckWaitlist(winID, class, ctrl)
{
if (class = "FTCLobby" and ctrl = "SysListView323")
{
ControlGet, str, List, Focused, SysListView323, ahk_id %winID%
if (not (InStr(str, "/8") or InStr(str, "/9")))
goto cont29
else if (not InStr(str, "Limit"))
goto cont29
else if (InStr(str, "6/"))
goto cont28
else if (InStr(str, "7/"))
goto cont28
else if (InStr(str, "8/"))
goto cont28
else if (InStr(str, "9/"))
goto cont28
else
goto cont29
cont28:
if (not MC_FTP_ClickActionButton(winID, "FTCButton3", 3))
{
if (not AF_IsButtonVisible(winID, "FTCButton4", 3))
{
MC_FTP_ClickActionButton(winID, "FTCButton2", 3)
sleep, 2000
}
}
sleep, 50
ControlFocus, SysListView323, ahk_id %winID%
WinActivate, ahk_id %winID%
Send {DOWN}
sleep, 50
cont29:
lastLine := ""
Loop
{
ControlGet, str, List, Focused, SysListView323, ahk_id %winID%
if (str = lastLine)
break
lastLine := str
if (InStr(str, "$1/$2") and not InStr(str,"Limit"))
break
if (not (InStr(str, "/8") or InStr(str, "/9")))
goto cont30
else if (not InStr(str, "Limit"))
goto cont30
else if (InStr(str, "6/"))
break
else if (InStr(str, "7/"))
break
else if (InStr(str, "8/"))
break
else if (InStr(str, "9/"))
break
cont30:
Send {DOWN}
}
return 1
}
return 0
}
MC_FTP_ClickerCheckWaitlist0(winID, class, ctrl)
{
if (class = "FTCLobby" and ctrl = "SysListView323")
{
if (not MC_FTP_ClickActionButton(winID, "FTCButton3", 3))
{
if (not AF_IsButtonVisible(winID, "FTCButton4", 3))
{
MC_FTP_ClickActionButton(winID, "FTCButton2", 3)
sleep, 200
WinActivate, ahk_id %winID%
}
}
WinActivate, ahk_id %winID%
sleep, 50
WinActivate, ahk_id %winID%
ControlFocus, SysListView323, ahk_id %winID%
Send {DOWN}
return 1
}
return 0
}
MC_FTP_ClickerCheckWaitlistAll(winID, class, ctrl)
{
return 0
if (class = "FTCLobby" and ctrl = "FTCButton2")
{
Loop
{
ControlGet, str, List, Focused, SysListView323, ahk_id %winID%
if (InStr(str, "$0.50/$1"))
break
if (InStr(str, "$1/$2") and not InStr(str,"Limit"))
break
if (not (InStr(str, "/8") or InStr(str, "/9")))
goto cont20
if (not InStr(str, "Limit"))
goto cont20
if (not InStr(str, "%"))
goto cont20
if (InStr(str, "8/8") or InStr(str, "9/9"))
{
seen := 0
Loop
{
sleep, 10
ControlGet, result1, Visible, , FTCButton3, ahk_id %winID%
if (result1 = 1)
{
seen := 1
MC_FTP_ClickActionButton(winID, "FTCButton3", 3)
}
else
{
if (seen)
break
else
{
ControlGet, result2, Visible, , FTCButton4, ahk_id %winID%
if (result2)
break
else
sleep, 10
}
}
}
pause
}
goto cont20
ControlGet, result, Visible, , FTCButton3, ahk_id %winID%
;msgbox result=%result% line=%str%
if (result = 5)
{
MC_FTP_ClickActionButton(winID, "FTCButton3", 3)
Loop
{
sleep, 10
ControlGet, result, Visible, , FTCButton3, ahk_id %winID%
if (result = 1)
MC_FTP_ClickActionButton(winID, "FTCButton3", 3)
else
break
}
}
else
{
if (InStr(str, "6/") or InStr(str, "7/") or InStr(str, "8/"))
{
MC_FTP_ClickActionButton(winID, "FTCButton2", 3)
}
}
sleep, 10
cont20:
;WinActivate, ahk_id %winID%
ControlFocus, SysListView323, ahk_id %winID%
Send {DOWN}
;sleep, 10
}
return 1
}
return 0
}
MC_FTP_ClickerCheckWaitlistAll0(winID, class, ctrl)
{
if (class = "FTCLobby" and ctrl = "FTCButton2")
{
Loop
{
ControlGet, str, List, Focused, SysListView323, ahk_id %winID%
if (not InStr(str, "%"))
break
MC_FTP_ClickActionButton(winID, "FTCButton3", 3)
sleep, 25
WinActivate, ahk_id %winID%
ControlFocus, SysListView323, ahk_id %winID%
Send {DOWN}
sleep, 75
}
return 1
}
return 0
}
MC_FTP_ClickerCheckChat(winID, class, x, y)
{
local x1, y1
if (class = "FTC_TableViewFull")
{
boxnum := MC_GetChatBoxnum("FTP", x, y)
if (boxnum > 0)
{
msg := ""
if (boxnum = 1)
msg := "nh"
if (boxnum = 2)
msg := "ty"
if (boxnum = 3)
msg := "hehe"
if (boxnum = 4)
msg := "i'm a luckbox :-)"
if (boxnum = 5)
msg := ":-)"
if (boxnum = 6)
msg := "if thats not great poker, then shut up and enjoy his money"
if (boxnum = 7)
msg := "CAP IT" ; "Abusive or offensive language will not be tolerated on the chat boards, games, or otherwise by you on Full Tilt sites or with Company staff. Any violation of this policy will result in a suspension of playing privileges."
if (boxnum = 8)
msg := ""
MC_FTP_Chat(winID, msg)
return 1
}
}
return 0
}
MC_FTP_Chat(winID, msg)
{
ControlGetText, text, Edit2, ahk_id %winID%
if (text = msg)
{
Loop
{
ControlGetText, text, Edit2, ahk_id %winID%
If (text = "")
return
Sleep 30
ControlFocus, Edit2, ahk_id %winID%
Send {ENTER}
Sleep 30
}
}
len := StrLen(text) + 1
ControlFocus, Edit2, ahk_id %winID%
SendPlay {BS %len%}
SendPlay %msg%
}
;-------------------------------------------------------------------- WPEX -------------------------
MC_ClickActionButton_Wpex(winID, button, matchMode)
{
SetTitleMatchMode, %matchMode%
ControlGet, result1, Visible, , %button%, ahk_id %winID%
ControlGet, result2, Enabled, , %button%, ahk_id %winID%
If (result1 AND result2)
{
ControlClick, %button%, ahk_id %winID%
return (ErrorLevel = 0)
}
return 0
}
MC_ClickMouse_Wpex(winID, x, y)
{
ControlClick, x%x% y%y%, ahk_id %winID%
}
MC_WPX_CheckFold:
MouseGetPos, , , mc_current_win_id
if MC_ClickActionButton_Wpex(mc_current_win_id, "Check/Fold", 1)
return
if MC_ClickActionButton_Wpex(mc_current_win_id, "Check", 3)
return
if MC_ClickActionButton_Wpex(mc_current_win_id, "Fold", 3)
return
CoordMode, Pixel, Relative
ImageSearch, x0, y0, mc_wpx_action_area_x1, mc_wpx_action_area_y1, mc_wpx_action_area_x2, mc_wpx_action_area_y2, *10 mc_image_files\mc_wpex_check.bmp
if (x0 > 0)
{
MC_ClickMouse_Wpex(mc_current_win_id, x0+5, y0+5)
return
}
ImageSearch, x0, y0, mc_wpx_action_area_x1, mc_wpx_action_area_y1, mc_wpx_action_area_x2, mc_wpx_action_area_y2, *10 mc_image_files\mc_wpex_fold.bmp
if (x0 > 0)
{
MC_ClickMouse_Wpex(mc_current_win_id, x0+5, y0+5)
return
}
if (MC_ClickOtherButton_Wpex(mc_current_win_id, "check_fold"))
return
Send {%mc_action_hotkey_check_fold%}
return
MC_WPX_CheckCall:
MouseGetPos, , , mc_current_win_id
if MC_ClickActionButton_Wpex(mc_current_win_id, "Check", 3)
return
if MC_ClickActionButton_Wpex(mc_current_win_id, "Call (", 1)
return
if MC_ClickActionButton_Wpex(mc_current_win_id, "Call BB", 1)
return
CoordMode, Pixel, Relative
ImageSearch, x0, y0, mc_wpx_action_area_x1, mc_wpx_action_area_y1, mc_wpx_action_area_x2, mc_wpx_action_area_y2, *10 mc_image_files\mc_wpex_check.bmp
if (x0 > 0)
{
MC_ClickMouse_Wpex(mc_current_win_id, x0+5, y0+5)
return
}
ImageSearch, x0, y0, mc_wpx_action_area_x1, mc_wpx_action_area_y1, mc_wpx_action_area_x2, mc_wpx_action_area_y2, *10 mc_image_files\mc_wpex_call.bmp
if (x0 > 0)
{
MC_ClickMouse_Wpex(mc_current_win_id, x0+5, y0+5)
return
}
if (MC_ClickOtherButton_Wpex(mc_current_win_id, "check_call"))
return
Send {%mc_action_hotkey_check_call%}
return
MC_WPX_BetRaise:
MouseGetPos, , , mc_current_win_id
if MC_ClickActionButton_Wpex(mc_current_win_id, "Bet (", 1)
return
if MC_ClickActionButton_Wpex(mc_current_win_id, "Raise (", 1)
return
CoordMode, Pixel, Relative
ImageSearch, x0, y0, mc_wpx_action_area_x1, mc_wpx_action_area_y1, mc_wpx_action_area_x2, mc_wpx_action_area_y2, *10 mc_image_files\mc_wpex_bet.bmp
if (x0 > 0)
{
MC_ClickMouse_Wpex(mc_current_win_id, x0+5, y0+5)
return
}
ImageSearch, x0, y0, mc_wpx_action_area_x1, mc_wpx_action_area_y1, mc_wpx_action_area_x2, mc_wpx_action_area_y2, *10 mc_image_files\mc_wpex_raise.bmp
if (x0 > 0)
{
MC_ClickMouse_Wpex(mc_current_win_id, x0+5, y0+5)
return
}
ImageSearch, x0, y0, mc_wpx_action_area_x1, mc_wpx_action_area_y1, mc_wpx_action_area_x2, mc_wpx_action_area_y2, *10 mc_image_files\mc_wpex_raiseto.bmp
if (x0 > 0)
{
MC_ClickMouse_Wpex(mc_current_win_id, x0+5, y0+5)
return
}
if (MC_ClickOtherButton_Wpex(mc_current_win_id, "bet_raise"))
return
Send {%mc_action_hotkey_bet_raise%}
return
MC_ClickOtherButton_Wpex(winID, key)
{
global
CoordMode, Pixel, Relative
if (key = mc_button_sitout)
{
ImageSearch, x0, y0, mc_wpx_action_area_x1, mc_wpx_action_area_y1, mc_wpx_action_area_x2, mc_wpx_action_area_y2, *10 mc_image_files\mc_wpex_sitout.bmp
if (x0 > 0)
{
MC_ClickMouse_Wpex(winID, x0+5, y0+5)
return 1
}
}
if (key = mc_button_wait_for_bb)
{
ImageSearch, x0, y0, mc_wpx_action_area_x1, mc_wpx_action_area_y1, mc_wpx_action_area_x2, mc_wpx_action_area_y2, *10 mc_image_files\mc_wpex_wait.bmp
if (x0 > 0)
{
MC_ClickMouse_Wpex(winID, x0+5, y0+5)
return 1
}
}
if (key = mc_button_post_blind)
{
ImageSearch, x0, y0, mc_wpx_action_area_x1, mc_wpx_action_area_y1, mc_wpx_action_area_x2, mc_wpx_action_area_y2, *10 mc_image_files\mc_wpex_post.bmp
if (x0 > 0)
{
MC_ClickMouse_Wpex(winID, x0+5, y0+5)
return 1
}
ImageSearch, x0, y0, mc_wpx_action_area_x1, mc_wpx_action_area_y1, mc_wpx_action_area_x2, mc_wpx_action_area_y2, *10 mc_image_files\mc_wpex_dead.bmp
if (x0 > 0)
{
MC_ClickMouse_Wpex(winID, x0+5, y0+5)
return 1
}
}
if (key = mc_button_i_am_back)
{
ImageSearch, x0, y0, mc_wpx_action_area_x1, mc_wpx_action_area_y1, mc_wpx_action_area_x2, mc_wpx_action_area_y2, *10 mc_image_files\mc_wpex_back.bmp
if (x0 > 0)
{
MC_ClickMouse_Wpex(winID, x0+5, y0+5)
return 1
}
}
if (key = mc_checkbox_auto_post)
{
if MC_ClickActionButton_Wpex(mc_current_win_id, "THTMLCheckBox4", 3)
return
}
if (key = mc_checkbox_sitout)
{
if MC_ClickActionButton_Wpex(mc_current_win_id, "THTMLCheckBox2", 3)
return
}
return 0
}
;-------------------------------------------------------------------- Partypoker ---------------------------
MC_PTY_ClickActionButton(winID, button, matchMode)
{
SetTitleMatchMode, %matchMode%
ControlGet, result1, Visible, , %button%, ahk_id %winID%
ControlGet, result2, Enabled, , %button%, ahk_id %winID%
If (result1 AND result2)
{
ControlClick, %button%, ahk_id %winID%
return (ErrorLevel = 0)
}
return 0
}
MC_PTY_ClickMouse(winID, x, y)
{
ControlClick, x%x% y%y%, ahk_id %winID%
}
MC_PTY_CheckFold:
MouseGetPos, , , mc_current_win_id
/*
WinGet, mc_lobby_win_id, ID, PartyPoker.com: Poker Lobby ahk_class #32770
if (mc_current_win_id = mc_lobby_win_id)
{
Send {%mc_action_hotkey_check_fold%}
return
}
*/
if (MC_PTY_ClickBeforeAnyAction(mc_current_win_id, "check_fold"))
return
if MC_PTY_ClickActionButton(mc_current_win_id, "Check ", 3) ; Check (advance)
return
if MC_PTY_ClickActionButton(mc_current_win_id, "AfxWnd42u23", 3) ; Check (button)
return
if MC_PTY_ClickActionButton(mc_current_win_id, "AfxWnd42u22", 3) ; Fold (advance)
return
if MC_PTY_ClickActionButton(mc_current_win_id, "AfxWnd42u17", 3) ; Fold (button)
return
if (MC_PTY_ClickAfterAnyAction(mc_current_win_id, "check_fold"))
return
Send {%mc_action_hotkey_check_fold%}
return
MC_PTY_CheckCall:
MouseGetPos, , , mc_current_win_id
/*
WinGet, mc_lobby_win_id, ID, PartyPoker.com: Poker Lobby ahk_class #32770
if (mc_current_win_id = mc_lobby_win_id)
{
Send {%mc_action_hotkey_check_call%}
return
}
*/
if (MC_PTY_ClickBeforeAnyAction(mc_current_win_id, "check_call"))
return
if MC_PTY_ClickActionButton(mc_current_win_id, "Call (", 1) ; Call (advance)
return
if MC_PTY_ClickActionButton(mc_current_win_id, "AfxWnd42u18", 3) ; xxxx (xxxx)
return
if MC_PTY_ClickActionButton(mc_current_win_id, "AfxWnd42u24", 3) ; xxxx (xxxx)
return
if (MC_PTY_ClickAfterAnyAction(mc_current_win_id, "check_call"))
return
Send {%mc_action_hotkey_check_call%}
return
MC_PTY_BetRaise:
MouseGetPos, , , mc_current_win_id
/*
WinGet, mc_lobby_win_id, ID, PartyPoker.com: Poker Lobby ahk_class #32770
if (mc_current_win_id = mc_lobby_win_id)
{
Send {%mc_action_hotkey_bet_raise%}
return
}
*/
if (MC_PTY_ClickBeforeAnyAction(mc_current_win_id, "bet_raise"))
return
if MC_PTY_ClickActionButton(mc_current_win_id, "Bet", 1)
return
if MC_PTY_ClickActionButton(mc_current_win_id, "Raise", 1)
return
if MC_PTY_ClickActionButton(mc_current_win_id, "AfxWnd42u26", 3)
return
if MC_PTY_ClickActionButton(mc_current_win_id, "Complete", 1)
return
if MC_PTY_ClickActionButton(mc_current_win_id, "All-In", 1)
return
if (MC_PTY_ClickAfterAnyAction(mc_current_win_id, "bet_raise"))
return
Send {%mc_action_hotkey_bet_raise%}
return
MC_PTY_ClickBeforeAnyAction(winID, key)
{
global
if (MC_ClickYesOrNo(winID, key, "#32770"))
return 1
if (key = mc_button_sitout)
{
if MC_PTY_ClickActionButton(mc_current_win_id, "Sit Out", 1)
return 1
}
if (key = mc_button_wait_for_bb)
{
if MC_PTY_ClickActionButton(mc_current_win_id, "Wait For BB", 1)
return 1
if MC_PTY_ClickActionButton(mc_current_win_id, "Wait for Big Blind", 1)
return 1
}
if (key = mc_button_post_blind)
{
if MC_PTY_ClickActionButton(mc_current_win_id, "Post BB", 1)
return 1
}
if (key = mc_button_i_am_back)
{
if MC_PTY_ClickActionButton(mc_current_win_id, "I am Back", 1)
return 1
}
return 0
}
MC_PTY_ClickAfterAnyAction(winID, key)
{
global
if (key = mc_checkbox_sitout)
{
if MC_PTY_ClickActionButton(mc_current_win_id, "Deal Me Out", 3)
return 1
}
if (key = mc_checkbox_auto_post)
{
if MC_PTY_ClickActionButton(mc_current_win_id, "Auto Post Blind", 3)
return 1
}
return 0
}
MC_PTY_ClickerLeft:
MC_PTY_ClickerAny("left")
return
MC_PTY_ClickerRight:
MC_PTY_ClickerAny("right")
return
MC_PTY_ClickerAny(dir)
{
local x, y, winID, class
CoordMode, Mouse, Relative
MouseGetPos, x , y , winID, ctrl
WinGetClass, class, ahk_id %winID%
if (class <> "#32770")
{
MC_AbortClicker("left")
return
}
if (mc_clicker_mover = dir)
if (MC_PTY_ClickerCheckMover(winID, class, x, y))
return
MC_AbortClicker("left")
return
}
MC_PTY_ClickerCheckMover(winID, class, x, y)
{
local x1, y1, title
WinGetTitle, title, ahk_id %winID%
if (InStr(title, "PartyPoker.com: Poker Lobby"))
{
boxnum := MC_GetWindowMoverBoxnum("PTY", x, y, "lobby")
if (boxnum > 0)
{
x1 := mc_pty_window_mover_coords_x%boxnum%
y1 := mc_pty_window_mover_coords_y%boxnum%
AF_WinMoveID(winID, x1, y1)
return 1
}
if (boxnum < 0)
msgbox Hide window
}
if (InStr(title, "Good Luck"))
{
boxnum := MC_GetWindowMoverBoxnum("PTY", x, y, "table")
if (boxnum > 0)
{
x1 := mc_pty_window_mover_coords_x%boxnum%
y1 := mc_pty_window_mover_coords_y%boxnum%
AF_WinMoveID(winID, x1, y1)
return 1
}
if (boxnum < 0)
msgbox Hide window
}
return 0
}
;--------------------------------------------------------------- Winamp functions ------------------
MC_WinAmp_NextSong:
Process, Exist, WinAmp.exe
if (ErrorLevel <> 0)
{
Send ^!{F10}
return
}
Send {WheelDown}
return
MC_WinAmp_PrevSong:
Process, Exist, WinAmp.exe
if (ErrorLevel <> 0)
{
Send ^!{F9}
return
}
Send {WheelUp}
return
MC_WinAmp_VolUp:
Process, Exist, WinAmp.exe
if (ErrorLevel <> 0)
{
Send ^!{F12}
Send ^!{F12}
return
}
Send {^!Right}
return
MC_WinAmp_VolDown:
Process, Exist, WinAmp.exe
if (ErrorLevel <> 0)
{
Send ^!{F11}
Send ^!{F11}
return
}
Send {^!Left}
return
;--------------------------------------------------------------- String functions ------------------
AF_TrimWhiteSpace(str)
{
Loop
{
StringLeft, isSpace, str, 1
If isSpace is not space
break
If (isSpace = "")
return
StringTrimLeft, str, str, 1
}
Loop
{
StringRight, isSpace, str, 1
If isSpace is not space
break
If (isSpace = "")
return
StringTrimRight, str, str, 1
}
return (str)
}
;--------------------------------------------------------------- Scriptpad functions ------------------
AF_Scriptpad_ToggleEnabled(prefix, enableText, disableText, byref enabled)
{
if (enabled)
{
enabled := false
%prefix%_scriptpad_command