I'm trying to make a script which display a countdown overlay when I press my potion button.
It works fine outside of the game, it even works on the menu screen. But ingame the script can't catch my input, I don't know why.
I'm playing Windowed mode.
Here's the code :
; https://autohotkey.com/board/topic/1815 ... ding-time/
;On-screen display (OSD)
CustomColor = 99AA55
Gui +LastFound +AlwaysOnTop -Caption +ToolWindow
Gui, Color, %CustomColor%
Gui, Font, s32 ; Set a large font size (32-point).
Gui, Add, Text, vMyText cBlue, 00
WinSet, TransColor, %CustomColor%
Gui, Show, x0 y80 NoActivate
return
t:: ; hotkey t will start or reset counting
counter:=0
SetTimer, UpdateOSD, -10 ; to update immediately
SetTimer, UpdateOSD, 1000
return
UpdateOSD:
counter++
time_display:=70-counter
if (time_display=0)
SetTimer, UpdateOSD, off
GuiControl,, MyText, %time_display%
return
esc::exitapp
I'm sure people tried messing around with Autohotkey in the forum. I would be grateful if anyone can provide assistance to make it work !
Cheers
P.S.: you need to make an executable of the script (right click, compile) and run the .exe as admin, otherwise it won't work, even on the title screen.