-
reffo
- Posts: 8
- Joined: Sun Nov 18, 2012 11:30 am
#1
Post
by reffo » Sun Nov 18, 2012 11:38 am
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>
-
rock5
- Posts: 12173
- Joined: Tue Jan 05, 2010 3:30 am
- Location: Australia
#2
Post
by rock5 » Sun Nov 18, 2012 12:00 pm
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.
- 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.”
-
reffo
- Posts: 8
- Joined: Sun Nov 18, 2012 11:30 am
#3
Post
by reffo » Sun Nov 18, 2012 12:05 pm
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?
-
reffo
- Posts: 8
- Joined: Sun Nov 18, 2012 11:30 am
#4
Post
by reffo » Sun Nov 18, 2012 12:46 pm
quick question. Will the code inside a waypoint run when the bot reaches the coordinates or when the waypoint is initiated?
-
rock5
- Posts: 12173
- Joined: Tue Jan 05, 2010 3:30 am
- Location: Australia
#5
Post
by rock5 » Sun Nov 18, 2012 1:31 pm
reffo wrote:I want it to run between #2 and #3 until quest is complete.
Then just change it to
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.
- 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.”
Who is online
Users browsing this forum: Bing [Bot] and 0 guests