#SingleInstance,Force
#MaxThreadsPerHotkey 1
#MaxThreads 200
Process, Priority,, High
SetBatchLines -1
SendMode Input
SetTitleMatchMode 3 ; Look for exact match to activate hotkeys in IfWinActive
; Hook dll RegisterWindowMessage
Gui +LastFound
hWnd := WinExist()
DllCall( "RegisterShellHookWindow", UInt,Hwnd )
MsgNum := DllCall( "RegisterWindowMessage", Str,"SHELLHOOK" )
OnMessage( MsgNum, "ShellMessage" )
return
; END Auto Execute Section
; Reset alt status on active window change (for those alt+tabs)
ShellMessage( wParam,lParam )
{
;WinGetTitle, title, ahk_id %lParam%
if ((wParam=4) or (wParam=32772)) { ;HSHELL_WINDOWACTIVATED or HSHELL_RUDEAPPACTIVATED
Suspend, Off
}
}
; Hotkeys for game
#IfWinActive, Blade & Soul
{
*~Alt::
Suspend, On
return
*Alt up::
Suspend, Off
return
LButton::
While Getkeystate("LButton","p")
{
sleep, 100
send {f down}
send {f up}
sleep, 100
send {r down}
send {r up}
sleep, 200
send {r down}
send {r up}
sleep, 180
send {t down}
send {t up}
send {f down}
send {f up}
}
return
}