Advertisement
Captain_Admiral

Untitled

Apr 22nd, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. farmer = peripheral.wrap("right")
  2.  
  3. function resetPos()
  4. local flag,data
  5. while true do
  6. while turtle.forward() do
  7. end
  8.  
  9. flag,data = turtle.inspect()
  10.  
  11. if flag and data.name == "minecraft:chest" then
  12. break
  13. end
  14.  
  15. turtle.turnRight()
  16. end
  17. for i=2, 16 do
  18. turtle.select(i)
  19. turtle.drop()
  20. end
  21. turtle.turnRight()
  22. end
  23.  
  24. while true do
  25. turtle.select(1)
  26. local flag,data = turtle.inspect()
  27.  
  28. if farmer.getGrowthDown() == 100 then
  29. turtle.digDown()
  30. turtle.placeDown()
  31. end
  32.  
  33. if flag then
  34. if data.name=="minecraft:stone" then
  35. turtle.turnRight()
  36. if not turtle.forward() then
  37. resetPos()
  38. end
  39. turtle.turnRight()
  40. elseif data.name=="minecraft:cobblestone" then
  41. turtle.turnLeft()
  42. if not turtle.forward() then
  43. resetPos()
  44. else
  45. turtle.turnLeft()
  46. end
  47. else
  48. resetPos()
  49. end
  50. else
  51. while not turtle.forward() do
  52. end
  53. end
  54. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement