Iepoev

sugarcanefarm

Oct 31st, 2020 (edited)
1,613
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function goHome()
  2.     turtle.turnRight()
  3.     turtle.up()
  4.     turtle.up()
  5.     home = false
  6.     while not home do
  7.         turtle.forward()
  8.         bool, block = turtle.inspect()
  9.         if bool then
  10.             home = true
  11.         end
  12.     end
  13.     turtle.turnRight()
  14.     turtle.digDown()
  15.     turtle.down()
  16.     turtle.digDown()
  17.     turtle.down()
  18. end
  19.  
  20. while true do
  21.     bool, block = turtle.inspect()
  22.     if bool then
  23.         if block.name == "minecraft:sugar_cane" then
  24.             turtle.dig()
  25.             turtle.forward()
  26.         elseif block.name == "minecraft:oak_planks" then
  27.             turtle.turnRight()
  28.             turtle.forward()
  29.             bool, block = turtle.inspect()
  30.             if bool then
  31.                 turtle.dig()
  32.             end
  33.             turtle.forward()
  34.             turtle.turnRight()
  35.         elseif block.name == "minecraft:spruce_planks" then
  36.             turtle.turnLeft()
  37.             turtle.forward()
  38.             bool, block = turtle.inspect()
  39.             if bool then
  40.                 turtle.dig()
  41.             end
  42.             turtle.forward()
  43.             turtle.turnLeft()
  44.         elseif block.name == "minecraft:stone" then
  45.             goHome()
  46.         end
  47.     else
  48.         sleep(5)
  49.     end
  50. end
  51.  
  52.  
RAW Paste Data