Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tArgs = { ... }
- local f
- local framename
- if #tArgs == 0 or tArgs[ 1 ] == nil then error( shell.getRunningProgram() .. " <file> [prefix]", 0 ) end
- f = tArgs[ 1 ]
- framename = tArgs[ 2 ] or "/"
- --[[write( "Enter the location of the animation: " )
- old code
- local f = read()
- write( "Prefix for files: " )
- local framename = read()
- ]]--
- print( "Writing files. Please wait... (Huge animations may take a while)" )
- local curFrame = 1
- local output = fs.open(framename..curFrame, "w")
- for line in io.lines(f) do
- if line == "~" then
- curFrame = curFrame + 1
- output.close()
- output = fs.open(framename..curFrame, "w")
- else
- output.writeLine(line)
- end
- end
- output.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement