Guest User

Untitled

a guest
Sep 22nd, 2019
102
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. 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. refuel()
  36. harvest()
  37. prepare()
  38. plant()
  39. turtle.forward()
  40. end
  41.  
  42. function main()
  43. print("Starting")
  44. refuel()
  45. turtle.up()
  46. turtle.forward()
  47. turtle.turnRight()
  48.  
  49. for j=1,8 do
  50. for i=1,8 do
  51. work()
  52. end
  53. turnLeft()
  54. turtle.forward()
  55. for i=1,8 do
  56. work()
  57. end
  58. turnRight()
  59. turtle.forward()
  60. end
  61. turtle.turnRight()
  62. for i=1,16 do
  63. turtle.forward()
  64. end
  65. turtle.down()
  66. turtle.turnRight()
  67. turtle.turnRight()
  68. print("...Finished!")
  69. end
  70.  
  71.  
  72. main()
RAW Paste Data