Advertisement
montana_1

sortInv

Oct 25th, 2014
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.37 KB | None | 0 0
  1. function sortInv()
  2.     for i = 1, 16 do -- loop through the slots
  3.         turtle.select(i)
  4.         if(turtle.getItemDetail(i) ~= nil) then
  5.             for c = i, 16 do
  6.                 if(turtle.getItemDetail(c) ~= nil) then
  7.                     if(turtle.compareTo(c)) then
  8.                         turtle.select(c)
  9.                         turtle.transferTo(i)
  10.                         turtle.select(i)
  11.                     end
  12.                 end
  13.             end
  14.         end
  15.     end
  16.     turtle.select(1)
  17. end
  18.  
  19. sortInv()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement