priority mobs

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
kuripot
Posts: 493
Joined: Mon Nov 07, 2011 9:14 pm

priority mobs

#1 Post by kuripot »

i have a question.. how can i make command to target the priority mobs. for example if "player:findNearestNameOrId(111111)" my character will target (111111) but if cant find (111111) my character "player:findNearestNameOrId(222222)" and target (222222)
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: priority mobs

#2 Post by rock5 »

Try

Code: Select all

mob = player:findNearestNameOrId(111111) or player:findNearestNameOrId(222222)
  • 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: priority mobs

#3 Post by Bill D Cat »

Or even simpler...

Code: Select all

mob = player:findNearestNameOrId({111111,222222}) 
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: priority mobs

#4 Post by rock5 »

Bill D Cat wrote:Or even simpler...

Code: Select all

mob = player:findNearestNameOrId({111111,222222}) 
Except that wont give priority to 111111. It will find the nearest of either one.
  • 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
kuripot
Posts: 493
Joined: Mon Nov 07, 2011 9:14 pm

Re: priority mobs

#5 Post by kuripot »

rock5 wrote:Try

Code: Select all

mob = player:findNearestNameOrId(111111) or player:findNearestNameOrId(222222)
it mean?? even (111111) and (222222) are in same ranged close to my character it will priority the (111111) then if no more (111111) it will target next the (222222)?


or it will priority either (111111) or (222222)
kuripot
Posts: 493
Joined: Mon Nov 07, 2011 9:14 pm

Re: priority mobs

#6 Post by kuripot »

or like this??

Code: Select all

		local moba = player:findNearestNameOrId(1111111)
		local mobb = player:findNearestNameOrId(222222)
		if moba then
			player:target(moba)
		if target.HP > 0 then
			player:update();
	 		player:cast("CLASS_SKILL");
			 else
 			player:target(mobb)
		if target.HP > 0 then
			player:update();
	 		player:cast("CLASS_SKILL");
			end
		end
end
but how my bot can distinguish what mobs he target.. and how may "end" i will use
User avatar
Bill D Cat
Posts: 555
Joined: Sat Aug 10, 2013 8:13 pm
Location: Deep in the Heart of Texas

Re: priority mobs

#7 Post by Bill D Cat »

This will try to target mob 111111 and fight it if it is within range. If it can't find it but finds mob 222222 it will target and fight it instead.

Code: Select all

mob = player:findNearestNameOrId(111111) or player:findNearestNameOrId(222222)
if mob and 200 > distance(mob, player) then 
   player:target(mob)
   player:fight()
end
If you need to know which mob you are fighting, you can look at the variable mob.Id or mob.Name as needed.
kuripot
Posts: 493
Joined: Mon Nov 07, 2011 9:14 pm

Re: priority mobs

#8 Post by kuripot »

ah ok... i was thinking if i use "player:findNearestNameOrId(111111) or player:findNearestNameOrId(222222)" it will target.. either of two.. thank you both of you.. i will try it later
Post Reply