colony monitor
This commit is contained in:
parent
17745c996c
commit
437b8f1a91
@ -6,5 +6,5 @@ for key, monitor in pairs(monitors) do
|
||||
monitor.setCursorPos(1, 1)
|
||||
end
|
||||
local wo = colony.getWorkOrders()
|
||||
local s = printTable(wo)
|
||||
monitors[1].write(s)
|
||||
term.redirect(monitors[1])
|
||||
printTable(wo)
|
||||
|
||||
@ -1,16 +1,13 @@
|
||||
local result = ""
|
||||
|
||||
local function _printTable(table, tabs)
|
||||
for key, value in pairs(table) do
|
||||
if type(value) == "table" then
|
||||
_printTable(value, tabs + 1)
|
||||
else
|
||||
result = result .. "\n" .. string.rep(" ", tabs) .. key .. ": " .. value
|
||||
print(string.rep(" ", tabs) .. key .. ": " .. value)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function printTable(table)
|
||||
_printTable(table, 0)
|
||||
return result
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user