Im trying to print my table of user so i dont have to type them out. anything will help, all i want is to print wahts in the table, such as users
Lua [help please]
Started by predatorxil, Oct 22 2012 02:37 PM
3 replies to this topic
#1
Posted 22 October 2012 - 02:37 PM
#2
Posted 22 October 2012 - 02:50 PM
If you just want one user per line, it's pretty simple:
And if you wanted, lets say, 3 users per line you could do something like this:
for i,v in ipairs(userTable) do print(v) end
And if you wanted, lets say, 3 users per line you could do something like this:
local pad = " "
local usersPerLine = 3
for i,v in ipairs(userTable) do
write(v)
if i % usersPerLine == 0 then
print()
else
write(pad)
end
end
#3
Posted 22 October 2012 - 02:51 PM
textutils.tabulate(someTable) will print out the items that are in the indexed portion of a table. Use textutils.pagedTabulate(someTable) if the table contents go past the terminal height
#4
Posted 22 October 2012 - 02:54 PM
...I should really pay more attention to the APIs that CC has...
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











