Compare commits
2 Commits
128798cf22
...
437b8f1a91
| Author | SHA1 | Date | |
|---|---|---|---|
| 437b8f1a91 | |||
| 17745c996c |
@ -72,10 +72,6 @@ if run then
|
|||||||
else
|
else
|
||||||
local sFile = tArgs[1] or getFilename(url) or url
|
local sFile = tArgs[1] or getFilename(url) or url
|
||||||
local sPath = shell.resolve(sFile)
|
local sPath = shell.resolve(sFile)
|
||||||
if fs.exists(sPath) then
|
|
||||||
print("File already exists")
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local res = get(url)
|
local res = get(url)
|
||||||
if not res then return end
|
if not res then return end
|
||||||
|
|||||||
@ -6,5 +6,5 @@ for key, monitor in pairs(monitors) do
|
|||||||
monitor.setCursorPos(1, 1)
|
monitor.setCursorPos(1, 1)
|
||||||
end
|
end
|
||||||
local wo = colony.getWorkOrders()
|
local wo = colony.getWorkOrders()
|
||||||
local s = printTable(wo)
|
term.redirect(monitors[1])
|
||||||
monitors[1].write(s)
|
printTable(wo)
|
||||||
|
|||||||
@ -1,16 +1,13 @@
|
|||||||
local result = ""
|
|
||||||
|
|
||||||
local function _printTable(table, tabs)
|
local function _printTable(table, tabs)
|
||||||
for key, value in pairs(table) do
|
for key, value in pairs(table) do
|
||||||
if type(value) == "table" then
|
if type(value) == "table" then
|
||||||
_printTable(value, tabs + 1)
|
_printTable(value, tabs + 1)
|
||||||
else
|
else
|
||||||
result = result .. "\n" .. string.rep(" ", tabs) .. key .. ": " .. value
|
print(string.rep(" ", tabs) .. key .. ": " .. value)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function printTable(table)
|
function printTable(table)
|
||||||
_printTable(table, 0)
|
_printTable(table, 0)
|
||||||
return result
|
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user