Stopping 'cast' when clicking item.

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Message
Author
leroy
Posts: 19
Joined: Thu Sep 19, 2013 11:57 am

Stopping 'cast' when clicking item.

#1 Post by leroy » Thu Sep 19, 2013 12:28 pm

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.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Stopping 'cast' when clicking item.

#2 Post by rock5 » Thu Sep 19, 2013 12:55 pm

Try target_NPC

Code: Select all

player:target_NPC("Idle Campire")
yrest(6000)
  • 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

CanceR
Posts: 33
Joined: Sun Jul 22, 2012 9:28 am

Re: Stopping 'cast' when clicking item.

#3 Post by CanceR » Thu Sep 19, 2013 2:07 pm

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

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Stopping 'cast' when clicking item.

#4 Post by rock5 » Thu Sep 19, 2013 2:33 pm

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.
  • 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

CanceR
Posts: 33
Joined: Sun Jul 22, 2012 9:28 am

Re: Stopping 'cast' when clicking item.

#5 Post by CanceR » Thu Sep 19, 2013 4:20 pm

works like charm, thx a lot again Rock

leroy
Posts: 19
Joined: Thu Sep 19, 2013 11:57 am

Re: Stopping 'cast' when clicking item.

#6 Post by leroy » Fri Sep 20, 2013 5:56 am

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 :)
Attachments
Daily-Sarlo-Top Flight Chef.xml
(1.65 KiB) Downloaded 185 times

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Stopping 'cast' when clicking item.

#7 Post by rock5 » Fri Sep 20, 2013 7:08 am

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)
  • 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

User avatar
Lamkefyned
Posts: 348
Joined: Thu May 23, 2013 11:38 am
Location: Spain

Re: Stopping 'cast' when clicking item.

#8 Post by Lamkefyned » Sat Dec 14, 2013 9:44 pm

hi, how I can put that lame "repeat daily tiquet" when you finish 10 daily mission
If you think something is right just because everyone else believes,you're not thinking.

User avatar
Lamkefyned
Posts: 348
Joined: Thu May 23, 2013 11:38 am
Location: Spain

Re: Stopping 'cast' when clicking item.

#9 Post by Lamkefyned » Sun Dec 15, 2013 9:47 am

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?
If you think something is right just because everyone else believes,you're not thinking.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Stopping 'cast' when clicking item.

#10 Post by rock5 » Sun Dec 15, 2013 9:58 am

AcceptQuestByName should be after the green bit.
  • 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

User avatar
Lamkefyned
Posts: 348
Joined: Thu May 23, 2013 11:38 am
Location: Spain

Re: Stopping 'cast' when clicking item.

#11 Post by Lamkefyned » Sun Dec 15, 2013 2:45 pm

200 tickets and now I have to spend.
Thank you
If you think something is right just because everyone else believes,you're not thinking.

User avatar
Lamkefyned
Posts: 348
Joined: Thu May 23, 2013 11:38 am
Location: Spain

Re: Stopping 'cast' when clicking item.

#12 Post by Lamkefyned » Sun Dec 15, 2013 5:20 pm

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>
If you think something is right just because everyone else believes,you're not thinking.

User avatar
Bill D Cat
Posts: 555
Joined: Sat Aug 10, 2013 8:13 pm
Location: Deep in the Heart of Texas

Re: Stopping 'cast' when clicking item.

#13 Post by Bill D Cat » Sun Dec 15, 2013 5:30 pm

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>

User avatar
Lamkefyned
Posts: 348
Joined: Thu May 23, 2013 11:38 am
Location: Spain

Re: Stopping 'cast' when clicking item.

#14 Post by Lamkefyned » Mon Dec 16, 2013 1:29 pm

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>
If you think something is right just because everyone else believes,you're not thinking.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Stopping 'cast' when clicking item.

#15 Post by rock5 » Mon Dec 16, 2013 11:39 pm

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.
  • 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

User avatar
Lamkefyned
Posts: 348
Joined: Thu May 23, 2013 11:38 am
Location: Spain

Re: Stopping 'cast' when clicking item.

#16 Post by Lamkefyned » Wed Dec 18, 2013 6:11 pm

and if I put it in an onload?
If you think something is right just because everyone else believes,you're not thinking.

User avatar
Lamkefyned
Posts: 348
Joined: Thu May 23, 2013 11:38 am
Location: Spain

Re: Stopping 'cast' when clicking item.

#17 Post by Lamkefyned » Wed Dec 18, 2013 6:13 pm

<?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>
If you think something is right just because everyone else believes,you're not thinking.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Stopping 'cast' when clicking item.

#18 Post by rock5 » Wed Dec 18, 2013 10:28 pm

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.
  • 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

User avatar
Bill D Cat
Posts: 555
Joined: Sat Aug 10, 2013 8:13 pm
Location: Deep in the Heart of Texas

Re: Stopping 'cast' when clicking item.

#19 Post by Bill D Cat » Wed Dec 18, 2013 11:54 pm

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.

User avatar
Lamkefyned
Posts: 348
Joined: Thu May 23, 2013 11:38 am
Location: Spain

Re: Stopping 'cast' when clicking item.

#20 Post by Lamkefyned » Thu Dec 19, 2013 10:07 am

is that it does not accept the mission
If you think something is right just because everyone else believes,you're not thinking.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 2 guests