There are many reasons that you might want to cook spaghetti in a rice cooker instead of in a pot on the stove top. You may be living in a dorm or other facility without a stove. Or you might be pressed for time and may not want to spend what little time you have hovering over a saucepan waiting for the water to boil. Whatever the reason may be, cooking spaghetti in a rice cooker is an easy, time-saving alternative to cooking it on the stove top.
Break the dry spaghetti in half so it will fit in the rice cooker.
Pour the water into the cooker, along with the dry spaghetti, and add olive oil and salt.
Turn the cooker on and allow the spaghetti to cook for one cycle. You may need to periodically turn the cooker on again as it might turn itself off, since it is calibrated to cook rice, not spaghetti.
Check if the spaghetti is al dente, or slightly undercooked, after the cooker turns itself off.
Add pasta sauce to the spaghetti in the cooker, and turn the cooker on again. Allow the pasta to cook all the way through. Make sure to stir periodically.