This plugin is supposed to list buff spells you cast on yourself and hightlight them green if they are active and when they wear off the background turns darkred. With 1 spell this works fine, but having trouble doing it with more spells.
current code is here.
The armor code by itself works fine, I but when you cast bless it sometimes over writes armor and vice versa when you refresh the spells after they expire. any help is appreciated.
I think the main issue is in the array portion.
current code is here.
require "InfoBox"
box = InfoBox:New("ARMOR")
buffs = box:AddBar("Buff Tracker")
box.Bars[1].captionPlacement = 4
box:CaptionPlacement()
box:Update()
function yes_armor ()
if has_armor == true then
box:RemoveBar(2)
armor = box:AddBar("Armor", 100, "darkred")
box.Bars[2].captionPlacement = 4
box:CaptionPlacement()
has_armor = false
box:Update()
elseif has_armor == false then
box:RemoveBar(2)
armor = box:AddBar("Armor", 100, "darkgreen")
box.Bars[2].captionPlacement = 4
box:CaptionPlacement()
has_armor = true
box:Update()
else
armor = box:AddBar("Armor", 100, "darkgreen")
box.Bars[2].captionPlacement = 4
box:CaptionPlacement()
has_armor = true
box:Update()
end
end
function yes_ bless ()
if has_bless == true then
box:RemoveBar(3)
bless = box:AddBar("Bless", 100, "darkred")
box.Bars[3].captionPlacement = 4
box:CaptionPlacement()
has_bless = false
box:Update()
elseif has_bless == false then
box:RemoveBar(3)
bless = box:AddBar("Bless", 100, "darkgreen")
box.Bars[3].captionPlacement = 4
box:CaptionPlacement()
has_bless = true;
box:Update()
else
bless = box:AddBar("Bless", 100, "darkgreen")
box.Bars[3].captionPlacement = 4
box:CaptionPlacement()
has_bless = true
box:Update()
end
end
The armor code by itself works fine, I but when you cast bless it sometimes over writes armor and vice versa when you refresh the spells after they expire. any help is appreciated.
I think the main issue is in the array portion.