Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.write("Tunnel Length: ")
- tunnelLength = read()
- term.write("# of tunnels: ")
- tunnels = read()
- function mine()
- local a,v=turtle.inspectUp()
- if v.name ~= "minecraft:stone" then
- turtle.digUp()
- end
- a,v=turtle.inspectDown()
- if v.name ~= "minecraft:stone" then
- turtle.digDown()
- end
- a,v = turtle.inspect()
- if v.name ~= "minecraft:stone" then
- turtle.dig()
- end
- turtle.turnRight()
- a,v = turtle.inspect()
- if v.name ~= "minecraft:stone" then
- turtle.dig()
- end
- turtle.turnRight()
- a,v = turtle.inspect()
- if v.name ~= "minecraft:stone" then
- turtle.dig()
- end
- turtle.turnRight()
- a,v = turtle.inspect()
- if v.name ~= "minecraft:stone" then
- turtle.dig()
- end
- turtle.turnRight()
- end
- function dig()
- while turtle.detect() do
- turtle.dig()
- os.sleep(0.5)
- end
- turtle.forward()
- mine()
- while turtle.detectUp() do
- turtle.digUp()
- os.sleep(0.5)
- end
- turtle.up()
- mine()
- turtle.down()
- if turtle.detectDown() then
- turtle.digDown()
- end
- turtle.down()
- mine()
- turtle.up()
- end
- function unload()
- for i=1,16 do
- turtle.select(i)
- turtle.drop()
- end
- end
- for i = 1, tunnels do
- for j = 1, tunnelLength do
- dig()
- end
- turtle.turnRight()
- turtle.turnRight()
- for k = 1, tunnelLength do
- turtle.forward()
- end
- turtle.turnRight()
- local distance = 3*(i-1)
- for l=1, distance do
- turtle.forward()
- end
- unload()
- turtle.turnRight()
- turtle.turnRight()
- for m=1, distance do
- turtle.forward()
- end
- for n=1, 3 do
- while turtle.detect() do
- turtle.dig()
- os.sleep(0.5)
- end
- turtle.forward()
- turtle.digUp()
- turtle.digDown()
- end
- turtle.turnLeft()
- end
- turtle.turnLeft()
- for i=1,3*tunnels do
- turtle.forward()
- end
- unload()
- print("DONE!!! WOOOOOO!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement