Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- maxRows = 4
- fieldLength = 5
- currentRows = 0
- direction = 0
- position = 0
- while currentRows < maxRows and turtle.getFuelLevel() ~= 0 do
- if position >= fieldLength then
- position = 0
- if direction == 0 then
- print("Turning to next side...")
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- turtle.forward()
- direction = 1
- else
- print("Moving to next row.")
- turtle.turnLeft()
- turtle.forward()
- turtle.forward()
- turtle.turnLeft()
- turtle.forward()
- direction = 0
- currentRows = currentRows + 1
- end
- elseif position < fieldLength then
- turtle.digDown(right)
- turtle.forward()
- position = position + 1
- end
- end
- print("Farming Complete. Returning...")
- turtle.turnRight()
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- for i = 0, (maxRows * 3) - 1 do
- turtle.forward()
- end
- turtle.turnRight()
- turtle.forward()
- print("Task Complete!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement