LeviathanV

Nether Bridge

May 31st, 2021 (edited)
799
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.86 KB | None | 0 0
  1. function clc()
  2.     term.clear()
  3.     term.setCursorPos(1,1)
  4. end
  5.  
  6. function tup()
  7.     while turtle.up() == false  do
  8.         turtle.digUp()
  9.         turtle.attackUp()
  10.     end
  11. end
  12.  
  13. function tdn()
  14.     while turtle.down() == false do
  15.         turtle.digDown()
  16.         turtle.attackDown()
  17.     end
  18. end
  19.  
  20. function trt()
  21.     turtle.turnRight()
  22.     while turtle.forward() == false do
  23.         turtle.dig()
  24.         turtle.attack()
  25.     end
  26. end
  27.  
  28. function tlt()
  29.     turtle.turnLeft()
  30.     while turtle.forward() == false do
  31.         turtle.dig()
  32.         turtle.attack()
  33.     end
  34. end
  35.  
  36. function tfd()
  37.     while turtle.forward() == false do
  38.         turtle.dig()
  39.         turtle.attack()
  40.     end
  41. end
  42.  
  43. function tbk()
  44.     if turtle.back() == false then
  45.         turtle.turnRight(2)
  46.     while turtle.forward() == false do
  47.             turtle.dig()
  48.             turtle.attack()
  49.         end
  50.         turtle.turnRight()
  51.         turtle.turnRight()
  52.     else
  53.     end
  54. end
  55.  
  56. function cup()
  57.     turtle.select(1)
  58.     if turtle.compareUp() == false then
  59.         turtle.select(2)
  60.     while turtle.getItemCount(2) < 1 do
  61.         turtle.select(3)
  62.     while turtle.placeUp() == false do
  63.             turtle.digUp()
  64.             turtle.attackUp()
  65.         end
  66.         end
  67.     else
  68.     end
  69. end
  70.  
  71. function cfd()
  72.     turtle.select(1)
  73.     if turtle.compare() == false then
  74.         turtle.select(2)
  75.     while turtle.getItemCount(2) < 1 do
  76.         turtle.select(3)
  77.     while turtle.place() == false do
  78.             turtle.dig()
  79.             turtle.attack()
  80.         end
  81.         end
  82.     else
  83.     end
  84. end
  85.  
  86. function cdn()
  87.     turtle.select(1)
  88.     if turtle.compareDown() == false then
  89.         turtle.select(2)
  90.     while turtle.getItemCount(2) < 1 do
  91.         turtle.select(3)       
  92.         while turtle.placeDown() == false do
  93.             turtle.digDown()
  94.             turtle.attackDown()
  95.         end
  96.         end
  97.     else
  98.     end
  99. end
  100.  
  101.  
  102. clc()
  103. write('How far forward? ')
  104. x = read()
  105. j = 0
  106. clc()
  107. print('Mining in progress...')
  108. print()
  109. print()
  110. print('<                         >')
  111. term.setCursorPos(13,5)
  112. print('0%')
  113.  
  114. for i=1,x-1 do
  115.     if j%11 == 0 then
  116.         turtle.turnRight()
  117.         turtle.turnRight()
  118.         turtle.select(16)
  119.         turtle.place()
  120.         turtle.select(1)
  121.         turtle.turnRight()
  122.         turtle.turnRight()
  123.     elseif (j-5)%11 == 0 then
  124.         turtle.turnRight()
  125.         turtle.turnRight()
  126.         turtle.select(16)
  127.         turtle.place()
  128.         turtle.select(1)
  129.         turtle.turnRight()
  130.         turtle.turnRight()
  131.     end
  132.     j = j+1
  133.     tfd()
  134.     cdn()
  135.     cfd()
  136.     tup()
  137.     cfd()
  138.     tup()
  139.     cfd()
  140.     cup()
  141.     tlt()
  142.     cfd()
  143.     cup()
  144.     turtle.turnRight()
  145.     cfd()
  146.     tdn()
  147.     cfd()
  148.     turtle.turnLeft()
  149.     cfd()
  150.     tdn()
  151.     cfd()
  152.     cdn()
  153.     turtle.turnRight()
  154.     cfd()
  155.     turtle.turnRight()
  156.     tfd()
  157.     tfd()
  158.     cfd()
  159.     cdn()
  160.     turtle.turnLeft()
  161.     cfd()
  162.     tup()
  163.     cfd()
  164.     turtle.turnRight()
  165.     cfd()
  166.     tup()
  167.     cfd()
  168.     cup()
  169.     turtle.turnLeft()
  170.     cfd()
  171.     turtle.turnLeft()
  172.     tfd()
  173.     turtle.turnRight()
  174.     tdn()
  175.     tdn()
  176.    
  177.     p = (i/x-(i/x)%0.0001)*100
  178.     term.setCursorPos(13,5)
  179.     n = tostring(p)
  180.     term.clearLine()
  181.     print(n .. '%')
  182.     term.setCursorPos(2,4)
  183.     while p>4 do
  184.         p = p-4
  185.         write('=')
  186.     end
  187. end
  188.  
  189. term.setCursorPos(13,5)
  190. term.clearLine()
  191. print('100%')
  192. print()
  193. print('Mining complete.')
Add Comment
Please, Sign In to add comment