is target in party?
-
- Posts: 527
- Joined: Fri Aug 31, 2012 1:15 pm
is target in party?
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.
- 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?
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
Re: is target in party?
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
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: is target in party?
Or this function. You just have to get the name of your target.
EDIT: Yep, just tested.
This works:
EDIT: Yep, just tested.
This works:
Code: Select all
local name = player:getTarget().Name;
if name ~= "<UNKNOWN>" and RoMScript("InPartyByName('..name..')") then
Who is online
Users browsing this forum: Ahrefs [Bot] and 135 guests