Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print 'Waiting for data...'
- while true do
- local _, data = textutils.unserialize(rednet.receive())
- -- we have to be SUPER EXTRA CAREFUL so that we dont crash
- -- on bad data.
- if data and data.cmd and data.cmd == 'getfile' then
- -- write our received program! :P/>/>
- print 'Data received. Writing program.'
- local file = fs.open(data.program, 'w')
- file:write(data.content)
- file:close()
- print 'Done.'
- break
- end
- end
Add Comment
Please, Sign In to add comment