I'm so sorry Student. I know how awful that is. Take care of yourself. Unfortunately it does take some trial and error to find what foods will give you soft BMs.
Make a note of what you eat, every day, and note your BM consistency and level of pain. Hopefully you'll see a pattern that will help you to work out what you can eat.
And of course, keep drinking lots and lots of water.
I want you to know that I was in a similar place to you last summer, and now I am fine. You can recover. It seems like it takes forever, but one day you'll emerge from this bad place and feel well again. Most of my pain was from spasms, and I'd lie in bed crying with pain. My walk to work would take twice as long as usual, because walking caused me so much pain. But I did start to heal, and so can you. Good luck and keep posting.