Jump to content

Recommended Posts

I have a spell ability that I need to check for use only if the player is in a group/party. I was in a group, but the group member went offline, and my ability was still being used despite the player actually being online in game. Is there a check for this?

Thanks!

if (Party.IsInGroup())
{
  // in group
    var partyMembers = wManager.Wow.Helpers.Party.GetParty
    foreach (var member in partyMembers)
    {
        // UnitIsConnected("unit")
        var isConnected = Lua.LuaDoString<bool>("return UnitIsConnected('" + "member.Name" + "')");
        if (isConnected)
        {
            Logging.Write("Player " + member.Name + " is online.");
        }
    }
}
else{
	// not in group
}

The above will check if you are in a group and then tell you whether each party member is online/not online.

Edited by Avvi

I am not sure if it's working as intended. It even returns that I am offline, and I am clearly in game. How can I search for a player by string and through settings if they are online and in range?

IE: Cast Vigilance On: ____[Player Name Here]______

I have tried different variations with the lua code provided and to no avail. Thanks!

 

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...