Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---
- --- Generated by EmmyLua(https://github.com/EmmyLua)
- --- Created by martinio.
- --- DateTime: 27.09.22 15:51
- ---
- function clear_terminal()
- term.clear()
- term.setCursorPos(1,1)
- end
- function turtle_up()
- while turtle.up() == false do
- turtle.digUp()
- turtle.attackUp()
- end
- end
- function turtle_down()
- while turtle.down() == false do
- turtle.digDown()
- turtle.attackDown()
- end
- end
- function turtle_right()
- turtle.turnRight()
- while turtle.forward() == false do
- turtle.dig()
- turtle.attack()
- end
- end
- function turtle_left()
- turtle.turnLeft()
- while turtle.forward() == false do
- turtle.dig()
- turtle.attack()
- end
- end
- function turtle_forward()
- while turtle.forward() == false do
- turtle.dig()
- turtle.attack()
- end
- end
- function turtle_backward()
- if turtle.back() == false then
- turtle.turnRight(2)
- while turtle.forward() == false do
- turtle.dig()
- turtle.attack()
- end
- turtle.turnRight()
- turtle.turnRight()
- else
- end
- end
- function compare_up()
- turtle.select(1)
- if turtle.compareUp() == false then
- turtle.select(2)
- while turtle.placeUp() == false do
- turtle.digUp()
- turtle.attackUp()
- end
- else
- end
- end
- function compare_forward()
- turtle.select(1)
- if turtle.compare() == false then
- turtle.select(2)
- while turtle.place() == false do
- turtle.dig()
- turtle.attack()
- end
- else
- end
- end
- function compare_down()
- turtle.select(1)
- if turtle.compareDown() == false then
- turtle.select(1)
- while turtle.placeDown() == false do
- turtle.digDown()
- turtle.attackDown()
- end
- else
- end
- end
- clear_terminal()
- write('How far forward? ')
- x = read()
- j = 0
- clear_terminal()
- print('Mining in progress...')
- print()
- print()
- print('< >')
- term.setCursorPos(13,5)
- print('0%')
- for i=1,x-1 do
- if j%11 == 0 then
- turtle.turnRight()
- turtle.turnRight()
- turtle.select(16)
- turtle.place()
- turtle.select(1)
- turtle.turnRight()
- turtle.turnRight()
- elseif (j-5)%11 == 0 then
- turtle.turnRight()
- turtle.turnRight()
- turtle.select(16)
- turtle.place()
- turtle.select(1)
- turtle.turnRight()
- turtle.turnRight()
- end
- j = j+1
- turtle_forward()
- compare_down()
- compare_forward()
- turtle_up()
- compare_forward()
- turtle_up()
- compare_forward()
- compare_up()
- turtle_left()
- compare_forward()
- compare_up()
- turtle.turnRight()
- compare_forward()
- turtle_down()
- compare_forward()
- turtle.turnLeft()
- compare_forward()
- turtle_down()
- compare_forward()
- compare_down()
- turtle.turnRight()
- compare_forward()
- turtle.turnRight()
- turtle_forward()
- turtle_forward()
- compare_forward()
- compare_down()
- turtle.turnLeft()
- compare_forward()
- turtle_up()
- compare_forward()
- turtle.turnRight()
- compare_forward()
- turtle_up()
- compare_forward()
- compare_up()
- turtle.turnLeft()
- compare_forward()
- turtle.turnLeft()
- turtle_forward()
- turtle.turnRight()
- turtle_down()
- turtle_down()
- p = (i/x-(i/x)%0.0001)*100
- term.setCursorPos(13,5)
- n = tostring(p)
- term.clearLine()
- print(n .. '%')
- term.setCursorPos(2,4)
- while p>4 do
- p = p-4
- write('=')
- end
- end
- term.setCursorPos(13,5)
- term.clearLine()
- print('100%')
- print()
- print('Mining complete.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement