I honestly think you need friends. Or better friends. You have lost perspective a little bit but that is ok. You want change and do things differently and that is great. Just try to keep an open mind for new people in your life because I will tell you that I know a lot of people that is more fun to spend time with than random people at a casino. Find such people and you will feel like the richest person in the world.
And you're right. I met this one girl here. She is the apple of my eye. to say it gayly. But it makes all the difference. By now you probably wish for me to die, but I beg you to reach out. I am a good friend.
I work as a manager and I'd say that I would consider your problem not being "yours" but your manager's problem.
As your manager, I would have you work more closely with some dedicated but inspirational and funny person. Have you in on discussions and make research on topics shapes the decision making of what we are working on. I would simply make sure you had at least three different type of work (programming, researching, preparing for a presentation etc) and see what you gravitated towards and then keep a solid ratio between the different things.
So, I guess that I am suggesting that you should tell your manager about this problem and have her helping you with it.