Thread Tools Display Modes
03/06/23, 12:00 PM   #1
sinnereso
AddOn Author - Click to view addons
Join Date: Oct 2022
Posts: 244
Question guild member inzone, not offline and not ME search

Having some issues getting this to make it to the last line without ME being the "memberName". Any suggestions would be appreciated. Its a bit messy with different things ive tried commented out.

Code:
for iG = 1, GetNumGuilds() do
			local guildId = GetGuildId(iG)
			local numMembers, numOnline = GetGuildInfo(guildId)
			--for memberId = 1, numMembers do
			for memberIndex = 1, GetPlayerGuildMemberIndex(guildId) do
				--local memberIndex = GetPlayerGuildMemberIndex(guildId)
				local memberName, _, _, memberStatus = GetGuildMemberInfo(guildId, memberIndex)
				local _, _, memberZone = GetGuildMemberCharacterInfo(guildId, memberIndex)
				if memberName ~= GetUnitDisplayName("player") then
					if memberZone == GetUnitZone("player") and memberStatus ~= PLAYER_STATUS_OFFLINE then
						df("|c6666FF[RidinDirty]|r Traveling to " .. memberName .. " locally")----temp test chat
  Reply With Quote
03/06/23, 12:09 PM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,913
for memberIndex = 1, GetPlayerGuildMemberIndex(guildId) do
makes no sense as GetPlayerGuildMemberIndex(guildId) will always return your own player's memberIndex in that guild.
So this will always be YOU (ME).
-> "Player" = always YOUR currently logged in character (or account).

If you want to loop the guildIds members and check it's NOT you just use GetPlayerGuildMemberIndex(guildId) once to get your own index and exclude it from the loop then, and for all other entries found do check the zones.


Untested!
Lua Code:
  1. for guildIndex = 1, GetNumGuilds() do
  2.         local guildId = GetGuildId(guildIndex)
  3.         local numMembers, numOnline = GetGuildInfo(guildId)
  4.  
  5.         local myPlayerMemberIndex = GetPlayerGuildMemberIndex(guildId)
  6.  
  7.         for memberIndex = 1, numMembers, 1 do --instead of numMembers you coudl use GetNumGuildMembers(guildId) too, but numMembers is already there so reuse it
  8.             if memberIndex ~= myPlayerMemberIndex then
  9.                 --local memberIndex = GetPlayerGuildMemberIndex(guildId)
  10.                 local memberName, _, _, memberStatus = GetGuildMemberInfo(guildId, memberIndex)
  11.                 local _, _, memberZone = GetGuildMemberCharacterInfo(guildId, memberIndex)
  12.                 if memberName ~= GetUnitDisplayName("player") then
  13.                     if memberZone == GetUnitZone("player") and memberStatus ~= PLAYER_STATUS_OFFLINE then
  14.                         df("|c6666FF[RidinDirty]|r Traveling to " .. memberName .. " locally")----temp test chat
  15.  
  16.                     end
  17.  
  18.                 end
  19.             end
  20.         end
  21.     end
  Reply With Quote
03/06/23, 01:08 PM   #3
sinnereso
AddOn Author - Click to view addons
Join Date: Oct 2022
Posts: 244
OMG ty! That did the trick.. I have trouble with the "for this and that do" lines. And ty I didn't realize that line was getting MY index. My source didn't indicate that specifically
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » guild member inzone, not offline and not ME search

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off