Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. dSide = "bottom"
  2. title = disk.getAudioTitle(dSide)
  3. m = peripheral.wrap("left")
  4. m.setTextScale(0.5)
  5. dSide = "drive_1"
  6. m.setBackgroundColor(colors.black)
  7. m.setTextColor(colors.white)
  8. m.clear()
  9. m.setCursorPos(1,1)
  10. m.write("X Play")
  11. m.setCursorPos(1,2)
  12. m.write("X Stop")
  13. m.setCursorPos(1,3)
  14. m.write("X Edit")
  15. m.setCursorPos(1,4)
  16. m.write("X Exit")
  17. while true do
  18. event, side, x, y = os.pullEvent("monitor_touch")
  19. m.setCursorPos(1,6)
  20. m.clearLine()
  21. if x == 1 and y == 1 then
  22. m.setCursorPos(1,5)
  23. m.clearLine()
  24. if disk.hasAudio(dSide) then
  25. disk.playAudio(dSide)
  26. m.setCursorPos(1,6)
  27. m.write("Playing "..title)
  28. else
  29. m.setCursorPos(1,6)
  30. m.write("No Audio")
  31. end
  32. elseif x == 1 and y == 2 then
  33. shell.run("dj stop")
  34. elseif x == 1 and y == 3 then
  35. m.setCursorPos(1,3)
  36. m.write("X Edit - Editing...")
  37. shell.run("edit startup1")
  38. shell.run("startup")
  39. elseif x == 1 and y == 4 then
  40. shell.run("clear")
  41. disk.stopAudio("drive_0")
  42. m.setCursorPos(1,6)
  43. m.clearLine()
  44. m.write("Not Running...")
  45. shell.run("shell")
  46. end
  47. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement