I have a similar code that functions, so I copied the frame, setscript and registerevent codes from the working addons, yet for somereason the very first print statement wont run on this code, any ideas? The end goal of this addon will be to track the Spirit Shift auras on all members of the raid and show on my screen, the damage build up for each aura.
Code:
local f = CreateFrame("Frame")
f:SetScript("OnEvent", function(...)
print("Start")
local group = UnitInRaid("player") --if nil party , if >0 raid
print("Group")
local size = GetNumGroupMembers() --nil solo, else party or raid
print("size")
local groupType = "none"
if size == nil then groupType = "solo"
elseif (group>0 and size<=5) then groupType = "party"
elseif (group>0 and size>5) then groupType = "raid"
else print("You done screwed up the groupType")
end
print("Check1: "..groupType) --Check
capList = {}
if (groupType == "party" or groupType == "raid") then CapList() end
function CapList()
for i=1, size do
local member = groupType..i local m, _ = GetInventoryItemID(member, INVSLOT_TRINKET1); local n,_ = GetInventoryItemID(member, INVSLOT_TRINKET2)
if m or n =="124225" then
table.insert(capList, member)
end
end
end
for i in capList do print("Check2: "..i) end
for i in capList do local n, _, _, _, _, _, _, _, _, _, _, _, _,_,t = UnitBuff(i, "Spirit Shift") print n, t end
end)
f:RegisterEvent("UNIT_AURA");