Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Set the number of blocks to mine
- local numBlocks = 5
- -- Loop to mine in a straight line
- for i = 1, numBlocks do
- -- Check if the turtle has enough fuel to move forward
- if turtle.getFuelLevel() > 1 then
- print("Out of fuel!")
- break
- end
- -- Dig the block in front of the turtle
- turtle.dig()
- -- Move the turtle forward
- if not turtle.forward() then
- print("Blocked in front!")
- break
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement