Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("top")
- --HASH MUST MATCH SENDER HASH, OTHERWISE FILES WILL FAIL TO SEND
- hash = "HASH"
- term.clear()
- term.setCursorPos(1,1)
- print("Getting Files...")
- while true do
- id, ftconfirm = rednet.receive()
- if ftconfirm == hash then
- id2, filename = rednet.receive()
- if filename == "startup" or filename == "startup.lua" then
- print()
- print("Startup received. Change name & save, delete, or save as startup?")
- write("save,delete,override?")
- savearg = input()
- if savearg == "save" then
- write("File Name?: ")
- newname = input()
- f = fs.open(newname, "w")
- id3, filedata = rednet.receive()
- f.write(filedata)
- f.close()
- os.reboot()
- if savearg == "delete" then
- os.reboot()
- end
- if savearg == "override" then
- end
- else
- f = fs.open(filename, "w")
- id3, filedata = rednet.receive()
- f.write(filedata)
- f.close()
- print()
- print("File "..filename.." received! Sent by: "..id)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement