Advertisement
Guest User

Farm_test2

a guest
Apr 25th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.80 KB | None | 0 0
  1. --[[
  2. 12 X 12 farm
  3. ]]--
  4.  
  5.  
  6. local function move()
  7. turtle.digDown()
  8. slot=1
  9. while not turtle.placeDown() do
  10. turtle.select(slot)
  11. slot=slot+1
  12. if slot>16 then
  13. break
  14. end
  15. end
  16. while not turtle.forward() do
  17. sleep(1)
  18. end
  19. end
  20.  
  21.  
  22. local function move2()
  23. while not turtle.forward() do
  24. sleep(1)
  25. end
  26. end
  27.  
  28.  
  29. local function plow()
  30. while not turtle.up() do
  31. sleep(1)
  32. end
  33. move2()
  34.  
  35. for o = 1,6 do
  36.  
  37. for i = 1,12 do
  38. move()
  39. end
  40.  
  41. turtle.turnRight()
  42. move()
  43. turtle.turnRight()
  44. move()
  45.  
  46. for i = 1,12 do
  47. move()
  48. end
  49.  
  50. if not i==6 then
  51. turtle.turnLeft()
  52. move2()
  53. turtle.turnLeft()
  54. move2()
  55. end
  56. end
  57.  
  58. turtle.turnRight()
  59. move2()
  60. turtle.turnRight()
  61. move2()
  62.  
  63. for i = 1,11 do
  64. move2()
  65. end
  66.  
  67. turtle.turnRight()
  68.  
  69. while not turtle.down() do
  70. sleep(1)
  71. end
  72.  
  73. end
  74.  
  75.  
  76. local iRepeat = 0
  77. local iMin = 77
  78. local iCount = 0
  79. local spacer = ""
  80. while true do
  81. term.clear()
  82. term.setCursorPos(1,4)
  83. print("Fuel Remaning : "..tostring(turtle.getFuelLevel()))
  84. term.setCursorPos(1,1)
  85. iRepeat = iRepeat+1
  86. print("plowing :"..iRepeat)
  87. for i = 1,16 do
  88. turtle.select(i)
  89. turtle.refuel()
  90. end
  91. plow()
  92. turtle.turnRight()
  93. for slot=1,16 do
  94. turtle.select(slot)
  95. sleep(0.1)
  96. turtle.drop()
  97. end
  98. turtle.turnLeft()
  99. turtle.turnLeft()
  100. sleep(5)
  101. for i = 1,3 do
  102. sleep(1)
  103. turtle.suck()
  104. end
  105. turtle.turnRight()
  106. term.setCursorPos(1,4)
  107. print("Fuel Remaning : "..tostring(turtle.getFuelLevel()))
  108. iCount = iMin
  109. while true do
  110. iCount = iCount-1
  111. term.setCursorPos(1,2)
  112. term.clearLine()
  113. print("sleeping "..iMin.." minuites")
  114. for i = 59,0,-1 do
  115. sleep(1)
  116. term.setCursorPos(1,3)
  117. term.clearLine()
  118. if i < 10 then
  119. spacer = "0"
  120. else
  121. spacer = ""
  122. end
  123. write("To go "..iCount..":"..spacer..i)
  124. end
  125. if iCount == 0 then
  126. break
  127. end
  128. end
  129. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement