Fridge not working then it does

I have an old fridge. For several months large amounts of water would pool in the bottom. Then suddenly the fridge stopped working but the freezer seemed totally fine, although, perhaps with some frost build up that was more than usual. I still kept a few things in there like pickles because I thought they would be fine. So one day, about a month later, I reach in and the jar is cold. Fridge is fine. The other thing: I have an add-on ice maker. It’ll go days without giving me ice even though the ice tray is empty, then suddenly it’ll spew out a bunch. This machine has a mind of its own.

Best guess, bad defrost timer. Without more info, that’s about the best I can do.