I take Baclofen for leg spasms, and that’s pretty effective. However, there are other things that help, depending on what’s causing it. Sometimes my feet &legs are too warm, in which case cooling them down will stop them spasming. At other times, the opposite’s true and they’re too cold, in which case gently warming them up helps. I can get specific feelings in different bits of my calf which may make them spasm, and rubbing or stretching that bit of the leg will help. Another spasm & pain I get in my left leg is linked to my bladder, and having a pee will sort it out. I’ve also noticed that being on my feet too much can give me a painful right calf and make it spasm. And if the problem is just a general sense of restlessness (Restless Leg Syndrome), then taking magnesium does the job.
Hope you find the thing(s) that help you.