Advertisement
Guest User

Untitled

a guest
Apr 17th, 2014
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.85 KB | None | 0 0
  1. --tapew, use this to write to the tape
  2. local component = require("component")
  3. local tape = component.tape_drive
  4.  
  5.  
  6. local file = io.open("/mnt/230/audio", "rb") --change '230' to your drives 3 letters, change 'audio' to the name of the file
  7. local block = 1024
  8. while true do
  9.     local bytes = file:read(block)
  10.     if not bytes then break end
  11.     tape.write(bytes)
  12. end
  13.  
  14. --taper, plays the tape, pointless now because yo can do it on the tape drive, but here anyway.
  15. local component = require("component")
  16. local tape = component.tape_drive
  17. while true do
  18.     if tape.seek(-1000000) < 1 then
  19.         break
  20.     end
  21. end
  22. tape.play()
  23.  
  24. --tapel, labels the tape(doesn't take spaces yet, sorry)
  25. local component = require("component")
  26. local tape = component.tape_drive
  27.  
  28. local args = {...}
  29. if #args < 1 then
  30.     print("Usage: tapel {label}")
  31. else
  32.     tape.setLabel(args[1])
  33. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement