You should avoid using select(). Function calls are basically the slowest thing you can do, and are totally unnecessary here. Plus, you're actually using
two calls to GetGuildRosterInfo() instead of just using variables properly.
Here is some code that will keep track of who is currently mobile in your guild:
Code:
local mobileStatus = {}
local eventFrame = CreateFrame("Frame")
eventFrame:RegisterEvent("GUILD_ROSTER_UPDATE")
eventFrame:SetScript("OnEvent", function()
wipe(mobileStatus)
local _, numOnline = GetNumGuildMembers()
for i = 1, numOnline do
local name, _, _, _, _, _, _, _, _, _, _, _, _, isMobile = GetGuildRosterInfo(i)
mobileStatus[name] = isMobile
end
end)
Then, when you want to find out if a specific player is mobile, just check their status in the table:
Code:
if mobileStatus[name] then
print(name, "is using the Mobile Armory app.")
else
print(name, "is logged into WoW.")
end