Hi, since there are a few private coders here i want to share some of my work and in best case, get some useful informations back.
Lets start with my latest development:
Check if Target is inFight - Code:LUA - Class:Hunter
Code:
function EnemyIsAlreadyInfight()
local affectingCombat = UnitAffectingCombat("target");
if affectingCombat == true then
--If Enemy is already Infight, turn Pixel red
NewAddon.Frame_EnemyIsAlreadyInfight.texture:SetColorTexture(1,0,0)
--Check if he might be infight with me or my pet
if ( UnitIsUnit("targettarget", "player") ) then
NewAddon.Frame_EnemyIsAlreadyInfight.texture:SetColorTexture(0,1,0)
end;
if ( UnitIsUnit("targettarget", "pet") ) then
NewAddon.Frame_EnemyIsAlreadyInfight.texture:SetColorTexture(0,1,0)
end;
else
--not inFight
NewAddon.Frame_EnemyIsAlreadyInfight.texture:SetColorTexture(0,1,0)
end
end
Check if the Mob is Skinnable - Code:LUA - Class: Every
I really got mad on this but the solution was simple. Already implemented ocr reading but got this one.
Code:
function isSkinnable()
local isDead = UnitIsDead("mouseover")
local count = GameTooltip:NumLines();
if count == 3 and isDead == true then
NewAddon.Frame_IsSkinnable.texture:SetColorTexture(0,1,0)
else
NewAddon.Frame_IsSkinnable.texture:SetColorTexture(1,0,0)
end
end
Check if you are drowning - Code:LUA - Class: Every
Code:
function breath()
local value = GetMirrorTimerProgress("BREATH")
local seconds = value/1000
if seconds < 30 then
NewAddon.Frame_Breath.texture:SetColorTexture(1, 0, 0, alphaColor)
else
NewAddon.Frame_Breath.texture:SetColorTexture(0, 1, 0, alphaColor)
end
end
If someone is intersted in more details, PM me. Please note i will not guide how to code more, just exchange knowledge and talk about improofements or why my code sucks
Im not really into code formatting, so maybe someone knows a good structure for this kind of collection?