From 73cd232f7d9d11d86931dda45fe1f3bf8b4b1a1d Mon Sep 17 00:00:00 2001 From: Alex Shubert Date: Mon, 12 Mar 2012 12:21:54 +0400 Subject: [PATCH] fixed kraken quest --- AutoTurnIn.lua | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/AutoTurnIn.lua b/AutoTurnIn.lua index 27365ed..9c9223c 100644 --- a/AutoTurnIn.lua +++ b/AutoTurnIn.lua @@ -27,10 +27,11 @@ function AutoTurnIn:OnEnable() end function AutoTurnIn:RegisterGossipEvents() - self:RegisterEvent("QUEST_PROGRESS") - self:RegisterEvent("QUEST_COMPLETE") + self:RegisterEvent("QUEST_GREETING") self:RegisterEvent("GOSSIP_SHOW") self:RegisterEvent("QUEST_DETAIL") + self:RegisterEvent("QUEST_PROGRESS") + self:RegisterEvent("QUEST_COMPLETE") end function AutoTurnIn:OnDisable() @@ -88,6 +89,15 @@ local function GetItemAmount(isCurrency, item) return amount and amount or 0 end +-- OldGossip interaction system. Burn in hell See http://wowprogramming.com/docs/events/QUEST_GREETING +function AutoTurnIn:QUEST_GREETING() + for index=1, GetNumActiveQuests() do + local quest, completed = GetActiveTitle(index) + if (AutoTurnInCharacterDB.all or L.quests[quest]) and (completed) then + SelectActiveQuest(index) + end + end +end -- (gaq[i+3]) equals "1" if quest is complete, "nil" otherwise -- why not gaq={GetGossipAvailableQuests()}? Well, tables in lua are truncated for values with ending `nil`. So: '#' for {1,nil, "b", nil} returns 1 @@ -97,7 +107,6 @@ function AutoTurnIn:GOSSIP_SHOW() StaticPopup1Button1:Click() end - local function VarArgForActiveQuests(...) for i=1, select("#", ...), 4 do local completeStatus = select(i+3, ...) -- 1.7.9.5