Maschini

bridge

Feb 24th, 2023 (edited)
726
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.47 KB | None | 0 0
  1. function findMaterial()
  2.     if turtle.getItemCount() > 0 then
  3.         return
  4.     end
  5.  
  6.     for i = 1, 16, 1 do
  7.         turtle.select(i)
  8.         local count = turtle.getItemCount()
  9.         if count > 0 then
  10.             return
  11.         end
  12.     end
  13. end
  14.  
  15. local length = 0;
  16.  
  17. while not turtle.detect() do
  18.     findMaterial()
  19.     turtle.placeDown()
  20.     if turtle.forward() then
  21.         length = length + 1
  22.     end
  23. end
  24.  
  25. for i = 1, length, 1 do
  26.     turtle.back()
  27. end
Advertisement
Add Comment
Please, Sign In to add comment