Mothback/data/scripts/in_out.lua

15 lines
276 B
Lua

function doOutput(table)
local file = io.open("map.json", "w")
io.output(file)
io.write(json.encode(table))
io.close(file)
end
function getInput(filename)
local file = io.open(filename, "r")
io.input(file)
local content = io.read()
io.close(file)
return content
end