Advertisement
Guest User

swag

a guest
May 30th, 2015
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. shell.run('clear')
  2. print("Please put Dirt in Slot 1, Saplings in Slot 2, and a log in Slot 3.")
  3. print("Number of Trees To Plant?")
  4. local x = io.read()
  5. local dirt, sapling, log = 1, 2, 3
  6.  
  7. turtle.up()
  8. turtle.turnLeft()
  9. turtle.turnLeft()
  10. turtle.back()
  11. turtle.back()
  12. turtle.back()
  13.  
  14. for i = 0, x do
  15. turtle.digDown()
  16. turtle.select(dirt)
  17. turtle.placeDown()
  18. turtle.back()
  19. turtle.select(sapling)
  20. turtle.place()
  21. turtle.back()
  22. turtle.back()
  23. turtle.back()
  24. end
  25. turtle.turnLeft()
  26. turtle.forward()
  27. turtle.turnRight()
  28.  
  29. while true do
  30. -- sleep for 30 seconds
  31. os.sleep(30)
  32. for i = 0, x do
  33. turtle.forward()
  34. turtle.forward()
  35. turtle.forward()
  36. turtle.forward()
  37. turtle.turnRight()
  38. turtle.select(log)
  39. if turtle.compare() then
  40. turtle.dig()
  41. turtle.forward()
  42. while turtle.detectUp() do
  43. turtle.digUp()
  44. turtle.up()
  45. end
  46. while not turtle.detectDown() do
  47. turtle.down()
  48. end
  49. turtle.back()
  50. turtle.select(sapling)
  51. turtle.place()
  52. end
  53. turtle.turnLeft()
  54. end
  55. turtle.forward()
  56. turtle.turnRight()
  57. turtle.forward()
  58. turtle.forward()
  59. turtle.turnRight()
  60. turtle.forward()
  61. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement