Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- id, msg, distance = rednet.receive() -- this covers all paramaters that are fired from rednet receive and now will halt the program till data is received.
- print("Received") -- tells user it received data
- print("What do you wish to name the file?") -- asks them for a name
- term.write("Name: ") -- writes the name then
- fileName = tostring(read()) -- allows them to write data which is stored in the variable fileName.
- -- Unserializes data so it can be used as a program again
- fileContents = textutils.unserialize(msg)
- local fileToWrite = fs.open(fileName, "w") -- opens file in write mode
- fileToWrite.write(fileContents) -- writes file contents to fileName
- fileToWrite.close() -- closes handle
- print("Done") -- tells the user it is done
- print("File saved as: "..fileName) -- tells the user where the file is saved.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement