Advertisement
Lanzr

place sand

May 11th, 2023 (edited)
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.70 KB | None | 0 0
  1. local emptyFlag =false
  2. local bkslot = 2
  3. while 1 do
  4.     -- check fuel
  5.     if(turtle.getFuelLevel() < 100) then
  6.         turtle.select(1)
  7.         turtle.refuel(1)
  8.     end
  9.     -- check space
  10.     turtle.select(bkslot)
  11.     if(emptyFlag == false) then
  12.         while (turtle.getItemCount() == 0) do
  13.             bkslot = bkslot + 1
  14.             if(turtle.getItemCount(2) ~= 0) then
  15.                 bkslot = 2
  16.                 break
  17.             end
  18.             if(bkslot > 16) then
  19.                 exit()
  20.             end
  21.             turtle.select(bkslot)
  22.         end
  23.     end
  24.     -- check block
  25.     if(turtle.detectDown()) then
  26.         select(10)
  27.     end
  28.     turtle.place()
  29.     turtle.placeDown()
  30. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement