farm

Download Raw Clone


  1. function checkForward()
  2. local successWood, dataWood = turtle.inspect()
  3. if successWood then
  4. if dataWood.name == "minecraft:planks" then
  5. turtle.turnLeft()
  6. turtle.forward()
  7. turtle.turnLeft()
  8. checkBelow()
  9. end
  10. if dataWood.name == "minecraft:cobblestone" then
  11. turtle.turnRight()
  12. turtle.forward()
  13. turtle.turnRight()
  14. checkBelow()
  15. end
  16. if dataWood.name == "minecraft:log" then
  17. turtle.turnLeft()
  18. end
  19. end
  20. end
  21. function checkBelow()
  22. local success, data = turtle.inspectDown()
  23. if success then
  24. print(data.metadata)
  25. if data.name == "minecraft:chest" then
  26. for i = 16,1,-1 do
  27. turtle.select(i)
  28. turtle.dropDown()
  29. end
  30. refuelFromChest()
  31. print("Fuel level : " .. tostring(turtle.getFuelLevel()))
  32. sleep(1200)
  33. turtle.forward()
  34. end
  35. if data.name == "immersiveengineering:hemp" and data.metadata == 5 then
  36. turtle.select(2)
  37. turtle.digDown()
  38. end
  39. end
  40. end
  41. function refuelFromChest()
  42. turtle.select(1)
  43. turtle.suckDown()
  44. turtle.dropDown(1)
  45. turtle.refuel()
  46. end
  47. while true do
  48. turtle.forward()
  49. checkBelow()
  50. checkForward()
  51. end

Raw paste data: