what is the /script equivalent of player:target_NPC("X")

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
Cindy
Posts: 237
Joined: Fri Sep 28, 2012 4:23 pm

what is the /script equivalent of player:target_NPC("X")

#1 Post by Cindy »

Trying my hand at an addon, can't seem to find what api the bot calls for target_NPC?
kkulesza
Posts: 150
Joined: Fri May 27, 2011 9:00 pm
Location: Poland

Re: what is the /script equivalent of player:target_NPC("X")

#2 Post by kkulesza »

Bot doesn't call rom api in this case.

If you want to do it with api then this two functions might be handy:
TargetNearestFriend()
UnitName("target")
Cindy
Posts: 237
Joined: Fri Sep 28, 2012 4:23 pm

Re: what is the /script equivalent of player:target_NPC("X")

#3 Post by Cindy »

Oh, I want to target a specifc NPC by name (to bring up their quest menu) and there may be other "friends" around...
User avatar
BlubBlab
Posts: 948
Joined: Fri Nov 30, 2012 11:33 pm
Location: My little Pony cafe

Re: what is the /script equivalent of player:target_NPC("X")

#4 Post by BlubBlab »

Jack-of-all-trades, but master-of-only of a few :D

My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: what is the /script equivalent of player:target_NPC("X")

#5 Post by rock5 »

kkulesza is correct. You would have to use those functions in a loop until you've targeted the desired target. Something like,

Code: Select all

local name = "wanted target name"
TargetNearestFriend()
local first = UnitName("target")
repeat
    TargetNearestFriend()
until UnitName("target") == name or UnitName("target") == first
if UnitName("target") == name then
    UseSkill(1,1)
else
    SendSystemChat("Target not found")
end
  • 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
Post Reply