Friday, August 12, 2011

ahk poker script

In those times when I am not playing poker, i tweak some of the tools that I use. Here's the latest update on my ahk script--

#/::Pause ;-- will pause the whole script/red on system tray.
; to toggle back on, use...

!/::Reload ; alt+period hotkey to reload this script

; capslock into control key--for use with firefox pentadactyl
SetCapsLockState, AlwaysOff
Capslock::
Send {Control Down}
Sleep 500
Send {Control Up}
Return

; Run SnippingTool
;PRINTSCREEN
;Run C:\ProgramData\Microsoft\Windows\Start_Menu\Programs\Accessories\Snipping_Tool
;return TODO how to run path?

^F7:: ; launches pokerstars, Tableninja, joy2key and HM one after the other.
; open joy2key
;Send {LWin Down}
;Sleep 100
;Send {LWin Up}
Send {LWin}
Sleep 800
Send joytokey
Sleep 100
Send {Enter}
Sleep 2000

; runs pokerstars up to enter pin
Run E:\Program Files\PokerStars\PokerStars.exe
WinWaitActive PokerStars Lobby
{
    Send ^l ; ctrl L to log-in/enter password
    Sleep 800
    Send "MyPassword"{ENTER}
    Sleep 2000
}

; runs HM
Run E:\Program Files\HEM\Holdem Manager\HoldemManager.exe
Sleep 4000

; run HUD
Send #r
Sleep 100
Send E:\Program Files\HEM\Holdem Manager\HMHud.exe
Sleep 1000
Send {Enter}
Sleep 1000

; runs tableninja
Run E:\Program Files\TableNinja\TableNinja.exe
Sleep 100
Return

^0:: ; close this table
Click 954, 9
Sleep 200
SendInput {Enter}
Return

; hotkey script to close repeat tables
;+!r
;Send {Escape}
;Sleep 100
;Click 913, 49
;Return

^9:: ; pause all tables
Click 429, 94
Sleep 100
Click 463, 146
Return

^F8:: ; go to lobby to close all tables
WinActivate, PokerStars Lobby
Click 998, 18
Sleep 500
SendInput {Enter}
Return

; -- daJoinT. To auto join tables in pokerstars --
!.::
Loop
    {
    Random, joinT, 1, 2
    If joinT = 1
        {
        ;[CLASS:PokerStarsListClass; INSTANCE:1]
        WinActivate, PokerStars Lobby - Logged in as Now Open ahk_class #32770
        ;WinActivate PokerStarsListClass1
        Click 626 312
        Sleep 100
        Send {PgUp}
        Sleep 1000
        ;TODO ControlClick ("PokerStars Lobby", "", "[CLASS:PokerStarsButtonClass; INSTANCE:22]") test/check parameters. This opens table, not join waitlist.
        Send w
        Sleep 19000
        }
    else
        {
        ;WinActivate [TITLE: PokerStars Lobby; CLASS: PokerStarsListClass; INSTANCE: 1]
        WinActivate, PokerStars Lobby - Logged in as Now Open ahk_class #32770
        Click 626 312
        Sleep 100
        Send {PgDn}
        Sleep 1000
        Send w
        Sleep 19000
        }
    }
Return

; PlayNow! - initial random table opener
!+l::
Loop
    {
    Random, joinT, 1, 2
    If joinT = 1
        {
        ;[CLASS:PokerStarsListClass; INSTANCE:1]
        WinActivate, PokerStars Lobby - Logged in as Now Open ahk_class #32770
        ;WinActivate PokerStarsListClass1
        Click 616 432
        Sleep 100
        Send {PgUp}
        Sleep 1000
        ;TODO ControlClick ("PokerStars Lobby", "", "[CLASS:PokerStarsButtonClass; INSTANCE:22]") test/check parameters. This opens table, not join waitlist.
        Send w
        Sleep 1900
        }
    else
        {
        ;WinActivate [TITLE: PokerStars Lobby; CLASS: PokerStarsListClass; INSTANCE: 1]
        WinActivate, PokerStars Lobby - Logged in as Now Open ahk_class #32770
        Click 616 432
        Sleep 100
        Send {PgDn}
        Sleep 1000
        Send w
        Sleep 1900
        }
    }
Return

No comments:

Post a Comment