Advertisement
Guest User

mine

a guest
Oct 20th, 2014
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.97 KB | None | 0 0
  1. emptyInv = function()
  2.   while(1) do
  3.     if not turtle.detectUp() then
  4.       turtle.up()
  5.     else
  6.       local steps = 0
  7.       turtle.turnRight()
  8.       turtle.turnRight()
  9.       while(1) do
  10.         if not turtle.detect() then
  11.           turtle.forward()
  12.           steps = steps + 1
  13.         else
  14.           for i = 1,16,1 do
  15.             turtle.select(i)
  16.             turtle.dropUp()
  17.           end
  18.           break
  19.         end
  20.       end
  21.       turtle.turnRight()
  22.       turtle.turnRight()
  23.       for j = 1,(steps+1),1 do
  24.         turtle.forward()
  25.       end
  26.       break
  27.     end
  28.   end
  29. end
  30. local arg = {...}
  31. emptyInv()
  32. for i = 1,arg[1],1 do
  33.   while(1) do
  34.     turtle.select(1)
  35.     if turtle.detectDown() and turtle.digDown() then
  36.     elseif not turtle.detectDown() then
  37.     else
  38.       emptyInv()
  39.       break
  40.     end
  41.  
  42.     if turtle.getItemCount(16) > 0 then
  43.       emptyInv()
  44.     end
  45.  
  46.     turtle.down()
  47.   end
  48.   while turtle.detect() do
  49.     turtle.dig()
  50.   end
  51. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement