Last active
March 28, 2016 15:54
-
-
Save orlp/5e73a0de32ff56fd856e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Install the Fontin font http://www.exljbris.com/fontin.html. | |
; Edit log_file to your Client.txt path. | |
; Edit overlay_x, overlay_y to fit your desire. Default is right under the timer for 1920x1080. | |
; Your game needs to be in windowed fullscreen mode. | |
log_file = C:\Program Files\Steam\SteamApps\common\Path of Exile\logs\Client.txt | |
overlay_x := 340 | |
overlay_y := 975 | |
; Shouldn't need to edit below this line. | |
filehandle := FileOpen(log_file, "r") | |
if !IsObject(filehandle) { | |
MsgBox Error while opening Path of Exile's Client.txt. | |
} | |
filehandle.seek(0, 2) | |
last_reset := A_TickCount | |
overlay_color = 000000 | |
Gui, Color, %overlay_color% | |
Gui, 1:Margin , 0, 0 | |
Gui, Font, s10 bold, fontin | |
Gui, Add, Text, x0 y0 w100 vClock cc49964 BackgroundTrans, 0:00 | |
Gui +LastFound +AlwaysOnTop +ToolWindow -Border -Caption +E0x20 ; E0x20 is clickthrough | |
WinSet, TransColor, %overlay_color% 255 | |
format_elapsed(time) { | |
seconds := mod(floor(time), 60) | |
if seconds < 10 | |
return floor(time/60) ":0" seconds | |
return floor(time/60) ":" seconds | |
} | |
SetTimer, check_poe_active, 100 | |
SetTimer, read_poe_log, 500 | |
return | |
read_poe_log: | |
loop { | |
line := filehandle.readline() | |
if line { | |
line_parts := StrSplit(line, A_Space) | |
first := line_parts[8] | |
if (line_parts[8] = "Connecting" && line_parts[9] = "to" && line_parts[10] = "instance" && line_parts[11] = "server" && line_parts[12] = "at") { | |
elapsed := (A_TickCount - last_reset) / 1000, seconds | |
last_reset := A_TickCount | |
fmttime := format_elapsed(elapsed) | |
GuiControl,, Clock, %fmttime% | |
} | |
} else break | |
} | |
return | |
check_poe_active: | |
IfWinActive, Path of Exile ahk_class Direct3DWindowClass | |
{ | |
Gui +LastFound +AlwaysOnTop +ToolWindow -Border -Caption +E0x20 ; E0x20 is clickthrough | |
Gui, Show, x%overlay_x% y%overlay_y% h%A_ScreenHeight% w%A_ScreenWidth% NoActivate, PoE Ingame Overlay | |
} else { | |
Gui, Hide | |
} | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment