Compare commits

...

2 Commits

Author SHA1 Message Date
437b8f1a91 colony monitor 2022-06-30 11:59:38 +02:00
17745c996c getscript: overwrite file 2022-06-30 11:57:26 +02:00
3 changed files with 3 additions and 10 deletions

View File

@ -72,10 +72,6 @@ if run then
else
local sFile = tArgs[1] or getFilename(url) or url
local sPath = shell.resolve(sFile)
if fs.exists(sPath) then
print("File already exists")
return
end
local res = get(url)
if not res then return end

View File

@ -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)

View File

@ -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