cant get the status of a quest

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
Rickster
Posts: 291
Joined: Sun Oct 24, 2010 4:23 pm

cant get the status of a quest

#1 Post by Rickster »

Hi,

dealing with quests is normaly no problem for me. usually i use the functions from userfunction_QuestByName()
AcceptQuestByName()
CompleteQuestByName()

and in other places i deal with
OnClick_QuestListButton(..), AcceptQuest(), CompleteQuest()

but with all these i need getQuestStatus() to get to know wheter a quest is completed or not.

now i have one quest wich getQuestStatus() does not seem to get information about.

the quest id is 424163
the german questname is: "Grippe? Vergiftet!"

i tried following code snippet to test

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
	repeat questname=RoMScript("TEXT('Sys424163_name')"); yrest(500) until questname; -- "Grippe? Vergiftet!"
	queststatus = getQuestStatus(questname);
	printf("Questname: %s\n", questname);
	printf("Queststatus: %s\n", queststatus);
	error("Finished",0);

</onLoad>
</waypoints>
the questname is returned correctly.
but getQuestStatus() always returns "not accepted" wheter i have the quest in my questbook or not, completet or incomplete.
i also tried with getQuestStatus(questid), which also does not work.

do you have got any ideas?

Ric
BillDoorNZ
Posts: 446
Joined: Wed Aug 03, 2011 7:37 pm

Re: cant get the status of a quest

#2 Post by BillDoorNZ »

I always use CheckQuest for determining if the quest is accepted / complete
Rickster
Posts: 291
Joined: Sun Oct 24, 2010 4:23 pm

Re: cant get the status of a quest

#3 Post by Rickster »

Thanks Bill :)

i modified my test wp file

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
while true do
	repeat questname=RoMScript("TEXT('Sys424163_name')"); yrest(500) until questname; -- "Grippe? Vergiftet!"
	queststatus = getQuestStatus(424163);
	printf("Questname: %s\n", questname);
	printf("Queststatus: %s\n", queststatus);
	printf("No. of queststatus: %s\n",RoMScript("CheckQuest(424163)"));
	player:sleep();
end

</onLoad>
</waypoints>
but CheckQuest(questid) allway returns "2" for this quest, wether accepted, incomplete or not complete.
BillDoorNZ
Posts: 446
Joined: Wed Aug 03, 2011 7:37 pm

Re: cant get the status of a quest

#4 Post by BillDoorNZ »

Its because the quest is a daily quest that you have completed previously.

On a character that has never accepted or completed this quest, the return value is 0 :)
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: cant get the status of a quest

#5 Post by rock5 »

Looks like it doesn't like the question mark. Easy way to fix it is use

Code: Select all

getQuestStatus("Grippe. Vergiftet!")
'.' means 'any character' when searching strings. getQuestStatus actually does "normalise" the string but at the moment it only fixes "-" and """. We would have to add "?".

I'll add it to my next commit. I've got another nice one coming up to do with item classes such as 'bank', 'guildbank' and 'equipment' classes. And I've encormporated super fast item moving. :)
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: cant get the status of a quest

#6 Post by rock5 »

I just had an idea.

The 'correct' solution, that I avoided mentioning before, is to fix the 'igf_questStatus' function in the 'ingamefunctions' file to ignore the special meaning of those special characters. It should have been done that way in the beginning. The reason we haven't done this before is because all the users who have been managing by changing them to periods ".", like the example I used above, would stop working because now the special meaning of '.' would also be ignored.

Anyway I just had an idea how I can fix it so all older code using periods will still work and also 'unnormalised' names will also work. So both

Code: Select all

print(getQuestStatus("Flu.  Poisoned!"))
and

Code: Select all

print(getQuestStatus("Flu?  Poisoned!"))
would work.

I just tried it, it works. All I had to do is check if there are any '.' in the string. If there are, then it does a pattern match. If not it does a plain match which ignores special characters.

I don't know why I didn't think of it before.

I'll also include this in the next commit.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan
Rickster
Posts: 291
Joined: Sun Oct 24, 2010 4:23 pm

Re: cant get the status of a quest

#7 Post by Rickster »

ok, thanks :)

i now set the quest title manually

Code: Select all

	questname = "Grippe. Vergiftet!"
and then call

Code: Select all

	getQuestStatus(questname)
which works fine.

although it works, it includes no automatic localisation for other languages like this code would do

Code: Select all

questname=RoMScript("TEXT('Sys424163_name')")
so i am curious about your upcoming changes roc :)

thanks so far
Ric
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: cant get the status of a quest

#8 Post by rock5 »

I did a review of the changes today and I think I'm happy with it but they are pretty extentive so I'll probably run them for a couple of days before releasing. I could commit the fix for this now though. It's no trouble really.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: cant get the status of a quest

#9 Post by rock5 »

Ok Committed in rev 718.

But don't use

Code: Select all

questname=RoMScript("TEXT('Sys424163_name')")
use

Code: Select all

questname=GetIdName(424163)
Which gets the name of any id directly from memory without the need of a RoMScript.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan
Rickster
Posts: 291
Joined: Sun Oct 24, 2010 4:23 pm

Re: cant get the status of a quest

#10 Post by Rickster »

i changed to GetIdName(ID) in this script ... big changes to change in all scripts :D

RoM bot 718 works great. now i can get and use the questname automatically! thanx!
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: cant get the status of a quest

#11 Post by rock5 »

GetIdName is not new. It's been around for a long time. You'll probably see it used in a lot of the uploaded waypoints on the forum.

Well you learn something every day after all. :D
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan
Post Reply