Odd bowel pattern as

For the last year or so I’ve been throughout the week only able to have pebble sized poops and then suddenly I get severe severe cramping which sometimes causes me to vomit and I have a mix of hard stool that quickly turns to diarrhea then mucus. The cramping gets so severe I can barely walk and the need to go to the bathroom is so severe I have had accidents. I’ve increased my water intake , increased fiber and have been on Metamucil. Any tips would be appreciated 😭 the need to use bathroom comes on so quickly I’m scared to leave my house or go somewhere I don’t have immediate access to the bathroom.