Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function mining()
- remainingX = length
- remainingY = width
- while remainingY>0 do
- column()
- remainingY = remainingY-1
- if remainingY>0 then
- turtle.turnRight()
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- turtle.digDown()
- turtle.turnRight()
- remainingX = length
- columnn()
- remainingY = remainingY-1
- if remainingY>0 then
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- end
- end
- end
- if (width % 2 == 1) then
- turtle.turnRight()
- turtle.turnRight()
- remainingX = length
- returnTrip()
- else
- returnTrip()
- end
- end
- function column()
- while remainingX>0 do
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- turtle.digDown()
- remainingX = remainingX-1
- end
- end
- function returnTrip()
- remainingY = width
- while remainingX>0 do
- turtle.forward()
- remainingX = remainingX-1
- end
- turtle.turnRight()
- while remainingY>1 do
- turtle.forward()
- remainingY = remainingY-1
- end
- turtle.dropDown()
- end
- function giveInfoPlease()
- write ("Quarry length (Max 500): ")
- answerL = read()
- if 0<answerL<500 then
- write ("Quarry width (Max 500): ")
- answerW = read()
- if 0<answerW<500 then
- MINE()
- else giveInfoPlease()
- end
- else giveInfoPlease()
- end
- end
- giveInfoPlease()
- fuelRequired = length*width+width
- print ("(fuelRequired) fuel required")
- print ("Current fuel level turtle.getFuelLevel()")
- write ("Continue? (y/n): ")
- local answer = read()
- if (local answer == y) then
- mining()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement