Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tArgs = {...}
- if tArgs then
- if #tArgs ~= 2 then
- print("Usage: compile program saveto")
- elseif not fs.exists(tArgs[1]) then
- print("Program file does not exist")
- elseif fs.exists(tArgs[2]) then
- print("Save-to file already exists")
- else
- print("Compiling...")
- local startCompiledProgram = loadfile(tArgs[1])
- local toWrite = string.dump(startCompiledProgram)
- f = io.open(tArgs[2], "w")
- f:write(toWrite)
- f:close()
- print("Program compiled!")
- end
- else
- print("Usage: compile program saveto")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement