colony monitor output
This commit is contained in:
parent
a008309155
commit
b316ced862
11
monitor.lua
Normal file
11
monitor.lua
Normal file
@ -0,0 +1,11 @@
|
||||
require("printTable")
|
||||
local monitors = { peripheral.find("monitor") }
|
||||
for key, monitor in pairs(monitors) do
|
||||
monitor.setTextScale(0.5)
|
||||
monitor.clear()
|
||||
monitor.setCursorPos(1, 1)
|
||||
--monitor.write("Hello World!")
|
||||
end
|
||||
local wo = colony.getWorkOrders()
|
||||
local pr = textutils.serialise(wo)
|
||||
printTable(wo, 0)
|
||||
14
printTable.lua
Normal file
14
printTable.lua
Normal file
@ -0,0 +1,14 @@
|
||||
local function _printTable(table, s, tabs)
|
||||
for key, value in pairs(table) do
|
||||
if type(value) == "table" then
|
||||
_printTable(table, "", tabs + 1)
|
||||
else
|
||||
print(string.rep(' ', tabs), key, value)
|
||||
end
|
||||
end
|
||||
return s
|
||||
end
|
||||
|
||||
function printTable(table)
|
||||
return _printTable(table, "", 0)
|
||||
end
|
||||
Loading…
x
Reference in New Issue
Block a user