Advertisement
Guest User

Button

a guest
Dec 2nd, 2015
835
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.42 KB | None | 0 0
  1. local component = require("component")
  2. redstone = component.redstone
  3. tape = component.tape_drive
  4.  
  5. repeat
  6.   if tape.read() == 0
  7.     then tape.stop()
  8.          tape.seek(-math.huge)
  9.   end
  10.  
  11.   if redstone.getInput(1) >= 1
  12.     then if tape.getState() == "STOPPED"
  13.            then tape.play()
  14.            elseif tape.getState() == "PLAYING"
  15.              then tape.stop()
  16.                   tape.seek(-math.huge)
  17.          end
  18.   end
  19. until i == 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement