#NoEnv #SingleInstance Force #MaxHotkeysPerInterval 1000 #MaxThreadsPerHotkey 1 #HotkeyModifierTimeout -1 #KeyHistory 50 #persistent SetWorkingDir %A_ScriptDir% SetTitleMatchMode, 3 global game := "Diablo II" global autocasting := false SetTimer, Aura, 5000 Loop { Suspend % WinActive(game) ? "Off" : "On" Sleep, 1000 } `::autocasting ^= WinActive(game) Aura() { if (WinActive(game) and autocasting) { Send {F1} Click, Right Send {F2} } }