Thank you for your explanations and your help, it's very kind of you! I think I may be understanding wrong, because I tried both solutions you posted and I can't seem to get them to work - This was the little test I wrote, am I doing something stupid ive just overlooked here?
Lua Code:
frame:RegisterEvent("UNIT_AURA");
local function eventHandler(self, event, ...)
print "test1"
for i=1,40 do
local aura.name, aura.icon, aura.count, aura.type, aura.max_time, aura.end_time, aura.caster, aura.is_stealable = UnitAura("player", i);
if aura.max_time and aura.max_time > 0 then
aura.start_time = aura.end_time - aura.max_time;
elseif aura.end_time and aura.end_time > 0 then
aura.start_time = GetTime();
aura.max_time = aura.end_time - aura.start_time;
else
aura.max_time = nil;
aura.start_time = nil;
aura.end_time = nil;
end
if aura.name == Power Word: Shield then
print "test2"
end
end
end
end