Advertisement
MCPaule

Untitled

Sep 21st, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 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 doWork()
  35. for i=1,7 do
  36. harvest()
  37. prepare()
  38. plant()
  39. turtle.forward()
  40. end
  41. harvest()
  42. prepare()
  43. plant()
  44. end
  45.  
  46. function work()
  47. turtle.turnRight()
  48. for j=1,3 do
  49. for i=1,4 do
  50. doWork()
  51. turnLeft()
  52. doWork()
  53. turnRight()
  54. end
  55. turtle.up()
  56. turnRight()
  57. end
  58. end
  59.  
  60. function main()
  61. print("Starting")
  62. refuel()
  63. turtle.up()
  64. turtle.up()
  65. turtle.forward()
  66. turtle.forward()
  67. work()
  68. print("end")
  69. end
  70.  
  71.  
  72. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement