RobotBubble

Turtle Ticket Taker

Jul 11th, 2018
54
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. os.pullEvent = os.pullEventRaw
  2. local success, data = turtle.inspect()
  3. if success then
  4. term.clear()
  5. term.setCursorPos(1,1)
  6. print(data.name)
  7. if data.name == "minecraft:gold_block" then
  8. print("ticket accepted")
  9. sleep(1)
  10. turtle.dig()
  11. sleep(.1)
  12. turtle.turnLeft()
  13. sleep(.1)
  14. turtle.turnLeft()
  15. sleep(.1)
  16. turtle.drop()
  17. sleep(1)
  18. turtle.turnRight()
  19. sleep(.1)
  20. turtle.turnRight()
  21. sleep(.1)
  22. redstone.setOutput("bottom", true)
  23. sleep(3.5)
  24. redstone.setOutput("bottom", false)
  25. os.reboot()
  26. elseif data.name == "minecraft:emerald_block" then
  27. term.clear()
  28. term.setCursorPos(1, 1)
  29. shell.run("dir")
  30. else
  31. print("block not accepted as ticket")
  32. sleep(1)
  33. turtle.dig()
  34. sleep(1)
  35. turtle.drop()
  36. sleep(1)
  37. os.reboot()
  38. end
  39. else
  40. sleep(1)
  41. term.clear()
  42. term.setCursorPos(1, 1)
  43. os.reboot()
  44. end
RAW Paste Data Copied