Page 1 of 2

Stopping 'cast' when clicking item.

Posted: Thu Sep 19, 2013 12:28 pm
by leroy
Im trying to make a waypoint for an easy daily in Sarlo zone.
For this daily you need to click a campfire 5 times to get 5 grilled eggs.
When you click the campfire a 8 second 'cast' wil start. That 'cast' needs to be interupted by movement after 5 seconds otherwise you dont get a good grilled egg.
Manually its easy, click campfire and after about 5sec move char and its done. Repeat 4 times.

With the bot clicking the campfire i can do with: player:target_Object("Idle Campfire")
However i cant get that 8 second 'cast' to stop. It seems execution of code is stopped while that 'cast' is running.

Any thought how this could be fixed?

The daily is at NPC Madison Mull. You get it after you done 2 normal quests, the daily is called Top-Flight Chef.

Re: Stopping 'cast' when clicking item.

Posted: Thu Sep 19, 2013 12:55 pm
by rock5
Try target_NPC

Code: Select all

player:target_NPC("Idle Campire")
yrest(6000)

Re: Stopping 'cast' when clicking item.

Posted: Thu Sep 19, 2013 2:07 pm
by CanceR
Rock5, any idea how to code action like "keypressed Backward", like char is going backwards, i just want to interupt cast, initiated by "player:target_NPC("Idle Campire")". , because player:moveTo() makes char to turn viewpoint at direction of coordinates, and i do not want to do that, need to interupt cast only

Re: Stopping 'cast' when clicking item.

Posted: Thu Sep 19, 2013 2:33 pm
by rock5

Code: Select all

keyboardPress(key.VK_S)
That will just tap 'back'. I don't know if it's necessary but you might want to follow it with a bit of a yrest to give it time to move properly. About 200ms.

Re: Stopping 'cast' when clicking item.

Posted: Thu Sep 19, 2013 4:20 pm
by CanceR
works like charm, thx a lot again Rock

Re: Stopping 'cast' when clicking item.

Posted: Fri Sep 20, 2013 5:56 am
by leroy
I ended up with this waypoint file. It starts from housemaid.
If you have problems getting the good eggs try adjusting the yrest values in waypoint 9.

Only thing I dont understand is why it tries to click the campfire 1 more time after the daily is done, but i can live with a few sec delay :)

Re: Stopping 'cast' when clicking item.

Posted: Fri Sep 20, 2013 7:08 am
by rock5
It's probably because there might be a small delay before it registers that the action is complete, so it ends up looping one last time. You could add a pause after each action but then each loop will take longer so it might not save you any time anyway.

If you want to make the timing of the movement better, you can actually check the remaining time on the casting bar. Eg.

Code: Select all

player:target_NPC("Idle Campfire")
yrest(1000)
repeat
    yrest(200)
until 3 > player:getRemainingCastTime() -- Less than 3s on castbar
keyboardPress(key.VK_DOWN)  
yrest(200)

Re: Stopping 'cast' when clicking item.

Posted: Sat Dec 14, 2013 9:44 pm
by Lamkefyned
hi, how I can put that lame "repeat daily tiquet" when you finish 10 daily mission

Re: Stopping 'cast' when clicking item.

Posted: Sun Dec 15, 2013 9:47 am
by Lamkefyned
You can go as well?

<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
settings.profile.options.WAYPOINT_DEVIATION = 5
settings.profile.options.MAX_TARGET_DIST = 5
__WPL:setForcedWaypointType("TRAVEL")
</onLoad>
<!-- # 1 --><waypoint x="-18048" z="-2706" y="797"> </waypoint>
<!-- # 2 --><waypoint x="-18162" z="-2663" y="792"> </waypoint>
<!-- # 3 --><waypoint x="-18261" z="-2692" y="787"> </waypoint>
<!-- # 4 --><waypoint x="-18323" z="-2722" y="783"> </waypoint>
<!-- # 5 --><waypoint x="-18392" z="-2774" y="775"> </waypoint>
<!-- # 6 --><waypoint x="-18450" z="-2814" y="787"> </waypoint>
<!-- # 7 --><waypoint x="-18490" z="-2832" y="799"> </waypoint>
<!-- # 8 --><waypoint x="-18547" z="-2824" y="805" tag="StartDaily">
player:target_NPC(122168)
AcceptQuestByName(426333)
local dailyQuestCount, dailyQuestsPerDay= RoMScript("Daily_count()");
if 10 == dailyQuestCount then
if inventory:itemTotalCount(202434) > 0 then
inventory:useItem(202434)
end
local dailyQuestCount, dailyQuestsPerDay= RoMScript("Daily_count()")
if 10 == dailyQuestCount then
RoMScript("DEFAULT_CHAT_FRAME:AddMessage('|cffffff00Done|r')")
error("Dailies done",2)
end

</waypoint>
<!-- # 9 --><waypoint x="-18512" z="-2820">
repeat
queststate = getQuestStatus(426333)
if queststate == "incomplete" then
yrest(200)
player:target_NPC(122170)
yrest(4500)
keyboardPress(key.VK_DOWN)
yrest(200)
keyboardPress(key.VK_DOWN)
end
until queststate == "complete"
</waypoint>
<!-- # 10 --><waypoint x="-18531" z="-2823">
player:target_NPC(122168)
CompleteQuestByName(426333)
__WPL:setWaypointIndex(__WPL:findWaypointTag("StartDaily"))
</waypoint>
</waypoints>



================>>>>>>>>>>>>>>>> This is correct?

Re: Stopping 'cast' when clicking item.

Posted: Sun Dec 15, 2013 9:58 am
by rock5
AcceptQuestByName should be after the green bit.

Re: Stopping 'cast' when clicking item.

Posted: Sun Dec 15, 2013 2:45 pm
by Lamkefyned
200 tickets and now I have to spend.
Thank you

Re: Stopping 'cast' when clicking item.

Posted: Sun Dec 15, 2013 5:20 pm
by Lamkefyned
Error
Sin título.png

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
	settings.profile.options.WAYPOINT_DEVIATION = 5
	settings.profile.options.MAX_TARGET_DIST = 5
__WPL:setForcedWaypointType("TRAVEL")
</onLoad>
	<!-- #  1 --><waypoint x="-18048" z="-2706" y="797">	</waypoint>
	<!-- #  2 --><waypoint x="-18162" z="-2663" y="792">	</waypoint>
	<!-- #  3 --><waypoint x="-18261" z="-2692" y="787">	</waypoint>
	<!-- #  4 --><waypoint x="-18323" z="-2722" y="783">	</waypoint>
	<!-- #  5 --><waypoint x="-18392" z="-2774" y="775">	</waypoint>
	<!-- #  6 --><waypoint x="-18450" z="-2814" y="787">	</waypoint>
	<!-- #  7 --><waypoint x="-18490" z="-2832" y="799">	</waypoint>
	<!-- #  8 --><waypoint x="-18547" z="-2824" y="805" tag="StartDaily">
     local dailyQuestCount, dailyQuestsPerDay= RoMScript("Daily_count()");
      if 10 == dailyQuestCount then
   if inventory:itemTotalCount(202434) > 0 then
                 inventory:useItem(202434)
end
      local dailyQuestCount, dailyQuestsPerDay= RoMScript("Daily_count()")
   		if 10 == dailyQuestCount then
      	RoMScript("DEFAULT_CHAT_FRAME:AddMessage('|cffffff00Done|r')")
      	error("Dailies done",2)
	 		end
      player:target_NPC(122168)
      AcceptQuestByName(426333)
	</waypoint>
  <!-- #  9 --><waypoint x="-18512" z="-2820">
		repeat   
  	queststate = getQuestStatus(426333)
		if queststate == "incomplete" then
  		yrest(200)
  		player:target_NPC(122170)
  		yrest(4500)
			keyboardPress(key.VK_DOWN)  
    	yrest(200)
    	keyboardPress(key.VK_DOWN)  
   	end
   	until queststate == "complete"
	</waypoint>
  <!-- #  10 --><waypoint x="-18531" z="-2823">
      player:target_NPC(122168)
      CompleteQuestByName(426333)
      __WPL:setWaypointIndex(__WPL:findWaypointTag("StartDaily"))
  </waypoint>
</waypoints>

Re: Stopping 'cast' when clicking item.

Posted: Sun Dec 15, 2013 5:30 pm
by Bill D Cat
Missing and "end" command at the end of waypoint #8.

Code: Select all

	<!-- #  8 --><waypoint x="-18547" z="-2824" y="805" tag="StartDaily">
		local dailyQuestCount, dailyQuestsPerDay= RoMScript("Daily_count()");
		if 10 == dailyQuestCount then
			if inventory:itemTotalCount(202434) > 0 then
				inventory:useItem(202434)
			end
			local dailyQuestCount, dailyQuestsPerDay= RoMScript("Daily_count()")
			if 10 == dailyQuestCount then
				RoMScript("DEFAULT_CHAT_FRAME:AddMessage('|cffffff00Done|r')")
				error("Dailies done",2)
			end
			player:target_NPC(122168)
			AcceptQuestByName(426333)
		end  <--  MISSING -->
	</waypoint>

Re: Stopping 'cast' when clicking item.

Posted: Mon Dec 16, 2013 1:29 pm
by Lamkefyned
hello, works well but not gets the daily mission and not know why.

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
   settings.profile.options.WAYPOINT_DEVIATION = 5
   settings.profile.options.MAX_TARGET_DIST = 5
__WPL:setForcedWaypointType("TRAVEL")
</onLoad>
   <!-- #  1 --><waypoint x="-18048" z="-2706" y="797">   </waypoint>
   <!-- #  2 --><waypoint x="-18162" z="-2663" y="792">   </waypoint>
   <!-- #  3 --><waypoint x="-18261" z="-2692" y="787">   </waypoint>
   <!-- #  4 --><waypoint x="-18323" z="-2722" y="783">   </waypoint>
   <!-- #  5 --><waypoint x="-18392" z="-2774" y="775">   </waypoint>
   <!-- #  6 --><waypoint x="-18450" z="-2814" y="787">   </waypoint>
   <!-- #  7 --><waypoint x="-18490" z="-2832" y="799">   </waypoint>
   <!-- #  8 --><waypoint x="-18547" z="-2824" y="805" tag="StartDaily">
      local dailyQuestCount, dailyQuestsPerDay= RoMScript("Daily_count()");
      if 10 == dailyQuestCount then
         if inventory:itemTotalCount(202434) > 0 then
            inventory:useItem(202434)
         end
         local dailyQuestCount, dailyQuestsPerDay= RoMScript("Daily_count()")
         if 10 == dailyQuestCount then
            RoMScript("DEFAULT_CHAT_FRAME:AddMessage('|cffffff00Done|r')")
            error("Dailies done",2)
         end
         player:target_NPC(122168)
         AcceptQuestByName(426333)
      end
   </waypoint>
  <!-- #  9 --><waypoint x="-18512" z="-2820">
      repeat   
     queststate = getQuestStatus(426333)
      if queststate == "incomplete" then
        yrest(200)
        player:target_NPC(122170)
        yrest(4500)
         keyboardPress(key.VK_DOWN)  
       yrest(200)
       keyboardPress(key.VK_DOWN)  
      end
      until queststate == "complete"
   </waypoint>
  <!-- #  10 --><waypoint x="-18531" z="-2823">
      player:target_NPC(122168)
      CompleteQuestByName(426333)
      __WPL:setWaypointIndex(__WPL:findWaypointTag("StartDaily"))
  </waypoint>
</waypoints>

Re: Stopping 'cast' when clicking item.

Posted: Mon Dec 16, 2013 11:39 pm
by rock5
I can find 2 quests with the name of "Top-Flight Chef"; 426333 and 426338. Maybe one is a prequest and the other is the actual daily. Maybe you have the wrong id.

Re: Stopping 'cast' when clicking item.

Posted: Wed Dec 18, 2013 6:11 pm
by Lamkefyned
and if I put it in an onload?

Re: Stopping 'cast' when clicking item.

Posted: Wed Dec 18, 2013 6:13 pm
by Lamkefyned
<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
local dailyQuestCount, dailyQuestsPerDay= RoMScript("Daily_count()");
if 10 == dailyQuestCount then
if inventory:itemTotalCount(202434) > 0 then
inventory:useItem(202434)
end
local dailyQuestCount, dailyQuestsPerDay= RoMScript("Daily_count()")
if 10 == dailyQuestCount then
RoMScript("DEFAULT_CHAT_FRAME:AddMessage('|cffffff00Done|r')")
error("Dailies done",2)
end

settings.profile.options.WAYPOINT_DEVIATION = 5
settings.profile.options.MAX_TARGET_DIST = 5
__WPL:setForcedWaypointType("TRAVEL")
</onLoad>
<!-- # 1 --><waypoint x="-18048" z="-2706" y="797"> </waypoint>
<!-- # 2 --><waypoint x="-18162" z="-2663" y="792"> </waypoint>
<!-- # 3 --><waypoint x="-18261" z="-2692" y="787"> </waypoint>
<!-- # 4 --><waypoint x="-18323" z="-2722" y="783"> </waypoint>
<!-- # 5 --><waypoint x="-18392" z="-2774" y="775"> </waypoint>
<!-- # 6 --><waypoint x="-18450" z="-2814" y="787"> </waypoint>
<!-- # 7 --><waypoint x="-18490" z="-2832" y="799"> </waypoint>
<!-- # 8 --><waypoint x="-18547" z="-2824" y="805" tag="StartDaily">
player:target_NPC(122168)
AcceptQuestByName(426333)
</waypoint>
<!-- # 9 --><waypoint x="-18512" z="-2820">
repeat
queststate = getQuestStatus(426333)
if queststate == "incomplete" then
yrest(200)
player:target_NPC(122170)
yrest(4500)
keyboardPress(key.VK_DOWN)
yrest(200)
keyboardPress(key.VK_DOWN)
end
until queststate == "complete"
</waypoint>
<!-- # 10 --><waypoint x="-18531" z="-2823">
player:target_NPC(122168)
CompleteQuestByName(426333)
yrest(200)
__WPL:setWaypointIndex(__WPL:findWaypointTag("StartDaily"))
</waypoint>
</waypoints>

Re: Stopping 'cast' when clicking item.

Posted: Wed Dec 18, 2013 10:28 pm
by rock5
The onload is run only when the file is loaded so that's no good. That code needs to run between completing the quest and accepting it again.

Re: Stopping 'cast' when clicking item.

Posted: Wed Dec 18, 2013 11:54 pm
by Bill D Cat
You can define it as a function inside the onload section and then call it from inside a waypoint. But as rock5 said, the code in the onload section only gets run when the waypoint is first loaded UNLESS it is a function that is called later from a waypoint.

Re: Stopping 'cast' when clicking item.

Posted: Thu Dec 19, 2013 10:07 am
by Lamkefyned
is that it does not accept the mission