You know what I do when I don't have friends around or talking to me? I go out and talk to random people at the store, strike up conversations or whatever. It makes me feel less lonely socially connecting with people on some level, or even being around people, but at the same time, it's socially "safe" to me, because since they're random people, what I do sorta doesn't matter, as I'll probably not see them again or connect with them on a "real" level. But at the same time, if you see people again, or really get talking, you might have a new friend.
That, and just being "out" makes me feel less lonely, even if it's just outside on my bike, or hiking or whatever, at the gym lifting, you know.
But then again, I'm not really quite as shy as I am just weird and socially awkward. And with enough/too little sleep, or hormones/chemicals, I can be super outgoing more than most NTs, but still an idiot despite it all.