originalceebs

[FUNCTION] Inventory Sort

Jan 7th, 2021
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. --[[
  2.  
  3. Script Created by CEEBS
  4. YouTube: https://www.youtube.com/channel/UCQvB8QBknoS1jYgwpYGQrQg
  5. Twitter: https://twitter.com/OnlyCeebs
  6.  
  7. Really appreciate all the support you have given me, so thank you!
  8.  
  9. ]]--
  10.  
  11. local INVENTORY_SIZE = 16
  12.  
  13. function inventorySort()
  14. for i = 1, INVENTORY_SIZE do
  15. local currentItem = turtle.getItemDetail(i)
  16.  
  17. if currentItem ~= nil then
  18. turtle.select(i)
  19.  
  20. for j = i, INVENTORY_SIZE do
  21. if turtle.compareTo(j) then
  22. turtle.select(j)
  23. turtle.transferTo(i)
  24. turtle.select(i)
  25. end
  26. end
  27. end
  28. end
  29. end
  30.  
  31. inventorySort()
Advertisement
Add Comment
Please, Sign In to add comment