Code: Select all
-- questname = name of quest
-- returns 'true' if quest complete 'false' if not and nil if not accepted
function igf_questStatus(_questname)
local lowername=string.gsub(string.lower(_questname),"'","")
local c = 1
local getname = GetQuestRequest(c,-2)
while getname ~= nil do
getname=string.gsub(getname,"'","")
if string.find(string.lower(getname), lowername) then -- Quest exists
for i = 1, GetQuestRequest(c,-1) do -- for each goal
__,getstatus = GetQuestRequest(c,i)
if getstatus == 0 then -- check if not complete
return false
end
end
return true
end
c = c + 1
getname = GetQuestRequest(c,-2)
end
return
endCode: Select all
function isQuestComplete(_questname)
-- Do I need to turn in my quest?
if (bot.IgfAddon == false) then
error(language[1004], 0) -- Ingamefunctions addon (igf) is not installed
end
local queststate = RoMScript("igf_questStatus(\"".._questname.."\")")
if queststate == true then
return true
else
return false
end
end
function isQuestAccepted(_questname)
-- Do I need to go an get the quest?
if (bot.IgfAddon == false) then
error(language[1004], 0) -- Ingamefunctions addon (igf) is not installed
end
local queststate = RoMScript("igf_questStatus(\"".._questname.."\")")
if (queststate == true) or (queststate == false) then
return true
else
return false
end
end
function getQuestStatus(_questname)
-- Used when you need to make 3 way decision, get quest, complete quest or gather quest items.
if (bot.IgfAddon == false) then
error(language[1004], 0) -- Ingamefunctions addon (igf) is not installed
end
return RoMScript("igf_questStatus(\"".._questname.."\")")
end