OP,
You mentioned mental illness. Have you been diagnosed with depression/bipolar? Whilst loneliness is normal of course, I get a certain vibe from your post - more than loneliness, more than a desire for friendship - it's like a quiet desperation, a sense of 'there's no point in hoping to be invited to a b or c cause they'll ignore me anyway. They've all got great lives and I'm left out." I'm not trying to be cruel. Honestly. It's just that I've been like that in the past and, like many other symptoms of depression, it feels SO real but is, in fact, a part of depression. Are you on medication? I know anti-depressants are just a crutch but what a great crutch! Lol.
I remember at various times when I was in my 20s feeling left out, feeling unimportant. But here's the worst part. When you feel like that it becomes a self-fulfilling prophecy, in my opinion. You actually start to eminate a vibe of desperation - 'like me', 'call me', 'don't forget ME!'. You might not speak those words but you communicate the sentiments nonetheless. And, sure enough, nothing repels a person more than that because it's too intense for them.
When I was diagnosed years ago with depression my doc said 'do you feel like a social misfit, like you have to make huge efforts just to blend in?'. I was shocked. The answer of course was yes. Because even when I was out with friends I felt so over-the-top sensitive and vulnerable. That's depression. I haven't felt like that in years. Prozac is my god.
So my advice is... talk to your doc about this - suggest some meds or, if you're already on them, try others. But, very important, be very positive. Try not to give off a negative vibe. Laugh, be laid back and be ASSERTIVE. We are drawn naturally to assertive people. ACT all of this if you must at the start. For example instead of calling up a friend/relative and saying: "um, would you, um, come for a drink. I'm so down. If you're busy don't worry.". Say: "hey summers nearly over, I'm getting in some wine and treats, let's get together and have a nice treat day!"
it sounds cheesy I know but really it's important that you come across as undemanding and positive (even if you're initially acting!).