CompleteQuestByName Question

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Message
Author
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: CompleteQuestByName Question

#21 Post by rock5 »

I've been able to exactly pinpoint where the problem is.

In CompleteQuestByName, when it goes to click the quest, it keeps trying until the quest is complete. Because getQuestStatus can't tell the difference between daily or public, it thinks the quest hasn't been completed so it keeps trying to 'click' the quest even though the dialog has closed. When it tries to click the quest it uses this command

Code: Select all

RoMScript("OnClick_QuestListButton(3, "..i..")")
If the dialog has already closed then this causes the bugged dialog to open. It's not the real dialog. If you pause the script and move away from the npc, then resume the script, it still pops that fake dialog up. And I even entered that command manually and that also caused it to pop up.

You were right that my QuestLog userfunction doesn't fix the problem because CompleteQuestByName just sends the quest name to getQuestStatus so it has no way to know which it is, whichever version of getQuestStatus is used. Both versions can accept ids now but CompleteQuestByName sends the quest name even if the id is used.

The solution is to change it so it sends whatever the user wrote so if the user uses an id it sends that to getQuestStatus which will then be able to tell the difference.

Ok then, the solution. Edit functions.lua. Around line 1955 you will find

Code: Select all

			until (getQuestStatus(questOnBoard)~="complete")
Change it to

Code: Select all

			until (getQuestStatus(_nameorid)~="complete")
Done.

Things to note:
  • With this fix you don't need QuestLog userfunction.
    Use the quest id to differenciate between 2 quests with the same name.
    If you use the id then you don't need to use "daily", "public", etc.
As an example, this is what I used

Code: Select all

    player:target_NPC("Myan Kellas");
    yrest(6000);
    CompleteQuestByName(425504)
Let me know how it goes.
  • 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
McGuffin
Posts: 46
Joined: Sat Mar 16, 2013 6:14 am

Re: CompleteQuestByName Question

#22 Post by McGuffin »

rock5 wrote:I've been able to exactly pinpoint where the problem is.


Let me know how it goes.

Code: Select all

	<!-- # 40 --><waypoint x="-2704" z="-17954" y="834">
    yrest(500);
    player:target_NPC("Myan Kellas");
    yrest(500);
    CompleteQuestByName(425504) -- Last Luck
    yrest(1000);
	</waypoint>
	<!-- # 41 --><waypoint x="-2598" z="-17967" y="835">
    yrest(500);
    player:target_NPC("Kelod Kallol");
    yrest(500);
    CompleteQuestByName(425507) -- Smuggked Myrmex Eggs
    yrest(1000);
	</waypoint>
Worked perfectly. I can't thank you enough. Now bring on the inevitable double XP weekend. I have a couple hundred resets to burn through<G>.
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: CompleteQuestByName Question

#23 Post by rock5 »

Cool. I'll commit it at some stage.
  • 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