-
Member
POEHud Starter/Restarter using AHK
With the new bugs and having to restart it I got tired of having to close it out then opening it up again and again for every map. So I made a simple autohotkey script to run and or close and rerun it.
Hows to get it.
First off you need autohotkey installed. Get that by googling autohotkey
Once installed. Go to the folder where poehud exe is.
Right click and hit new then Autohotkey script.
Once made rename it to what ever you want then right click the script file and hit edit script. It should open up in notepad.
Paste the following script in to the bottom of the script file.
Code:
F7::
Loop, %A_ScriptDir%\*.exe
{
Start:
Process, Exist, %A_LoopFileName%
{
If ! errorLevel
{
soundbeep
sleep 30
soundbeep
IfExist, %A_Loopfilefullpath%
Run,%A_Loopfilefullpath%
Break
return
}
else
{
soundbeep
Process, Close, %A_LoopFileName%
Process, WaitClose, %A_LoopFileName%
;sleep 2000
Goto, Start
}
}
}
return
Once you paste it just file save and close out notepad.
Now to run it right click the script and run as administrator.
You have to run as admin. If you don't you will get the yes or no prompt every time you hit the hotkey.
Once it is running you will see a H on the taskbar icons on the right next to your clock.
Just go in game and hit F7 and it will close it and open it up. If one is not running it will start it up.
When ever poehud stops working just hit F7 If you wish to change the F7hotkey juts edit the script not hard to figure out.
Any questions or if I should change any thing just ask.
Edit: I modified the code for it to be faster. The sleep 2000 was just to long for my taste. I just added a closewait so it will try and start it back up right after it is fully closed rather then sleeping 2000ms. Added soundbeep 1 for close 2 for on this way you know you hit the hotkey.
Last edited by Nipper; 01-30-2018 at 12:59 PM.
-
Post Thanks / Like - 3 Thanks
-
Member
Nice QoL change for now! Thanks
-
Really rather than fixing it, we are making ahk
-
Member
I don't know C# well. Other wise I would have given it a go to fix it. AHK is vary simple not much thinking involved. I also like it as a start up rather then using the .bat or the .symlink. Lets me update plugins or reload the whole thing if something goes wrong with a plugin and not just the whole thing stopping.
-
Knight
I almost forgot ahk works like .bat too.
You can also start all your .EXE like map hack. mercury and etc in 1script now.
example "run, maphack.exe"
No more hassle of opening alot of programs now
thanks for reminding bro
-
Member
Changed the script up a tad. removed the sleep 2000ms and switched it with a closewait this way it is a tad faster.
-
Member
LOLED @ zaafar's comment!! But mister,me no understand code..Ahk and batch files yes,as far as IRC scripting,yes..Do not bring up the C or F words to me (Class,Function) !!
That said,nice and easy,would you mind if i mention the TradeMacro UserScript folder (That is ofc IF someone is using it) that will automatically load any .ahk files in it to TradeMaro..Just for the sake of not running 5 different .exe for 1 game :P
Thanks for the option
-
Member
Originally Posted by
Kaiyum
LOLED @ zaafar's comment!! But mister,me no understand code..Ahk and batch files yes,as far as IRC scripting,yes..Do not bring up the C or F words to me (Class,Function) !!
That said,nice and easy,would you mind if i mention the TradeMacro UserScript folder (That is ofc IF someone is using it) that will automatically load any .ahk files in it to TradeMaro..Just for the sake of not running 5 different .exe for 1 game :P
Thanks for the option

lol. But good Idea on that using trademacro that it has the loading of other ahk.
Edit: nm bad Idea. I just remembered that you would need to change the dir that it scans for the exe file as poehuds exe randomizes its name everyonce few times it is ran. It needs still be located in the same DIR as poehud exe to work correctly.
Last edited by Nipper; 01-31-2018 at 05:56 PM.
-
Originally Posted by
Nipper
lol. But good Idea on that using trademacro that it has the loading of other ahk.
Edit: nm bad Idea. I just remembered that you would need to change the dir that it scans for the exe file as poehuds exe randomizes its name everyonce few times it is ran. It needs still be located in the same DIR as poehud exe to work correctly.
You can just search the entire folder where poehud exe is and get a list of exe, clear out the symlink one and get the name of the poehud exe as it SHOULD be the only one there, its posted on the first page somewhere here.
-
Member
Originally Posted by
Sithylis
You can just search the entire folder where poehud exe is and get a list of exe, clear out the symlink one and get the name of the poehud exe as it SHOULD be the only one there, its posted on the first page somewhere here.
Just put this in AdditionalMacros.ahk
AM_PoeNoCrash_HKey:
KeyWait, Ctrl ; Restarts PoEHUD using Crashno.bat
KeyWait, Alt
Run "C:\PoE_Utils\PoEHUD-x64\Release\crashno.bat"
Return
Add this to AdditionalMacros.ini (In POE-TradeMacro dir,NOT Documents/POE-TradeMacro)
[PoeNoCrash]
; Restarts PoEHUD using Crashno.bat
Description=Restarts PoEHUD using Crashno.bat (Must be in correct folder /Release in your PoEHUD directory).
State=1
Hotkeys=^!EnterHotkeys=^!Enter
crashno.bat (Place in YOUR_PATH\PoEHUD-x64\Release\)
@echo off
cd
YOUR_PATH\PoEHUD-x64\Release\
for /f "delims=" %%a in ('dir /b *.exe') do set exedie=%%a
taskkill /pid %exedie% /f
cd
YOUR_PATH\PoEHUD-x64\Release\
for /f "delims=" %%b in ('dir /b *.exe') do set exeLcn=%%b
start %exeLcn%
-
Member
Ahh..been spending so much time doing things for PoE's executable/s and so much less time doing things for my PoE toon...
In addition to the crashno.bat and ahk
Adds a transparent countdown to the restart process...
Code:
Run "C:\PoE_Utils\PoEHUD-x64\Release\crashno.bat" REPLACE C:\PoE_Utils
Gui +LastFound +AlwaysOnTop -Caption +ToolWindow
Gui Color, EEAA99
Gui Font, s228
Gui Add, Text, X20 Y20 W50 Vdisp Cred
WinSet TransColor, EEAA99
Gui Show, NoActivate, Display
secsLeft = 5
SetTimer, ShowTimer, -1000
Gosub ShowTimer
Return
ShowTimer:
secsLeft--
IfEqual, secsLeft, 0
{
SetTimer ShowTimer, Off
GuiControl,, disp ;clear the last "1"
Gui, Destroy
; Now may click the window's button
WinActivate, Path of Exile
Sleep 200
Click, X720 Y890, Path of Exile
ToolTip, Done,
SetTimer, RemoveToolTip, 800
return
RemoveToolTip:
SetTimer, RemoveToolTip, Off
ToolTip
return
}
Else
{
Sleep, 200
GuiControl, Text, disp, %secsLeft%
SetTimer, ShowTimer, -1000
}
Return
Last edited by Kaiyum; 02-01-2018 at 05:54 PM.