I have a "friends" function that checks the names obtained from who to a table with various character names and the clan they belong to. I works, but the final output format is not what I want, and I have not been able to figure out how to make it work.
the friend table looks like this:
and the function I currently use:
function dofriends()
This gives me an output of(those currently online):
<Guardians> Balso
<Guardians> Salian
<Regent> Filso
<Guardians> Morti
What I would like to have is something like:
3 <Guardians> Balso, Salian, Morti
1 <Regent> Filso
Any suggestions or help would be greatly appriciated. Thanks
the friend table looks like this:
friendstbl = {
Guardians = {"Balso", "Morti", "Salian"},
Regent = {"Hogt", "Filso", "Bese", "Moux"},
Fiendish = {"Tars", "Ruerk"},
}
and the function I currently use:
function dofriends()
local fCount = 0
if (whonames ~= nil and #whonames >= 1) then
for i, c in pairs(friendtbl) do
for n, m in pairs(c) do
for a, b in ipairs(whonames) do
if b == m then
fCount = fCount + 1
Note ("<"..i.."> "..b)
end
end
end
end
end
end
This gives me an output of(those currently online):
<Guardians> Balso
<Guardians> Salian
<Regent> Filso
<Guardians> Morti
What I would like to have is something like:
3 <Guardians> Balso, Salian, Morti
1 <Regent> Filso
Any suggestions or help would be greatly appriciated. Thanks