mjmac85

Holes

Dec 26th, 2013
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.39 KB | None | 0 0
  1.  
  2.  
  3. local function fuel()
  4.     turtle.select(16)
  5.     turtle.refuel(1)
  6.  
  7. end
  8.  
  9. local function dig()
  10.     fuel()
  11.     turtle.dig()
  12.    
  13. end
  14.  
  15. local function move()
  16.     --Checking for fuel
  17.     while turtle.getFuelLevel() <= 5 do
  18.         fuel()
  19.     end
  20.     turtle.forward()
  21.  
  22. end
  23.  
  24. local function dropInv(depth)
  25.     local i
  26.    
  27.     i = 0
  28.     while i < depth do
  29.         fuel()
  30.         turtle.up()
  31.     end
  32. end
  33.  
  34. local function done(depth)
  35.     local i
  36.    
  37.     i = 0
  38.     while i < depth do
  39.         fuel()
  40.         turtle.up()
  41.         i = i + 1
  42.     end
  43. end
  44.  
  45. local function Main()
  46.     local depth = 0
  47.     local i
  48.     while true do
  49.         fuel()
  50.         dig()
  51.         turtle.turnRight()
  52.         dig()
  53.         turtle.turnLeft()
  54.         dig()
  55.         turtle.forward()
  56.         turtle.turnRight()
  57.         dig()
  58.         turtle.turnLeft()
  59.         turtle.back()
  60.         turtle.back()
  61.         turtle.digDown()
  62.        
  63.         if turtle.getItemCount(4) >= 1 then
  64.             rednet.broadcast("dropping inventory")
  65.             dropInv(depth)
  66.        
  67.         end
  68.         if turtle.down() == false then
  69.                 rednet.broadcast("Hit bottom!")
  70.                 done(depth)
  71.                 rednet.broadcast("e")
  72.                 break
  73.         end
  74.         depth = depth + 1
  75.     end
  76.    
  77. end
  78. local side = "right"
  79. rednet.open(side)
  80. rednet.broadcast("Connected")
  81. Main()
Advertisement
Add Comment
Please, Sign In to add comment