Advertisement
icdb

[ComputerCraft] Soundbox

Aug 30th, 2014
407
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.59 KB | None | 0 0
  1. local monitor = peripheral.wrap('monitor_1')
  2.  
  3. function clrmonitor()
  4.     monitor.clear()
  5.     monitor.setCursorPos(1,1)
  6. end
  7. clrmonitor()
  8. while true do
  9.     a = 1
  10.     while a > 0 do
  11.         a = redstone.getAnalogInput("back")
  12.         if a == 14 then
  13.             clrmonitor()
  14.             monitor.write("Currently playing:")
  15.             monitor.setCursorPos(3,3)
  16.             monitor.write("Still Alive")
  17.             disk.playAudio("right")
  18.             b = 1
  19.         end
  20.         if a == 13 then
  21.             clrmonitor()
  22.             monitor.write("Currently playing:")
  23.             monitor.setCursorPos(3,3)
  24.             monitor.write("Want You Gone")
  25.             disk.playAudio("left")
  26.             b = 2
  27.         end
  28.         sleep(1.5)
  29.     end
  30. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement