Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function readLines(sPath)
- local file = fs.open(sPath,"r")
- if file then
- local tLines = {}
- local sLine = file.readLine()
- while sLine do
- table.insert(tLines,sLine)
- sLine = file.readLine()
- end
- file.close()
- return tLines
- end
- end
- function writeLines(tLines, sPath)
- local file = fs.open(sPath,"a")
- for a = 1,#tLines do
- file.writeLine(tLines[a])
- end
- file.close()
- end
- function Search(tLines,sKey)
- tRes = {}
- for a = 1,#tLines do
- if string.find(tLines[a],sKey)
- then
- sLine = tLines[a]
- table.insert(tRes,sLine)
- else
- end
- end
- return tRes
- end
- function serial()
- tChat = file.getLines("chat1.log")
- download = textutils.serialize(tChat)
- return download
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement