Advertisement
Guest User

Test

a guest
May 29th, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.58 KB | None | 0 0
  1. function checkSlot()
  2.   if turtle.getItemCount(turtle.getSelectedSlot()) == 0 then
  3.     selectNext()
  4.     for i = 1, 15 do
  5.       if turtle.getItemCount(turtle.getSelectedSlot()) > 0 then
  6.         return true
  7.       end
  8.       selectNext()
  9.     end
  10.     return false
  11.   end
  12.   return true
  13. end
  14.  
  15. function selectNext()
  16.   if turtle.getSelectedSlot() == 16 then
  17.     turtle.select(1)
  18.   else
  19.     turtle.select(turtle.getSelectedSlot() + 1)
  20.   end
  21. end
  22.  
  23. turtle.select(1)
  24. while true do
  25.   if not checkSlot() then break end
  26.   turtle.drop(1)
  27. end
  28.  
  29. print("Out of blocks. Program Terminating.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement