View Single Post
Unread 01-16-13, 11:29 AM   #2
Toranis
A Murloc Raider
Join Date: Apr 2006
Posts: 5
I've almost duplicated the following code:
Code:
local inspectTainted, inpectvalid

hooksecurefunc("NotifyInspect", function() inspectTainted = true end)

local finsp = CreateFrame("frame")
finsp:SetScript("OnEvent", function(self2)
    self2:UnregisterEvent("INSPECT_TALENT_READY")
	inspectvalid = false
    if inspectTainted then
        if CanInspect(unitID) then -- in this case we could just call DoInspect (if it was higher in the file), but i'll write it out for the example
            self2:RegisterEvent("INSPECT_TALENT_READY")
            NotifyInspect(unitID)
            inspectTainted = false
			print("Trigger Hit")
        end
    else
        local nameTalent = GetTalentInfo(1, 1, true)
        DEFAULT_CHAT_FRAME:AddMessage(nameTalent)
    end
end)

local function DoInspect(UnitID)
    if CanInspect(UnitID) then
        NotifyInspect(UnitID)
        inspectTainted = false	        
        finsp:RegisterEvent("INSPECT_TALENT_READY")
    end
end
I have a call into DoInspect() with a UnitID of target (could be target or party/raid member) and the inspect is failing to return anything. For some reason I'm not getting the print("Trigger Hit") and the inspect isn't occuring. Any ideas on what I'm missing?
Toranis is offline   Reply With Quote