Advertisement
Slinger0001

Farming Army

Dec 4th, 2020 (edited)
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.21 KB | None | 0 0
  1. --T3wjGB1J
  2. shell.run('clear')
  3. local Fuel = turtle.getFuelLevel()
  4. print("Current Fuel Level " ..Fuel)
  5.  
  6. local length = 16
  7. local width = 16
  8. local counter =0
  9. local widthcount=1
  10. local direction =0
  11. local gohome=0
  12. local dropitem=2
  13. if Fuel==0 then
  14. turtle.refuel(30)
  15. else
  16. turtle.up()
  17. while counter<length do
  18. print("counter "..counter)
  19. print("Width "..width)
  20. print("Widthcount "..widthcount)
  21. print("direction ".. direction)
  22.  
  23. turtle.forward()
  24. turtle.digDown()
  25. turtle.placeDown()
  26. counter=counter+1
  27. if counter==length then
  28. if widthcount<width then
  29. if widthcount==8 then
  30. turtle.turnLeft()
  31. turtle.forward()
  32. turtle.forward()
  33. widthcount= widthcount+1
  34. counter=0
  35. turtle.turnLeft()
  36. direction=0
  37. else
  38. if direction==0 then
  39. turtle.turnRight()
  40. turtle.forward()
  41. turtle.digDown()
  42. turtle.placeDown()
  43. turtle.turnRight()
  44. direction=1
  45. counter=0
  46. widthcount = widthcount+1
  47. else
  48. turtle.turnLeft()
  49. turtle.forward()
  50. turtle.digDown()
  51. turtle.placeDown()
  52. turtle.turnLeft()
  53. direction=0
  54. counter=0
  55. widthcount = widthcount+1
  56. end
  57. end
  58. end
  59. end
  60.  
  61. end
  62. turtle.turnRight()
  63. while gohome<17 do
  64. turtle.forward()
  65. gohome = gohome +1
  66. end
  67. turtle.down()
  68. while dropitem<7 do
  69. turtle.select(dropitem)
  70. turtle.drop()
  71. dropitem = dropitem +1
  72. end
  73. dropitem=2
  74. turtle.back()
  75. turtle.select(1)
  76. turtle.turnRight()
  77. length = 16
  78. width = 16
  79. counter =0
  80. widthcount=1
  81. direction =0
  82. gohome=0
  83.  
  84. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement