Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tape = peripheral.find("tape_drive")
- args = {...}
- term.clear()
- if tape == nil then
- prin("No Tape Drive found!")
- else
- print("TapeWriter")
- print("Where's the music at?")
- write("URL:")
- --url = read()
- url = args[1]
- local response = http.get(url, nil, true)
- local k = tape.getSize()
- tape.stop()
- tape.seek(-k)
- tape.stop() --Just making sure
- tape.seek(-90000)
- local s = string.rep("\xAA", 8192)
- for i = 1, k + 8191, 8192 do
- tape.write(s)
- end
- tape.seek(-k)
- tape.seek(-90000)
- print("Done wiping.")
- print("Downloading")
- tape.seek(-tape.getPosition())
- tape.write(response.readAll())
- response.close()
- tape.seek(-tape.getPosition())
- print("Got a name for this tape?")
- write("Name:")
- --name = read()
- --name = args[2] .. " " .. args[3] .. " " .. args[4] .. " " .. args[5] .. " " .. args[6] .. " " .. args[7] .. " " .. args[8] .. " " .. args[9] .. " " .. args[10] .. " " .. args[11] .. " " .. args[12] .. " " .. args[13] .. " " .. args[14] .. " " .. args[15] .. " " .. args[16] .. " " .. args[17] .. " " .. args[18] .. " " .. args[19] .. " " .. args[20] .. " " .. args[21] .. " " .. args[22] .. " " .. args[23] .. " " .. args[24] .. " " .. args[25] .. " " .. args[26] .. " " .. args[27] .. " " .. args[28] .. " "
- name = args[2]
- tape.setLabel(name)
- print("Done!")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement