Hello, I need some help. This code doesn't work. As far as what it's supposed to do that is documented function by function below, as well as a general overview in the final comment. Please help me fix this. This is my first addon I'm going to see through to the end, as I scrapped my last one due to it being too advanced.
Code:
Lua Code:
--Check if right alt key is down. If true returns 1.
local function altDown()
local isDown = IsRightAltKeyDown()
return isDown
end
--Get current health
local function getHealth()
local cHealth = UnitHealth("player")
return cHealth
end
--Get max health
local function getMHealth()
local mHealth = UnitMaxHealth("player")
return mHealth
end
--All functions have bee declared
--If the function altDown returns 1, say current health over max health. Else, end.
if altDown() == 1
then SendChatMessage(getHealth() .. "/" .. getMHealth())
else
end
--Purpose of the addon is to say "health/max" in /say chat when you press right alt.
Thanks!