Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; PoE-PowerPlan
- #SingleInstance force
- #NoEnv
- #Persistent
- SetWorkingDir, %A_ScriptDir%
- ; Power Plan GUID's can be found with Command prompt: powercfg /list
- ; This Power Plan will be activated when PoE window is active
- global GUID_POE_DCS := ""
- ; This Power Plan will be activated when PoE window is not active or PoE not running
- global GUID_DEFAULT := "8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c" ; High performance default Power Plan
- global PoEWindow
- GroupAdd, PoEWindow, Path of Exile ahk_class POEWindowClass ahk_exe PathOfExile.exe
- GroupAdd, PoEWindow, Path of Exile ahk_class POEWindowClass ahk_exe PathOfExile_KG.exe
- GroupAdd, PoEWindow, Path of Exile ahk_class POEWindowClass ahk_exe PathOfExile_EGS.exe
- GroupAdd, PoEWindow, Path of Exile ahk_class POEWindowClass ahk_exe PathOfExileEGS.exe
- GroupAdd, PoEWindow, Path of Exile ahk_class POEWindowClass ahk_exe PathOfExileSteam.exe
- GroupAdd, PoEWindow, Path of Exile ahk_class POEWindowClass ahk_exe PathOfExile_x64.exe
- GroupAdd, PoEWindow, Path of Exile ahk_class POEWindowClass ahk_exe PathOfExile_x64_KG.exe
- GroupAdd, PoEWindow, Path of Exile ahk_class POEWindowClass ahk_exe PathOfExile_x64EGS.exe
- GroupAdd, PoEWindow, Path of Exile ahk_class POEWindowClass ahk_exe PathOfExilex64EGS.exe
- GroupAdd, PoEWindow, Path of Exile ahk_class POEWindowClass ahk_exe PathOfExile_x64Steam.exe
- global PoEActive := 0
- OnExit("PPExit")
- SetTimer, CheckPoEActive, 2000, -100
- CheckPoEActive()
- {
- if WinActive("ahk_group PoEWindow")
- {
- if (PoEActive = 0)
- {
- PoEActive := 1
- PPSetActive(GUID_POE_DCS)
- }
- }
- else
- {
- if (PoEActive = 1)
- {
- PoEActive := 0
- PPSetActive(GUID_DEFAULT)
- }
- }
- }
- PPSetActive(PPGUID)
- {
- if StrLen(PPGUID)
- Run, powercfg /setactive %PPGUID%, , Hide
- }
- PPExit(ExitReason, ExitCode)
- {
- PPSetActive(GUID_DEFAULT)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement