Advertisement
Guest User

tunnelplus

a guest
Mar 29th, 2020
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.03 KB | None | 0 0
  1. args = {...}
  2. tunnelDistance = args[1]
  3.  
  4. function dig()
  5.   if turtle.detect() then
  6.     turtle.dig()
  7.   end
  8. end
  9.  
  10. function digUp()
  11.   if turtle.detectUp() then
  12.     turtle.digUp()
  13.   end
  14. end
  15.  
  16. function digDown()
  17.   if turtle.detectDown() then
  18.     turtle.digDown()
  19.   end
  20. end
  21.  
  22. function DigHole(count)
  23.   for n=0,count do
  24.     turtle.turnLeft()
  25.     turtle.forward()
  26.     turtle.turnRight()
  27.     dig()
  28.     turtle.up()
  29.     dig()
  30.     turtle.up()
  31.     dig()
  32.     turtle.turnRight()
  33.     turtle.forward()
  34.     turtle.turnLeft()
  35.     dig()
  36.     turtle.down()
  37.     dig()
  38.     turtle.down()
  39.     dig()
  40.     turtle.turnRight()
  41.     turtle.forward()
  42.     turtle.turnLeft()
  43.     dig()
  44.     turtle.up()
  45.     dig()
  46.     turtle.up()
  47.     dig()
  48.     turtle.down()
  49.     turtle.down()
  50.     turtle.turnLeft()
  51.     turtle.forward()
  52.     turtle.turnRight()
  53.     turtle.forward()
  54.     turtle.turnLeft()
  55.     turtle.forward()
  56.     dig()
  57.     turtle.select(2)
  58.     turtle.place()
  59.     turtle.up()
  60.     dig()
  61.     turtle.place()
  62.     turtle.up()
  63.     dig()
  64.     turtle.place()
  65.     turtle.select(4)
  66.     digUp()
  67.     turtle.placeUp()
  68.     turtle.turnLeft()
  69.     turtle.turnLeft()
  70.     turtle.forward()
  71.     digUp()
  72.     turtle.placeUp()
  73.     turtle.forward()
  74.     digUp()
  75.     turtle.placeUp()
  76.     turtle.select(2)
  77.     dig()
  78.     turtle.place()
  79.     turtle.down()
  80.     dig()
  81.     turtle.place()
  82.     turtle.down()
  83.     dig()
  84.     turtle.place()
  85.     turtle.turnLeft()
  86.     turtle.turnLeft()
  87.     turtle.select(3)
  88.     digDown()
  89.     turtle.select(3)
  90.     turtle.placeDown()
  91.     turtle.forward()
  92.     digDown()
  93.     turtle.placeDown()
  94.     turtle.forward()
  95.     digDown()
  96.     turtle.placeDown()
  97.     turtle.turnLeft()
  98.     turtle.turnLeft()
  99.     turtle.forward()
  100.     turtle.turnLeft()
  101.   end
  102. end
  103.  
  104. print("----------")
  105. print("slot1: fuel")
  106. print("slot2: side blocks")
  107. print("slot3: floor blocks")
  108. print("slot4: ceiling blocks")
  109. print("----------")
  110. print()
  111. print("press any key to start...")
  112. os.pullEvent("key")
  113.  
  114. turtle.select(1)
  115. turtle.refuel()
  116. DigHole(tunnelDistance - 1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement