We as humans are creatures of groups, the cruelest punishment is loneliness. The feeling someone close to you dying is often stated to feel like "being alone suddenly" as is the feeling of getting bullied and not getting help, or the feeling you get when no one listen to your suggestions and opinions. With that in mind, we should try to talk with people, trust people and understand people rather than try to force our own talk on them, our own rule and our own visions.
Now there are numerous reasons for mass murder, so I am not talking in the wider spectrum when I say this. In the event that someone wants to commit mass murder out of a sense of distress, depression, loneliness or a loss of oneself you should ask not how to prevent the action, but what lead to the thought of it. Every case is different and because of such there is no "unifying answer" to give as a solution.
Though I think that in a perfect world where people treated each other, not with equal respect or belief, but with basic decency a living thing is allotted and realize that the world you see around is built upon multiple version of it and not just how you view things, then that would be a world were less people will commit acts such as these. There are people who commit the most horrid actions out of a need to have a stage to express their views and beliefs because no one wants to listen or approach them.
You can't just tell people to be more open, you have to be willing to get them to open up to you. Its not enough to just "not bully" people, you have to actively try to help people in some regard. A small gesture here and a small one there goes a long way to foster a healthy relationship. It also helps decrease the sense of paranoia, which as far as I am concerned is a massive reason (Americans more so) people feel the need to own a gun or weapon. They don't trust people, therefore they don't feel safe. While an unrealistic one, a world where people didn't try to win more for themselves but more for others, would be one were weapons wouldn't hold meaning.
In the event that such an act has been committed then I still think its important to ask "why" rather than "how" like the media is glad to ask. People ask "how" and it just runs to "videogames are bad" or "extremist group 1 probably did it". It utterly fails to capture the point of the act, which was to get a scene to express something. So start to ask "why" someone would do something and punish them accordingly. Perhaps punishment isn't in order, but by all means lock them up for their own safety, but don't just do that. Talk with them, learn from them and understand "why".
Loser requires defining. I prefer solitude, left to my thoughts, research etc, yet I have no intentions of commiting any mass murder. In fact the thought hasn't crossed my mind, even after reading your post.
I suppose God consciousness plays a part in my decisions and influences my behaviour. I might have a different train of thought or perception if I had a different set of values.
Anyway, a universal cure doesnt exist outside of God consciousness. If you want to try something and feel loners commit these crimes then try and be more social, yet not forceful. You may be trying to make somebody who doesn't like socialising socialise, it might trigger them. I have to tell you that won't make much difference without God.
What can you do for them? From what I've read, half of them had a warped sense of reality that made them feel like something they weren't actually, such as a loser. Maybe an amount of them could get mental attention, but some of these guys seem so convinced of their thoughts that they'd never attribute their beliefs being due to some illness. Those sorts wouldn't reach out for help and end up killing anyway. Then there's the ones who don't have any visible illness, just a belief that they act on like Dylan Roof.
Imo, it's actually a bit unfair to say half of them are ill as well. They just derive different conclusions than someone else would. Conclusions that implicate them being the victim or there being an evil they have to fend off. Normal people constantly do this as well. For example, beef. It usually starts with someone shitting on another person, then the perp goes on as if he was disrespected first or something. The only difference is that the shooters are willing to take their revenge further. I think people lose sight of the most general solution when they try to search for a commonality that only shooters share. The best, general solution for shooters of all kinds is target the general population's view on violence.
This is where people draw inspiration to say video games are bad or to stop glorifying shooters, but I think these two things mean nothing. These people aren't just randomly killing, they want a victory. Why is killing the enemy considered a victory in games to begin with? Because it's derived from what we already understand. History itself defines what a victory is, and those victories are rarely without violence. Just like loser is stigmatized by society, so is victory. I think we as a collective should stop glorifying violent triumphs in general and it includes the army alongside history. Men would beat up other men for their money before selling their body in exchange for it, and it's because of how it's stigmatized. Both should be a success, but one option is more degrading and it's not the violent one. Violence should have a worse stigma than it currently does.