tarnovsky

Water Tunnel

Jan 2nd, 2024 (edited)
855
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. args = {...}
  2. intDigDistance = tonumber(args[1])
  3. function dig()
  4.     while(turtle.detect() == true)
  5.     do
  6.         turtle.dig()
  7.     end
  8. end
  9. function digUp()
  10.     while(turtle.detectUp() == true)
  11.     do
  12.         turtle.digUp()
  13.     end
  14. end
  15. function digDown()
  16.     while(turtle.detectDown() == true)
  17.     do
  18.         turtle.digDown()
  19.     end
  20. end
  21. function mine()
  22.     dig()
  23.     turtle.turnLeft()
  24.     dig()
  25.     turtle.turnRight()
  26.     turtle.turnRight()
  27.     dig()
  28.     turtle.turnLeft()
  29. end
  30. function water()
  31.     turtle.select(1)
  32.     turtle.place()
  33.     turtle.turnLeft()
  34.     turtle.select(2)
  35.     turtle.place()
  36.     turtle.turnRight()
  37.     turtle.turnRight()
  38.     turtle.select(3)
  39.     turtle.place()
  40.     turtle.turnRight()
  41.     turtle.select(1)
  42.     turtle.place()
  43.     turtle.select(2)
  44.     turtle.place()
  45.     turtle.select(3)
  46.     turtle.place()
  47.     turtle.turnRight()
  48.     turtle.turnRight()
  49. end
  50. x = 0
  51. while(x < intDigDistance)
  52. do
  53.     mine()
  54.     water()
  55.     turtle.up()
  56.     mine()
  57.     turtle.down()
  58.     turtle.forward()
  59.     x = x + 1
  60. end
Advertisement
Add Comment
Please, Sign In to add comment