Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("How Far would you like to go?")
- local length = tonumber(read())
- term.clear()
- print("dig 3 block high?")
- print("Type yes or no")
- local answer = read()
- local height = 2
- if answer == "yes" then
- height = 3
- end
- term.clear()
- local distance = 0
- function empty()
- turtle.turnLeft()
- turtle.turnLeft()
- for i = 1,distance do
- turtle.forward()
- end
- for i = 2,16 do
- turtle.select(i)
- turtle.drop()
- end
- turtle.turnLeft()
- turtle.turnLeft()
- for i = 1,distance do
- turtle.forward()
- end
- end
- function mine()
- while distance < length do
- turtle.dig()
- turtle.forward()
- if height == 3 then
- turtle.digDown()
- end
- turtle.digUp()
- distance = distance +1
- check()
- end
- end
- function check()
- turtle.select(1)
- local number = turtle.getItemCount() -1
- if number > 0 then
- turtle.dropDown(number)
- end
- turtle.select(16)
- if turtle.getItemCount() >=1 then
- empty()
- end
- turtle.select(1)
- end
- mine()
- function done()
- turtle.turnLeft()
- turtle.turnLeft()
- for i = 1,distance do
- turtle.forward()
- end
- if turtle.detect() then
- for i = 1,16 do
- turtle.select(i)
- turtle.drop()
- end
- end
- turtle.turnLeft()
- turtle.turnLeft()
- end
- done()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement