Facebook
From i don't know man, 2 Months ago, written in Plain Text.
This paste is a reply to 3x3 with torches minig turtle from i don't know man - view diff
Embed
Download Paste or View Raw
Hits: 52
  1. function digIt()
  2.   while turtle.detect() do
  3.     turtle.dig()
  4.     os.sleep(0.5)
  5.   end
  6.   turtle.forward()
  7.   while turtle.detectDown() or turtle.detectUp() do
  8.     turtle.digUp()
  9.     turtle.digDown()
  10.   end
  11. end
  12.  
  13. function placeTorch()
  14.   turtle.select(16)
  15.   turtle.placeUp()
  16. end
  17.  
  18. local run = 0
  19. term.write("Tunnel length: ")
  20. run = read()
  21.  
  22. for i = 1, run do
  23.   k = i - 1
  24.   j = k % 4
  25.   digIt()
  26.   turtle.turnLeft()
  27.   digIt()
  28.   turtle.turnRight()
  29.   turtle.turnRight()
  30.   turtle.forward()
  31.   digIt()
  32.   turtle.back()
  33.   turtle.turnLeft()
  34.   if i == 2 or j == 1 then
  35.     turtle.back()
  36.     turtle.turnRight()
  37.     turtle.forward()
  38.     placeTorch()
  39.     turtle.back()
  40.     turtle.back()
  41.     placeTorch()
  42.     turtle.forward()
  43.     turtle.turnLeft()
  44.     turtle.forward()
  45.   end
  46. end