#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#SingleInstance force
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
SetTitleMatchMode 3
SetTimer, oosLoop, 10000
SetKeyDelay, 0
oosLoop:
IfWinActive, Path of Exile ahk_class Direct3DWindowClass
Send, {Enter}/oos{Enter}
return
SetTimer process_watcher, 2000 ; check every 2 seconds
#IfWinActive, Path of Exile ahk_class Direct3DWindowClass
process_watcher:
Process Exist, Client.exe ; check to see if PoE is still open
If ErrorLevel = 0
Exitapp ; if it's closed, exit the .ahk file
F5::Pause