Table Ordering

Post Reply
icesteruk
Posts: 287
Joined: Sun Jan 20, 2013 9:16 pm

Table Ordering

Post by icesteruk » Tue Nov 19, 2013 1:16 pm

I'm trying to make my WHO LIST look simplier..

So far I have it looking like this

'1' - North ledge (8209) ( Area is: Bloodloch. )
Chyme

'1' is counting how many people is in that room with concat..
ROOM = north ledge (8209)
AREA = Bloodloch
people = Chyme

the script I have for it is this
Code: [show] | [select all] lua
function WhoList(room, name, area)
        system.who = system.who or {}
        system.who[room] = system.who[room] or {}
        system.who[room].area = area
     system.who[room].people = system.who[room].people or {}
        table.insert(system.who[room].people,name)
end
I am wondering Does anyone know a way to make it look like

Area: Bloodloch

Room: North ledge (8029)
Chyme (1)

Room: another room shows if another person is in area

Area: a different area if different from the top..

Basically to list per AREA then rooms in area with people in it?

The output im using for the above is
Code: [show] | [select all] lua
echo("\nWho List:")

for id,rooms in pairs(system.who) do
echo("\n")
echo("\n")
cecho("<grey> '" .. #rooms.people .. "' - ")
setFgColor(255,255,255)
echoLink(id, [[expandAlias("wList ]] ..id.. [[")]], "Who's in "..id, true)
cecho("<grey> ( Area is:<OrangeRed> " .. rooms.area .. " <grey>)\n")
echo("     ")

cecho("<aquamarine>" .. table.concat(rooms.people, ", ")	)
end

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 4 guests