is target in party?

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
noobbotter
Posts: 527
Joined: Fri Aug 31, 2012 1:15 pm

is target in party?

#1 Post by noobbotter » Sat Sep 12, 2015 7:54 am

How would i run a check for if my current target is in my party? I'm working on an auto buffing script and want to make sure that if I forget to join party that the bot won't spam party buffs.

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

Re: is target in party?

#2 Post by Bill D Cat » Sat Sep 12, 2015 8:53 am

This is completely untested, but I think most of it is correct. It should at least get you going in the right direction.

Code: Select all

local _targetInParty = false
local _numInParty = RoMScript("GetNumPartyMembers()")
if _numInParty > 1 then -- A party of one is just you.  But most likely if you are not in a party then the value will be 0.
   for _loop = 1, _numInParty
      local _partyMember = RomScript("GetPartyMember(".._loop..")")
      if player:target.Name == _partyMember then -- Not sure if this is correct to get the name of your target.
         _targetInParty = true
      end
   end
end
     

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: is target in party?

#3 Post by lisa » Sat Sep 12, 2015 5:41 pm

Also untested, should work fine for a party, I believe they changed how memory works for raids but I can't remember.

Code: Select all

player:updateTargetPtr()
local target = CPawn(player.TargetPtr)
if target and target.InParty == true then 
--means your target is in your party.

end
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

kenzu38
Posts: 279
Joined: Sun Dec 02, 2012 8:52 am

Re: is target in party?

#4 Post by kenzu38 » Fri Oct 02, 2015 5:52 am

Or this function. You just have to get the name of your target.

EDIT: Yep, just tested.

This works:

Code: Select all

local name = player:getTarget().Name; 
if name ~= "<UNKNOWN>" and RoMScript("InPartyByName('..name..')") then

Post Reply

Who is online

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