theUpsider

Untitled

Feb 27th, 2021 (edited)
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.05 KB | None | 0 0
  1. -- querer schaft
  2. local sides
  3. local oneDepth
  4.  
  5.  
  6. -- MOVEMENT
  7. function UBackDown()
  8.     if turtle.detectUp() then
  9.         turtle.digUp()
  10.         turtle.up()
  11.         if turtle.detectUp() then
  12.             turtle.digUp()
  13.         end
  14.         turtle.down()
  15.     end
  16.    
  17. end
  18.  
  19. function FDigWalk()
  20.     repeat
  21.         turtle.dig()
  22.          os.sleep(0.5)
  23.     until turtle.detect() == false
  24.     turtle.forward()
  25.     UBackDown()
  26. end
  27.  
  28. function FDDigWalk()
  29.     repeat
  30.         turtle.dig()
  31.          os.sleep(0.5)
  32.     until turtle.detect() == false
  33.     turtle.forward()
  34.     UBackDown()
  35.     if turtle.detectDown() then
  36.         turtle.digDown()
  37.     end
  38.     turtle.down()
  39.     UBackDown()
  40. end
  41.  
  42. -- dig miningshaft SIDES
  43. function Three()
  44.     local threeDepth = sides
  45.     local backSteps = threeDepth * 3
  46.     repeat
  47.         threeDepth = threeDepth - 1
  48.         FDigWalk()
  49.         FDigWalk()
  50.         FDigWalk()
  51.         turtle.turnLeft()
  52.         FDigWalk()
  53.         FDigWalk()
  54.         turtle.back()
  55.         turtle.back()
  56.         turtle.turnRight()
  57.         turtle.turnRight()
  58.         FDigWalk()
  59.         FDigWalk()
  60.         turtle.back()
  61.         turtle.back()
  62.         turtle.turnLeft()
  63.     until threeDepth == 0
  64.     repeat
  65.         backSteps = backSteps - 1
  66.         turtle.back()
  67.     until backSteps == 0
  68. end
  69.  
  70. -- dig down
  71. function One()
  72.     local oneDepth = 2
  73.     repeat
  74.         oneDepth = oneDepth - 1
  75.         FDigWalk()
  76.         turtle.turnRight()
  77.         FDigWalk()
  78.         turtle.turnLeft()
  79.         FDDigWalk()
  80.         turtle.turnLeft()
  81.         FDigWalk()
  82.         turtle.turnRight()
  83.     until oneDepth == 0
  84. end
  85.  
  86. function Start()
  87.     repeat
  88.         Totaltimes = Totaltimes - 1
  89.         One()
  90.         turtle.turnLeft()
  91.         Three()
  92.         turtle.turnRight()
  93.         turtle.turnRight()
  94.         Three()
  95.         turtle.turnLeft()
  96.     until Totaltimes == 0
  97. end
  98. print("How Far Will Turtle Go?")
  99. input2 = io.read()
  100. Totaltimes = tonumber(input2)
  101. print("How deep will the sides be?")
  102. input = io.read()
  103. sides = tonumber(input)
  104. Start()
Add Comment
Please, Sign In to add comment