Advertisement
Guest User

Untitled

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