Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dir = "var/"
- function save(fn, value)
- local file = fs.open(dir .. fn, "w")
- file.write(tostring(value))
- file.close()
- end
- function load(fn)
- local file = fs.open(dir .. fn, "r")
- local value = file.readAll()
- file.close()
- return value
- end
- function saveTable(fn, table)
- local file = fs.open(dir .. fn,"w")
- file.write(textutils.serialize(table))
- file.close()
- end
- function loadTable(fn)
- local file = fs.open(dir .. fn,"r")
- local data = file.readAll()
- file.close()
- return textutils.unserialize(data)
- end
Add Comment
Please, Sign In to add comment