The pill advice or opinion?

So I've been on the pill for about 3 months now. My periods are still irregular. The first month I had it for 2 weeks, then I skipped a period, then it lined up with the brown pills, and now I have my period again in the same month? Whatttttt is going on. I got these pills to make my period regular!? Did this happen to anyone else? I went to my doctor after I skipped the period and she basically said "idk wait it out". If the pill isn't making my periods regular is it protecting me for sex or is it just defective altogether?