Advertisement
Guest User

Untitled

a guest
May 20th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.42 KB | None | 0 0
  1. local tape
  2. if peripheral then
  3.   tape = peripheral.find("computronics:tape_drive")
  4. else
  5.   local component = require("component")
  6.   tape = component.tape_drive
  7. end
  8.  
  9. local tArgs = {...}
  10.  
  11. if not tArgs[1] then error("Missing argument 1") end
  12.  
  13. local file = io.open(tArgs[1], "rb")
  14. if not file then error("File doesn't exist") end
  15. local byte = file:read()
  16.  
  17. while byte ~= nil do
  18.   tape.write(byte)
  19.   byte = file:read()
  20. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement