Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fileName = "text"
- function getData()
- local path = shell.resolve( fileName )
- if fs.exists( fileName ) then
- local file = fs.open( path, "r" )
- data = file.readAll()
- end
- end
- function printData()
- local path = shell.resolve( fileName )
- if fs.exists( fileName ) then
- fs.delete( fileName )
- end
- local file = fs.open( path, "w" )
- file.write( data )
- file.close()
- end
- getData()
- stringEnd = 0
- while true do
- stringStart = string.find( "<BuildTimeSeconds>", stringEnd )
- stringEnd = string.find( "<", stringStart )
- number = tonumber(string.sub( data, stringStart + 18, stringEnd - 1 ))
- if number == 0 then
- print( "Job done. Printing text to file: "..fileName )
- printData()
- break
- else
- data = string.sub( data, 0, stringStart + 18 )..(number*0.2)..string.sub( data, stringEnd - 1, #data )
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment