Advertisement
bueddl

Untitled

Jun 10th, 2013
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.89 KB | None | 0 0
  1.  
  2. turtle.cleanInventory = function(mod)
  3.    
  4.     -- turn around, dig 3 forward and drop all shit here
  5.     turtle.turnRight()
  6.     turtle.turnRight()
  7.    
  8.     turtle.saveDig()
  9.     turtle.saveForward()
  10.     turtle.saveDig()
  11.     turtle.saveForward()
  12.     turtle.saveDig()
  13.  
  14.     if mod==0 then
  15.         turtle.saveDig()
  16.         turtle.saveForward()
  17.     end
  18.    
  19.     turtle.saveDigDown()
  20.    
  21.     for i = 1,4 do
  22.    
  23.         turtle.select(i)
  24.        
  25.         -- drop all but one
  26.        
  27.         --turtle.dropDown( turtle.getItemCount(i)-1 )
  28.        
  29.         for j = 5,16 do
  30.        
  31.             turtle.select(j)
  32.            
  33.             -- compare to  good
  34.             if not turtle.compareTo(i) then
  35.                 -- drop all trash
  36.                 turtle.dropDown()
  37.             end
  38.        
  39.         end
  40.    
  41.     end
  42.    
  43.     -- go back to original pos
  44.    
  45.     turtle.turnRight()
  46.     turtle.turnRight()
  47.    
  48.    
  49.     if mod==0 then
  50.         turtle.saveDig()
  51.         turtle.saveForward()
  52.     end
  53.    
  54.     turtle.saveDig()
  55.     turtle.saveForward()
  56.     turtle.saveDig()
  57.     turtle.saveForward()
  58.     turtle.saveDig()
  59. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement