Engine dies, but turn the key off and back on it fires right back up

I battled a no spark issue for a while,and finally found the rotor was bad,burned through. It would stall more when humidity was high.