+ Reply to Thread
Results 1 to 2 of 2

Thread: Inspect.Quest.Detail

  1. #1
    Soulwalker
    Join Date
    Jun 2011
    Posts
    3

    Default Inspect.Quest.Detail

    Hey there guys, I'm currently working on an addon that would register - and save in a text field - all quest accepts, Objective Updates and Quest Completes. However I am running into an issue with Inspect.Quest.Detail and can't seem to figure out how to use it properly.

    Here's a snippet.

    function CalliannGuides:questAcceptEvent(_, quests)

    local NPC = Inspect.Unit.Detail("player.target")
    local msg = Inspect.Quest.Detail(quests)

    if NPC ~= nil then
    if msg ~= nil then
    Recorder:SetText("A" .. msg.name .. "| |QID|" .. msg.id .. "| |N|" .. msg.objective .. "| |NPC|" .. NPC.name .. "| |NPCID|" .. NPC.id .. "|")
    else
    Recorder:SetText("A" .. msg.name .. "| |QID|" .. msg.id .. "| |N|" .. "| |NPC|" .. NPC.name .. "| |NPCID|" .. NPC.id .. "|")
    end
    end
    end
    I can get the NPC Name and ID to register properly with only

    function CalliannGuides:questAcceptEvent(_, quests)

    local NPC = Inspect.Unit.Detail("player.target")

    if NPC ~= nil then
    Recorder:SetText("|NPC|" .. NPC.name .. "| |NPCID|" .. NPC.id .. "|")
    end
    end
    Here is a full copy of the code:

    CalliannGuides = {}
    NPC = {}
    msg = {}
    ZONE = {}

    local context = UI.CreateContext("CalliannGuidesContext")
    local CGVWindow = UI.CreateFrame("SimpleWindow", "CGVCGVWindow", context)
    local Recorder = UI.CreateFrame("RiftTextfield", "CGVRecorder", CGVWindow)
    local close = UI.CreateFrame("RiftButton", "", CGVWindow)

    close:SetSkin("close")
    close:SetPoint("TOPRIGHT", CGVWindow, "TOPRIGHT", -8, 16)
    close:EventAttach(Event.UI.Button.Left.Press, function() CGVWindow:SetVisible(false) end, "")

    CGVWindow:SetVisible(false)

    CGVWindow:SetWidth(840)
    CGVWindow:SetHeight(600)
    CGVWindow:SetPoint("TOPLEFT", UIParent, "TOPLEFT", 100, 100)
    CGVWindow:SetTitle("Callian Guides Recorder")
    CGVWindow:SetLayer(0)
    CGVWindow:SetAlpha(0.8)
    CGVWindow:SetBackgroundColor(0,0,0,0)


    Recorder:SetVisible(true)
    Recorder:SetWidth(740)
    Recorder:SetHeight(400)
    Recorder:SetPoint("TOPLEFT", CGVWindow, "TOPLEFT", 50, 125)
    Recorder:SetLayer(1)
    Recorder:SetAlpha(0.95)
    Recorder:SetBackgroundColor(0,0,0,20)


    function CalliannGuides:questAcceptEvent(_, quests)

    local NPC = Inspect.Unit.Detail("player.target")
    local msg = Inspect.Quest.Detail(quests)

    if NPC ~= nil then
    if msg ~= nil then
    Recorder:SetText("A" .. msg.name .. "| |QID|" .. msg.id .. "| |N|" .. msg.objective .. "| |NPC|" .. NPC.name .. "| |NPCID|" .. NPC.id .. "|")
    else
    Recorder:SetText("A" .. msg.name .. "| |QID|" .. msg.id .. "| |N|" .. "| |NPC|" .. NPC.name .. "| |NPCID|" .. NPC.id .. "|")
    end
    end



    end

    Command.Event.Attach(Event.Quest.Accept, CalliannGuides.questAcceptEvent, "QuestAccept")



    local function showCGV()
    if CGVWindow:GetVisible() == true then
    CGVWindow:SetVisible(false)
    else
    CGVWindow:SetVisible(true)
    end
    end


    table.insert(Command.Slash.Register("cgv"), {showCGV, "CalliannGuides", "Slash command"})

  2. #2
    Shield of Telara Adelea's Avatar
    Join Date
    Mar 2011
    Posts
    734

    Default

    Does defining your event function like this work?

    Code:
    function CalliannGuides.questAcceptEvent(_, quests)
    http://forums.riftgame.com/image.php?type=sigpic&userid=125779&dateline=13553  38065

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts