OK so I've been trying to figure out why this add-on isn't working for the past few weeks and am just now getting back to post something in the comments. I downloaded and installed the add-on correctly, it appears in the add-on tab in the game, but the darn thing just wont work. It doesn't display any message when I'm in combat or not or if I have a shield up or not. I tried comparing this to AspectWatch (which is the only thing I can think of that is similar in function) but I don't honestly know much about lua code to be able to figure out what's wrong . . . can you take a look and see what's up? I appreciate the help.
(copied and pasted from the castashield.lua file in my folder exactly as it appears)
-- CastAShield
-- By jhaquo
-- Version .91
function CastAShield_show()
local playerclass = UnitClass("player");
if (playerclass ~= "Shaman") then
DisableAddOn("CastAShield");
else
local i;
local buffs = {};
local j = 0;
local buff;
local shielded = 0;
local name, rank;
-- list buffs
for i=1, 16, 1 do
name, rank = UnitAura("player", i, "HELPFUL");
if (name == nil) then
else
buffs[i] = name;
j = j + 1;
end
end
-- check buffs
for i=1, j, 1 do
Aura_On = strfind(buffs[i], "Shield");
if (Aura_On == nil) then
else
shielded = Aura_On;
end
end
-- display msg
if (shielded == 0) and InCombatLockdown() then
UIErrorsFrame:AddMessage("Recast a shield.", 0.0, 0.0, 1.0, 1.0, 5);
end