Advertisement
guamie

Check&ClearInventory

Feb 19th, 2015
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.42 KB | None | 0 0
  1. -- Check&ClearInventory
  2.  
  3. function ClearInventory()
  4.     turtle.select(15)
  5.     turtle.dig()
  6. turtle.place()
  7. for i=1, 14 do
  8. turtle.select(i)
  9. turtle.drop()
  10. end
  11. turtle.select(15)
  12. turtle.dig()
  13. turtle.select(1)
  14. end
  15.  
  16. function CheckInventory()
  17. local InvFull = true
  18.  
  19. for i=1, 14 do
  20.     local InvCount = turtle.getItemCount(i)
  21.     if InvCount == 0 then
  22.     InvFull = false
  23.     end
  24. end
  25.  
  26. if InvFull then
  27.     ClearInventory()
  28.     return false
  29. end
  30. end
  31.  
  32. CheckInventory()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement