Jharii

bTunnel

Jan 22nd, 2013
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.96 KB | None | 0 0
  1. local tArgs = { ... }
  2. count = tArgs[1]
  3.  
  4. function betterDig()
  5.   while turtle.detect() do
  6.     turtle.dig()
  7.     sleep(.5)
  8.   end
  9. end
  10.  
  11. function betterDigUp()
  12.   while turtle.detectUp() do
  13.     turtle.digUp()
  14.     sleep(.5)
  15.   end
  16. end
  17.  
  18. function digLeftRight()
  19.   turtle.turnLeft()
  20.   betterDig()
  21.   turtle.turnRight()
  22.   turtle.turnRight()
  23.   betterDig()
  24.   turtle.turnLeft()
  25. end
  26.  
  27. function digForward()
  28.   betterDig()
  29.   turtle.forward()
  30. end
  31.  
  32. function digUp()
  33.   betterDigUp()
  34.   turtle.up()
  35. end
  36.  
  37. function returnHome()
  38.   turtle.turnLeft()
  39.   turtle.turnLeft()
  40.   for i = 1,count do
  41.     turtle.forward()
  42.   end
  43. end
  44.  
  45. function placeTorch()
  46.   turtle.turnRight()
  47.   turtle.select(16)
  48.   turtle.place()
  49.   turtle.select(1)
  50.   turtle.turnLeft()
  51. end
  52.  
  53. for i = 1,count do
  54.   digForward()
  55.   digUp()
  56.   digUp()
  57.   digLeftRight()
  58.   turtle.down()
  59.   digLeftRight()
  60.   turtle.down()
  61.   digLeftRight()
  62.   if i%6 == 0 then
  63.     placeTorch()
  64.   end
  65. end
  66.  
  67. returnHome()
Advertisement
Add Comment
Please, Sign In to add comment