nSun

turtle_column_gravel

Mar 26th, 2014
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.48 KB | None | 0 0
  1. local slot = 1
  2. local stack = 0
  3. local fail = 0
  4. turtle.select(slot)
  5. stack = turtle.getItemCount(slot)
  6. while turtle.getItemCount( slot ) > 0 do
  7.     if not turtle.placeDown() then
  8.         fail = fail + 1
  9.         if fail > 4 then
  10.             print("Abort")
  11.             return
  12.         end
  13.     else
  14.         stack = stack - 1
  15.         while stack <= 0 do
  16.             slot = slot + 1
  17.             if slot > 16 then
  18.                 print("Empty")
  19.                 return
  20.             end
  21.             stack = turtle.getItemCount(slot)
  22.         end
  23.         turtle.select(slot)
  24.     end
  25.     sleep(0.3)
  26. end
  27. print("Done")
Advertisement
Add Comment
Please, Sign In to add comment