Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local nfaendframechar = "~"
- local endchar = nfaendframechar
- local framebuffer = {}
- local frameend = false
- local startf = 1
- local endf = 16
- local framename
- local lineend
- write( "Enter the location of the animation: " )
- loc = read()
- f = fs.open( loc, "r" )
- write( "How many frames are there? : " )
- fr = read()
- write( "Prefix for files: " )
- framename = read()
- print( "Writing " .. fr .. " files. Please wait..." )
- for i = 1, fr do
- while not frameend do
- for x = startf, endf do
- if f.readLine( x ) == endchar then
- frameend = true
- lineend = x
- else
- framebuffer[ x ] = f.readLine( x ) .. "\n"
- --print( framebuffer[ x ] )
- end
- end
- end
- fra = fs.open( framename .. i, "w" )
- for y = 1, 16 do
- fra.write( framebuffer[ y ] )
- end
- fra.close()
- framebuffer = {}
- --startf = lineend + 1
- --endf = lineend + 15
- startf = startf + 17
- endf = endf + 17
- print( "New read start: " .. startf )
- print( "New read end: " .. endf )
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement