Those kind of people are what one calls burden friends....They only want you around when they can burden you with their so called life problems. And then when they are done they do not talk to you....Which is funny Cause I was telling someone else last night that you have to know the difference between those kind of friends and other well "real" friends. The difference between burden friends and "real" friends is "real" friends will listen to your problems as well as you listening to theirs. Or at least listening to you where as burden friends only want to talk and never listen they want you to be well their punching bag of life is what I like to think of it as. Your basically being someone's psychologist not getting paid for it in friendship or any other way. They are not doing anything for you. I have had friends like this and honestly you feel all alone and like no one wants you. Not a good feeling that you get when you are so called "friends" The definition of a friend is this.
A person whom one knows, likes, and trusts.
A person whom one knows; an acquaintance. A person with whom one is
allied in a struggle or cause; a comrade.
One who supports, sympathizes with, or patronizes a group, cause, or movement
Now this is the best way to tell if they are your friend are they doing any of these or all of these for you that you are doing for them. And your not being selfish by expecting one of these or some of these in return.