Advertisement
Axow01

Untitled

Aug 12th, 2023 (edited)
1,120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.91 KB | None | 0 0
  1. function emptyYourself()
  2.     local b = 0;
  3.     for i = 1, 16, 1 do
  4.         b = b + turtle.getItemCount(i)
  5.     end
  6.     if (b == 0) then
  7.         return
  8.     end
  9.     turtle.turnLeft()
  10.     if (turtle.detect()) then
  11.         turtle.turnRight()
  12.         turtle.turnRight()
  13.     end
  14.     local test, datatest = turtle.inspect()
  15.     while (datatest.name ~= "minecraft:chest") do
  16.         turtle.forward()
  17.         test, datatest = turtle.inspect()
  18.     end
  19.     for i = 1, 16, 1 do
  20.         turtle.select(i)
  21.         turtle.drop()
  22.     end
  23.     turtle.turnRight()
  24.     turtle.turnRight()
  25.     while (turtle.detect() == false) do
  26.         turtle.forward()
  27.     end
  28.     turtle.turnLeft()
  29. end
  30.  
  31. while (true) do
  32.     local success, tableshit = turtle.inspect()
  33.     local s, downData = turtle.inspectDown()
  34.  
  35.     if (turtle.suck()) then
  36.         turtle.suckDown()
  37.         turtle.suckUp()
  38.     end
  39.     if (success) then
  40.         turtle.turnLeft()
  41.         turtle.turnLeft()
  42.     end
  43.     if (downData.name == "minecraft:planks") then
  44.         emptyYourself()
  45.     end
  46.     turtle.forward()
  47. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement