SHARE
TWEET

Untitled

a guest Mar 19th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function forward()
  2.     while not turtle.forward() do
  3.         turtle.dig()
  4.         turtle.attack()
  5.     end
  6. end
  7. function downward()
  8.     while not turtle.down() do
  9.         turtle.digDown()
  10.         turtle.attackDown()
  11.     end
  12. end
  13. function upward()
  14.     while not turtle.up() do
  15.         turtle.digUp()
  16.         turtle.attackUp()
  17.     end
  18. end
  19. function selectItem(item)
  20.     for i=1, 16 do
  21.         local d = turtle.getItemDetail(i)
  22.         if d ~= nil then
  23.             if d.name == "minecraft:"..item then
  24.                 turtle.select(i)
  25.                 return true
  26.             end
  27.         end
  28.     end
  29.     return false
  30. end
  31. function isLog(s,d)
  32.     local s,d = turtle.inspect()
  33.     if s then
  34.         if d.name == "minecraft:log" and d.damage == 15 then
  35.             return true
  36.         end
  37.     end
  38.     return false
  39. end
  40. function isLogUp()
  41.     local s,d = turtle.inspectUp()
  42.     if s then
  43.         if d.name == "minecraft:log" and d.damage == 15 then
  44.             return true
  45.         end
  46.     end
  47.     return false
  48. end
  49. function farmWood()
  50.     if isBlock(turtle.inspect()) then
  51.         forward()
  52.         while isLogUp() do
  53.             upward()
  54.         end
  55.         while turtle.down() do end
  56.         turtle.back()
  57.     end
  58. end
  59. while true do
  60.     selectItem("sapling")
  61.     turtle.place()
  62.     selectItem("dye")
  63.     while not isLog() do
  64.         turtle.place()
  65.     end
  66.     farmWood()
  67. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top