Jump to content

Not recognize Quest.GetQuestCompleted()


sycs

Recommended Posts

I use <QuestsSorted Action="If" NameClass="Quest.HasQuest(40014) " />  He can do it

but <QuestsSorted Action="If" NameClass="(Quest.HasQuest(40014) &amp;&amp; Quest.GetQuestCompleted(40014))" />  Not recognize

I need to judge that there is a task and a task to be accomplished..

Sorry, Google translate. I don't know. Can you understand that?

 

Link to comment
Share on other sites

Quest.HasQuest(40014) this mean you has quest in quests

 Quest.GetQuestCompleted(40014) this mean you completed this quest and its not in quest log

this condition will never return true since you cannot have quest and done with quest in same time

Edited by camelot10
Link to comment
Share on other sites

  • 7 months later...

If the internal Questing BotBase of WRobot isn't used, then there's no way for the bot to track completed quests. I wrote my own Quest BotBase and realized that :(. Vanilla doesn't have IsQuestFlaggedCompleted :(. I assume your botbase is recording completed quests? How are you detecting the completion, Quest Events? 

Link to comment
Share on other sites

He creates diffs of the quest log after different quest events and then knows if a quest was added, removed, etc. Usually that will also tell you whether a quest was abandoned. We do the same in Questie (you can find the Lua code on GitHub).
I'm not sure what the underlying Quest.IsObjectiveComplete (1, 40014) does, but I assume it's essentially the same thing:

- Get name by quest ID from memory
- iterate quest log for matching name (Lua)
- iterate objectives on the quest and check for their status (Lua)

Link to comment
Share on other sites

That's what I do now to figure out if the quest is ready for turn in.

However, The issue I was having was there was no way to select which quest to turn in if you have multiple completed quests with a NPC, you could only send Quest.CompleteQuest(), it offered a Gossip Option but no way to tell what that option said or was. I was going to simply track the event, but they don't seem to return any Args on Vanilla to let me know which one I completed ? 

Link to comment
Share on other sites

QUEST_COMPLETE fires not when you complete the quest, rather when you're about to complete it anyway.
The following QUEST_LOG_UPDATE event is when the quest will actually be gone from your log.

So all you have to do is temporarily store all quests at QUEST_COMPLETE, then diff them with all quests in your log at QUEST_LOG_UPDATE and you're good.

For figuring out which quests to turn in at an NPC, you'll have to check 

QuestFrameCompleteQuestButton:IsEnabled()
Link to comment
Share on other sites

Thanks for that.

What about on a character that was played by hand now you're trying to figure out where to start from without user input? Theres no way to know it you completed a quest without the bot having been there upon completion?

Link to comment
Share on other sites

6 hours ago, Smarter said:

Thanks for that.

What about on a character that was played by hand now you're trying to figure out where to start from without user input? Theres no way to know it you completed a quest without the bot having been there upon completion?

There isn't. If the character was played by hand with questie enabled, you could access its global Lua tables, but that's it. 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...