Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- songs = {
- ["1"] = {["name"] = "Handlebars", ["author"] = "Flobots", ["url"] = "https://drive.google.com/uc?export=download&id=1VXcxKPin71p6UWQcz3wJEyU9ErIqaTp6"},
- ["2"] = {["name"] = "Island In The Sun", ["author"] = "Weezer", ["url"] = "https://drive.google.com/uc?export=download&id=1E2m0e4iM56Bt_ntzqw7aKHzqZ1YLF07W"}
- }
- function writeToTape(url)
- tape = peripheral.find("tape_drive")
- local response = http.get(url, nil, true) -- THIS IS IMPORTANT
- tape.seek(-tape.getPosition()) --Rewind to start
- tape.write(response.readAll())
- response.close()
- tape.seek(-tape.getPosition())
- end
- function play(songID)
- writeToTape(songs[songID])
- tape.play()
- end
Add Comment
Please, Sign In to add comment