Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Creeper9207 Code: database (API)--
- tDB = {}
- function setValue(database, key, value)
- local tFile = fs.open(database, "w")
- table.insert(tDB, key, value)
- tFile.write(textutils.serialize(tDB))
- tFile.flush()
- tFile.close()
- end
- function getValue(tDatabase, tKey)
- local tFile = fs.open(tDatabase, "r")
- local tData = tFile.readAll()
- tRealData = textutils.unserialize(tData)
- local value = tRealData[tKey]
- return value
- tFile.close()
- end
Advertisement
Add Comment
Please, Sign In to add comment