I haven't been here since posting the link below in 2014
https://autohotkey.com/board/topic/100171-bf4-script-ifwinactive-battlefield/
Back Again playing Battlefield and thought I would share my first script.
This particular script has some old auto single fire perks as well as some tricky key disables that can interrupt the game if your old and gimpy like me.
The script also uses WinActive which required the Window Spy to figure out.
I will likely update post with improvements later
.
.
Code: Select all
#NoEnv
SendMode Input
SetTitleMatchMode, 1
SetTitleMatchMode, Slow
;================== Functions()
BFV_FullScreen()
{
return WinActive("ahk_class Frostbite")
}
;================== Play and Mapping
#If BFV_FullScreen()
F7::suspend ;== Turn it off if experiencing issues with your changes / additions
$`::return
LWin::Return
;Prone-z when reloading-r
~r::z
;Hold Breath-i when zoom-RButton
~RButton::i
;================== Lean While Zooming
; ~a::[
; ~d::]
; --> Replaced with mapping both functions to a [ and d ] respectively --> IN GAME
; it just seems to work better for me , ill post a settings pic if you ask
; Caps Lock Switched Single Fire repeater
; This is excellent for my old crusty carpenter fingers. When Caps lock is on , this will re-Press the mouse if it is held
If BFV_FullScreen()
~LButton::
GetKeyState, state, capslock, T
if state = D
{
Loop
{
GetKeyState, LButtonState, LButton, P
if LButtonState = U
{
break
}
MouseClick, left,,, 1, 0, D
Sleep 66 ; EDIT This delay as desired
MouseClick, left,,, 1, 0, U
Sleep 124 ; EDIT This delay as desired
}
}
return
Regards,
-=GK=-