livinthelife wrote:
Do you see anything that is a red flagt
I could suggest just a few improvements. First of all, you want to add the following portions of code in the auto-execute section.
Code:
1counter=0
Return
; ...
21counter=0
Return
So the beginning of your script should look like this:
Code:
#NoEnv
;SendMode Input ; Not necessary because your script doesn't use variants of 'Send', nor 'Click' nor 'MouseMove/Click/Drag'
;SetWorkingDir %A_ScriptDir% ; Not necessary because your script doesn't refer to any file names
SetTitleMatchMode, 3
#WinActivateForce
;#Persistent ; Not necessary because hotkey definitions prevent the script from exiting
1counter=0 ; Add initialization here, otherwise these lines will not be executed
21counter=0 ; .
Return ; Auto-execution ends here. Having 'return' line is not absolutely necessary in this case
; because the first hotkey definition (F1::) would also end the auto-execute section.
Other thing you could do to make your script more compact, is to use "Last Found Window". I've also commented a few more things:
Code:
;starting stuff, not sure if all 6 of these are needed but it works so.
#NoEnv
SetTitleMatchMode, 3
#WinActivateForce
;get unique window id of window to be controlled by arrow keys
F1:: WinGet, 1winTitle, ID, A ; As long as you have only one line, you can put it right after the hotkey and leave 'return' away.
;cycles through minbet, pot bet or half pot bet, All in or maxbet
Up::
WinActivate, ahk_id %1winTitle%
WinWaitActive, ahk_id %1winTitle%, , 1 ; Last Found Window updated here
1counter++
If(1counter=1)
{ ControlClick, FTCSkinButton23 ; ahk_id not needed anymore, the current subroutine will refer to Last Found Window from now on
}
Else If(1counter=2)
{ ControlClick, FTCSkinButton25 ; .
}
Else If(1counter=3)
{ ControlClick, FTCSkinButton24 ; .
1counter=0
}
Sleep,200 ; Are these sleeps necessary? Do they improve reliability?
Return
;fold check or checkfold
Left::
WinActivate, ahk_id %1winTitle%
WinWaitActive, ahk_id %1winTitle%, , 1 ; Last Found Window updated
ControlClick, FTCSkinButton11
ControlClick, FTCSkinButton29
Sleep,200
Return
;call or check in preflop preact
Down::
WinActivate, ahk_id %1winTitle%
WinWaitActive, ahk_id %1winTitle%, , 1 ; Etc.
ControlClick, FTCSkinButton12
ControlClick, FTCSkinButton31
Sleep,200
Return
;bet
Right::
WinActivate, ahk_id %1winTitle%
WinWaitActive, ahk_id %1winTitle%, , 1
ControlClick, FTCSkinButton13
Sleep,200
Return
;;get unique window id of window to be controlled by numpadkeys
F2:: WinGet, 21winTitle, ID, A
NumpadAdd::
WinActivate, ahk_id %21winTitle%
WinWaitActive, ahk_id %21winTitle%, , 1
21counter++
If(21counter=1)
{ ControlClick, FTCSkinButton23
}
Else If(21counter=2)
{ ControlClick, FTCSkinButton25
}
Else If(21counter=3)
{ ControlClick, FTCSkinButton24
21counter=0
}
Sleep,200
Return
NumpadEnd::
WinActivate, ahk_id %21winTitle%
WinWaitActive, ahk_id %21winTitle%, , 1
ControlClick, FTCSkinButton11
ControlClick, FTCSkinButton29
Sleep,200
Return
NumpadDown::
WinActivate, ahk_id %21winTitle%
WinWaitActive, ahk_id %21winTitle%, , 1
ControlClick, FTCSkinButton12
ControlClick, FTCSkinButton31
Sleep,200
Return
NumpadPgDn::
WinActivate, ahk_id %21winTitle%
WinWaitActive, ahk_id %21winTitle%, , 1
ControlClick, FTCSkinButton13
Sleep,200
Return