Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function get(item)
- local file = io.open("os/settings.txt","r")
- local Content
- repeat
- Content = {file.readLine()}
- until Content[1] == item
- file.close()
- return(Content[2])
- end
- function set(item,var)
- local file = io.open("os/settings.txt","r")
- local Text = {file.readAll()}
- file.close()
- local Doc = io.open("os/settings.txt","w")
- local Content
- for i = 1, #Text do
- Content = Text[i]
- if Content[1] == item then Text[i][2] = var end
- end
- Doc.write(Text)
- Doc.close()
- return true
- end
- function add(item,var)
- local file = io.open("os/settings.txt","a")
- file.writeLine({item,var})
- file.close()
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement