Apexx 59 Posted September 3, 2017 Share Posted September 3, 2017 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! Link to comment Share on other sites More sharing options...
Avvi 98 Posted September 3, 2017 Share Posted September 3, 2017 (edited) 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 September 15, 2017 by Avvi Apexx 1 Link to comment Share on other sites More sharing options...
Apexx 59 Posted September 4, 2017 Author Share Posted September 4, 2017 Thank you, @avvi I will check this out! Link to comment Share on other sites More sharing options...
Apexx 59 Posted September 6, 2017 Author Share Posted September 6, 2017 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! Link to comment Share on other sites More sharing options...
Avvi 98 Posted September 15, 2017 Share Posted September 15, 2017 Hey Apexx, I believe I had a typo in the code snippet. Please try again. with this var isConnected = Lua.LuaDoString<bool>("return UnitIsConnected('" + "member.Name" + "')"); Apexx 1 Link to comment Share on other sites More sharing options...
Apexx 59 Posted September 17, 2017 Author Share Posted September 17, 2017 Thanks for the update @Avvi. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now