Sexting...

So here's the story: lately my boyfriend has barely been texting me and not been as intimate as we were when we first started dating. (We've been together for a year now). He has sexted another girl before and grabbed one of my best friends ass and I was so hurt but I never left him cuz I didn't have the heart to. So now recently, since he has barely been texting me, I have started to chat with other guys....and yes, this means that I have sexted pictures to one of my best guy friends and 2 total strangers. I feel bad but he's hurting me and that's why I'm doing it: to get attention and compliments. Idk what to do anymore...any thoughts?