Quake Live - Items timer

Ask gaming related questions (AHK v1.1 and older)
tsuv86
Posts: 1
Joined: 25 Jun 2016, 04:54

Quake Live - Items timer

25 Jun 2016, 06:00

Hello everyone !
I decided to make an item's timer for the game Quake Live, the concept is pretty simple.
When i press a button appears a counter, when it reaches the 0 play a sound.
It works pretty well but there are problems:
- If you play in full screen counter does not appear, works only in windowed mode
- if you switch with another window, the counter moves around for your screen
- I'd like to have a bar in addition to the counter and also background color for the tooltips

I don't have the knowledge to make a good program with AHK, in fact i have done this one by trying a lot of tutorials and watching other examples.
I think the code is not really clean for this reason and it's possible there are other bugs.

Code: Select all

#NoEnv									; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn									; Enable warnings to assist with detecting common errors.
SendMode Input								; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%					; Ensures a consistent starting directory.



SoundSetWaveVolume, 32						; Announce volume
Soundplay, w.wav



~z::										; Mega countdown
	Start1 := A_TickCount
	SetTimer,TimerMega,10
return



~x::										; Armor countdown
	Start2 := A_TickCount
	SetTimer,TimerArmor,10
return



	~c::									; Power Up countdown
		Start3 := A_TickCount
		SetTimer,TimerPowerUp,10
	return



TimerMega:
	Time1 = 35000
	Elapsed1 := ((Time1-(A_TickCount-Start1))/1000)
	Seconds1 := Round(Elapsed1, 0)
	ToolTip % Seconds1, 750,450,1
	
	If Seconds1 <= 0
	{
		ToolTip,,,,1
		SetTimer,TimerMega,Off
		SoundSetWaveVolume, 25
		Soundplay, m.wav
	}
return



TimerArmor:
	Time2 = 25000
	Elapsed2 := ((Time2-(A_TickCount-Start2))/1000)
	Seconds2 := Round(Elapsed2, 0)
	ToolTip % Seconds2, 850,450,2
	
	If Seconds2 <= 0
	{
		ToolTip,,,,2
		SetTimer,TimerArmor,Off
		SoundSetWaveVolume, 25
		Soundplay, a.wav
	}
return



	TimerPowerUp:
		Time3 = 120000
		Elapsed3 := ((Time3-(A_TickCount-Start3))/1000)
		Seconds3 := Round(Elapsed3, 0)
		ToolTip % Seconds3, 800,400,3
		
		If Seconds3 <= 0
		{			
			ToolTip,,,,3
			SetTimer,TimerPowerUp,Off
			SoundSetWaveVolume, 25
			Soundplay, p.wav
		}
	return



esc:: ExitApp
Screenshot
Image

I hope in the help of some expert to correct and improve.

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 63 guests