Page 1 of 1

[Waypoint] Daily quest waypoint (help needed)

Posted: Sun Nov 18, 2012 11:38 am
by reffo
Hello!

I'm new to MicroMacro and lua and I just started to learn yesterday.
I've searched and searched the forums to help me understand the code etc.

I have a problem with the waypoint I created for a daily quest.
The bot runs fine but it never turn in the quest (except if I have it completed when i start the waypoint)

Any help would be greatly appreciated.

Edit: Noticed that this post might be in the wrong section. If so, sorry in advance.

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
	<onLoad>
		farm = false --continue farm after daily capped?
		dqNpc = 117517
		dq = "Cute and Slimy"
	</onLoad>
	<!-- #  1 --><waypoint x="-4210" z="-338" y="395">
		qStatus = getQuestStatus(dq);
		if qStatus == "complete" then
			player:target_NPC(dqNpc);
			CompleteQuestByName(dq); yrest(1000);
		end
		qStatus = getQuestStatus(dq);	
		if qStatus == "not accepted" then
			player:target_NPC(dqNpc);
			AcceptQuestByName(dq); yrest(1000);
			__WPL:setWaypointIndex(1);
		end
	</waypoint>
	<!-- #  2 --><waypoint x="-4388" z="-493" y="387"></waypoint>
	<!-- #  3 --><waypoint x="-4404" z="-586" y="385">
		qStatus = getQuestStatus(dq);
		if qStatus == "complete" then
			__WPL:setWaypointIndex(1);
		end
	</waypoint>
</waypoints>

Re: [Waypoint] Daily quest waypoint (help needed)

Posted: Sun Nov 18, 2012 12:00 pm
by rock5
This

Code: Select all

      qStatus = getQuestStatus(dq);
      if qStatus == "complete" then
         __WPL:setWaypointIndex(1);
      end
basically does nothing. Because it's the last waypoint, it's going to go to waypoint 1 regardless.

Did you want it to stay at waypoint 3 until the quest is complete? Then you could do

Code: Select all

      qStatus = getQuestStatus(dq);
      if qStatus == "incomplete" then
         __WPL:setWaypointIndex(3);
      end
If there is nothing to attack then it will jerk around, though. You could use a loop but then you would probably have to do some code to make it attack in the loop.

Re: [Waypoint] Daily quest waypoint (help needed)

Posted: Sun Nov 18, 2012 12:05 pm
by reffo
rock5 wrote:This

Code: Select all

      qStatus = getQuestStatus(dq);
      if qStatus == "complete" then
         __WPL:setWaypointIndex(1);
      end
basically does nothing. Because it's the last waypoint, it's going to go to waypoint 1 regardless.

Did you want it to stay at waypoint 3 until the quest is complete? Then you could do

Code: Select all

      qStatus = getQuestStatus(dq);
      if qStatus == "incomplete" then
         __WPL:setWaypointIndex(3);
      end
If there is nothing to attack then it will jerk around, though. You could use a loop but then you would probably have to do some code to make it attack in the loop.
I want it to run between #2 and #3 until quest is complete.
There is always something to attack because the spawn rate is insane, it might just be that i kill them slowly. But the bot pretty much cycles 3 spawns.
Should i just move the code inside #3 to #2?

Re: [Waypoint] Daily quest waypoint (help needed)

Posted: Sun Nov 18, 2012 12:46 pm
by reffo
quick question. Will the code inside a waypoint run when the bot reaches the coordinates or when the waypoint is initiated?

Re: [Waypoint] Daily quest waypoint (help needed)

Posted: Sun Nov 18, 2012 1:31 pm
by rock5
reffo wrote:I want it to run between #2 and #3 until quest is complete.
Then just change it to

Code: Select all

         __WPL:setWaypointIndex(2);
reffo wrote:quick question. Will the code inside a waypoint run when the bot reaches the coordinates or when the waypoint is initiated?
Code in the <onload> executes when the file is loaded. Waypoint code is executed when you reach the waypoint or pass it.