MCPaule

Untitled

Sep 21st, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. function refuel()
  2. if turtle.getFuelLevel() == 0 then
  3. turtle.select(1)
  4. turtle.refuel(1)
  5. print("refueling")
  6. end
  7. end
  8.  
  9. function plant()
  10. turtle.select(2)
  11. turtle.placeDown()
  12. end
  13.  
  14. function harvest()
  15. turtle.digDown()
  16. end
  17.  
  18. function prepare()
  19. turtle.attackDown()
  20. end
  21.  
  22. function turnLeft()
  23. turtle.turnLeft()
  24. turtle.forward()
  25. turtle.turnLeft()
  26. end
  27.  
  28. function turnRight()
  29. turtle.turnRight()
  30. turtle.forward()
  31. turtle.turnRight()
  32. end
  33.  
  34. function work()
  35. turtle.turnRight()
  36.  
  37. for i=1,7 do
  38. harvest()
  39. prepare()
  40. plant()
  41. turtle.forward()
  42. end
  43.  
  44. turnLeft()
  45.  
  46. for i=1,7 do
  47. harvest()
  48. prepare()
  49. plant()
  50. turtle.forward()
  51. end
  52.  
  53. turnRight()
  54.  
  55. for i=1,8 do
  56. harvest()
  57. prepare()
  58. plant()
  59. turtle.forward()
  60. end
  61.  
  62. turnLeft()
  63.  
  64. end
  65.  
  66. function main()
  67. print("Starting")
  68. refuel()
  69. turtle.up()
  70. turtle.up()
  71. turtle.forward()
  72. turtle.forward()
  73. work()
  74. print("end")
  75. end
  76.  
  77.  
  78. main()
Add Comment
Please, Sign In to add comment