Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Get fuel level for turtle
- local fuelLevel = turtle.getFuelLevel()
- -- Ask user for length, width, and height of quarry ( rectangle )
- print("Please enter the length of your quarry")
- local length = io.read()
- print("Please enter the width of your quarry")
- local width = io.read()
- print("Please enter how far you would like the quarry to go down")
- local height = io.read()
- if(fuelLevel < (((length*2) * (width*2) * (height)) + 2 )) then
- print("You don't have enough fuel to run this code! Sorry!")
- else
- print("Success! You have enough fuel! Starting program now!")
- local x1, y1, z1 = gps.locate()
- for a = height, 1, -1
- do
- turtle.digDown()
- turtle.down()
- for b = length, 1, -1
- do
- turtle.dig()
- turtle.forward()
- turtle.turnRight()
- for c = width-1, 1, -1
- do
- turtle.dig()
- turtle.forward()
- end
- turtle.turnLeft()
- turtle.turnLeft()
- for d = width-1, 1, -1
- do
- turtle.forward()
- end
- turtle.turnRight()
- end
- turtle.turnRight()
- turtle.turnRight()
- for e = length, 1, -1
- do
- turtle.forward()
- end
- turtle.turnRight()
- turtle.turnRight()
- end
- for f = height, 1, -1
- do
- turtle.up()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement