Advertisement
aynoblo

treeKiller

Apr 19th, 2020
1,203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.76 KB | None | 0 0
  1. while true do
  2.     local success,data=turtle.inspectDown()
  3.     if success then
  4.         if data.name=="forestry:resource_storage" then
  5.             print("turn right")
  6.             turtle.turnRight()
  7.             turtle.forward()
  8.         elseif data.name=="minecraft:redstone_block" then
  9.             print("turn left")
  10.             turtle.turnLeft()
  11.             turtle.forward()
  12.         elseif data.name=="appliedenergistics2:quartz_block" or data.name=="minecraft:quartz_block" then
  13.             print("tree")
  14.             turtle.turnRight()
  15.             local osef, log = turtle.inspect()
  16.             turtle.select(15)
  17.             if turtle.compare() then
  18.                 for i=1,6 do
  19.                     turtle.select(1)
  20.                     turtle.digUp()
  21.                     turtle.dig()
  22.                     turtle.up()
  23.                 end
  24.                 turtle.select(16)
  25.                 for i=1,6 do
  26.                     turtle.down()
  27.                 end
  28.                 turtle.place()
  29.             else
  30.                 turtle.select(16)
  31.                 turtle.place()
  32.             end
  33.             turtle.select(1)
  34.             turtle.turnLeft()
  35.             turtle.forward()
  36.         elseif data.name=="minecraft:chest" then
  37.             print("chest")
  38.             turtle.turnLeft()
  39.             turtle.up()
  40.             for i=1,10 do
  41.                 turtle.select(i)
  42.                 if turtle.getItemCount()~=0 then
  43.                     if turtle.getItemDetail().name =="minecraft:log" then
  44.                         turtle.drop()
  45.                     end
  46.                 end
  47.             end        
  48.             turtle.down()
  49.             turtle.turnRight()
  50.             turtle.turnRight()
  51.             turtle.turnLeft()
  52.             turtle.forward()
  53.             for i=1,10 do
  54.                 turtle.select(i)
  55.                 if turtle.getItemCount()~=0 then
  56.                     if turtle.getItemDetail().name =="minecraft:sapling" then
  57.                         turtle.drop()
  58.                     end
  59.                 end
  60.             end
  61.             if turtle.getItemCount(16)<20 then
  62.                 turtle.select(16)
  63.                 local needed=50-turtle.getItemCount()
  64.                 turtle.suck(needed)
  65.             end
  66.             turtle.turnRight()
  67.             turtle.turnRight()
  68.             turtle.forward()
  69.             turtle.turnLeft()
  70.             turtle.forward()
  71.             turtle.forward()
  72.         else
  73.             print("nothing, forward")
  74.             turtle.forward()
  75.         end
  76.     end
  77. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement