Advertisement
farsidejake

tunnel

Sep 24th, 2012
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.70 KB | None | 0 0
  1. --3x3 tunnel Digger
  2. --By: farsidejake
  3.  
  4. local function digy()
  5.   while turtle.detect() == true  do
  6.     turtle.dig()
  7.     os.sleep(0.5)
  8.   end
  9. end
  10.  
  11. local function ahead()
  12.   digy()
  13.   --os.sleep(2)
  14.   turtle.forward()
  15. end
  16.  
  17. local function sides()
  18.   turtle.turnLeft()
  19.   digy()
  20.   turtle.turnRight()
  21.   turtle.turnRight()
  22.   digy()
  23.   turtle.turnLeft()
  24.  -- turtle.digUp()
  25. end
  26.  
  27. local function torch()
  28.  
  29. end
  30.  
  31. --Main Program
  32.  
  33. local tArgs = { ... }
  34. -- Check if I have too many args or too fue
  35.  
  36.  
  37. local length = tArgs[1]
  38.  
  39. for i = 1, length do
  40.   ahead()
  41.   for x = 1, 3 do
  42.     sides()
  43.     if x < 3 then
  44.       turtle.digUp()
  45.       turtle.up()
  46.     end
  47.   end
  48.   turtle.down()
  49.   turtle.down()
  50. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement