Advertisement
xPrrox

tapewriter 1.1

Apr 18th, 2022
991
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. tape = peripheral.find("tape_drive")
  2. args = {...}
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12. term.clear()
  13. if tape == nil then
  14. prin("No Tape Drive found!")
  15. else
  16. print("TapeWriter")
  17. print("Where's the music at?")
  18. write("URL:")
  19. --url = read()
  20. url = args[1]
  21. local response = http.get(url, nil, true)
  22.     local k = tape.getSize()
  23.       tape.stop()
  24.         tape.seek(-k)
  25.           tape.stop() --Just making sure
  26.             tape.seek(-90000)
  27.            
  28.               local s = string.rep("\xAA", 8192)
  29.                 for i = 1, k + 8191, 8192 do
  30.                     tape.write(s)
  31.                       end
  32.                         tape.seek(-k)
  33.                           tape.seek(-90000)
  34.                               print("Done wiping.")
  35. print("Downloading")
  36. tape.seek(-tape.getPosition())
  37. tape.write(response.readAll())
  38. response.close()
  39. tape.seek(-tape.getPosition())
  40. print("Got a name for this tape?")
  41. write("Name:")
  42. --name = read()
  43.  
  44. --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] .. " "
  45. name = args[2]
  46. tape.setLabel(name)
  47. print("Done!")
  48. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement