Page 1 of 1
Get quest status by ID - getQuestStatus(..) - not working?
Posted: Sat Jul 23, 2011 10:10 am
by pumbatoo
When using the getQuestStatus with the ID of the quest (line 2), the return value is "not accepted". Although the quest is accepted and complete (not "closed").
Code: Select all
1: RoMScript("CheckQuest(420174)");
2: getQuestStatus(420174);
3: getQuestStatus("Aslan Essence");
Line 1 is returning 1 (means: you have accepted the quest but have never completed it); line 3 returns "complete". After completing the quest line 1 returns 2 and the 3th line returns "not accepted". All what I expect, except line 2.
Tried in a waypoint file (in the onLoad area and inside a waypoint)
Re: Get quest status by ID - getQuestStatus(..) - not workin
Posted: Sat Jul 23, 2011 10:39 am
by rock5
Looks ok.
It implies a problem with GetIdName(420174) when trying to get the name but it would have shown an error message I think. Maybe try
Code: Select all
print(RoMScript("GetIdName(420174)"))
and see what it prints.
Are you sure you didn't put quotes around the number?
Re: Get quest status by ID - getQuestStatus(..) - not workin
Posted: Tue Aug 09, 2011 5:10 pm
by pumbatoo
Ok. I think I've found the problem.
Times ago I posted about problems with umlauts in the questname:
viewtopic.php?f=21&t=2718
The function getQuestStatus(_questname) in the functions.lua first resolves the id into its name and after, it checks the status of the quest by its name:
Code: Select all
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
if type(_questname) == "number" then
_questname = GetIdName(_questname)
end
if type(_questname) == "string" then
return RoMScript("igf_questStatus(\"".._questname.."\")")
end
error("Invalid id sent to getQuestStatus()")
end
The problem:
GetIdName(_questname) returnes the quest name with hieroglyphs instead of ä, ö ,ü (e.g. the picture below is representing our ä).
Sounds like a problem about encoding/charset.
Re: Get quest status by ID - getQuestStatus(..) - not workin
Posted: Wed Aug 10, 2011 7:33 am
by rock5
So GetIdName returns the name with one character set and the in game functions use another?
I don't know about this stuff. I think you need Administrators input.