A basic script that should solve any normal maze.

pastebin

or

Spoiler

turtle.refuel(64)
while true do
	turtle.turnLeft()
	if turtle.detect() then
		turtle.turnRight()
	end
	if turtle.detect() then
		turtle.turnRight()
		if turtle.detect() then
			turtle.turnRight()
		end
	end
	turtle.forward()
end