Advertisement
Guest User

smistamento

a guest
May 29th, 2015
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.41 KB | None | 0 0
  1. -- prendi dallo scrigno
  2. -- se ci sono oggetti smistali
  3. -- se gli inventari sono pieni cambiali
  4.  
  5.  
  6.  
  7. function smistaDaScrigno()
  8.  
  9.     turtle.turnRight()
  10.     turtle.turnRight()
  11.     for i = 1,3 do
  12.         turtle.select(i)
  13.         turtle.suck()
  14.     end
  15.     turtle.turnLeft()
  16.     turtle.turnLeft()
  17.     if turtle.getItemCount(1) > 0 then
  18.         turtle.forward()
  19.         turtle.turnLeft()
  20.         turtle.forward()
  21.         turtle.turnLeft()
  22.         turtle.select(1)
  23.         turtle.drop()
  24.         turtle.select(2)
  25.         turtle.drop()
  26.         turtle.select(3)
  27.         turtle.drop()
  28.                    
  29.         if turtle.getItemCount(1) > 0 or turtle.getItemCount(2) > 0 or turtle.getItemCount(3) > 0 then
  30.             turtle.turnRight()
  31.             turtle.forward()
  32.             turtle.turnLeft()
  33.             turtle.select(1)
  34.             turtle.drop()
  35.             turtle.select(2)
  36.             turtle.drop()
  37.             turtle.select(3)
  38.             turtle.drop()
  39.                        
  40.             if turtle.getItemCount(1) > 0 or turtle.getItemCount(2) > 0 or turtle.getItemCount(3) > 0 then
  41.                 turtle.turnRight()
  42.                 turtle.forward()
  43.                 turtle.turnLeft()
  44.                 turtle.select(1)
  45.                 turtle.drop()
  46.                 turtle.select(2)
  47.                 turtle.drop()
  48.                 turtle.select(3)
  49.                 turtle.drop()
  50.                 turtle.turnLeft()
  51.                 turtle.forward()
  52.                 turtle.forward()
  53.                 turtle.forward()
  54.                 turtle.turnRight()
  55.                 turtle.forward()
  56.                 turtle.turnLeft()
  57.                 turtle.turnLeft()
  58.                            
  59.                        
  60.             end
  61.         end
  62.     end
  63. end
  64.  
  65. while true do
  66.     os.pullEvent("redstone")
  67.     if true then
  68.         smistaDaScrigno()
  69.     end
  70. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement