tterrag1098

branch 1.1

Jun 9th, 2013
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local tArgs = {...}
  2. local length = tArgs[1]
  3. local numTunnels = tArgs[2]
  4. local inv = true
  5. local checkTorch = 0
  6.  
  7. function tunnel()
  8.   for i=1,length do
  9.     turtle.dig()
  10.     while turtle.forward() == false do
  11.       turtle.dig()
  12.     end
  13.     turtle.digUp()
  14.     torch()
  15.   end
  16. end
  17.  
  18. function turnAround()
  19.   for k = 1,6 do
  20.     turtle.dig()
  21.     while turtle.forward() == false do
  22.       turtle.dig()
  23.     end
  24.     turtle.digUp()
  25.     torch()
  26.   end
  27.  
  28.   checkInv()
  29.  
  30.   turtle.back()
  31.   turtle.back()
  32.   turtle.back()
  33. end
  34.  
  35. function checkInv()
  36.   for y = 2,16 do
  37.     turtle.select(y)
  38.     if turtle.compareTo(1) then
  39.       turtle.drop()
  40.     end
  41.   end
  42. end
  43.  
  44. function torch()
  45.   if checkTorch == 10 then
  46.     turtle.select(16)
  47.     turtle.up()
  48.     turtle.digUp()
  49.     if turtle.placeUp() then
  50.         turtle.down()
  51.         turtle.select(1)
  52.         checkTorch = 0
  53.     else
  54.         torch()
  55.     end
  56.   else
  57.     checkTorch = checkTorch + 1
  58.   end
  59. end
  60.      
  61. for j = 1,numTunnels do
  62.   tunnel()
  63.   turtle.turnLeft()
  64.   turnAround()
  65.   turtle.turnLeft()
  66.   tunnel()
  67.   turtle.turnRight()
  68.   turnAround()
  69.   turtle.turnRight()
  70. end
Advertisement
Add Comment
Please, Sign In to add comment