file = fs.open("tobuild","w") while true do id,message = rednet.receive() if id == 3 then if message=="done" then file.close() return else print(message) file.writeLine(message) end end end