Not sure these medicine will cure such a behavior, I think that's need a recipe of consumption from doctor and it's not guarantee you will cure.
Well I personally take some rest, go to the environment which will refresh my mind or doing an activity which can leave gambling for a while.
All you need is self-control.
I suggest to make ones self busy in other doings. like thingd that can make your self happy at the moment example: is our family.i think making time with your family bonding can cure this impulsive gambling.
Just think about anything that can be more important than gambling.i think your family is the big example of it.lean on the other things that can be more important than gambling and slowly you can forget gambling.