Unfortunately I can't help you with gambling, but I did smoke for about 20 years and I've now been a non-smoker for almost 10 years.
This is something I do with self-harm, but maybe it will help. It's basically distraction. Like I tell myself I have to wait 5 minutes and try and distract myself with something else. Then maybe I can wait another 5 minutes, then 5 more, till I don't really feel like it anymore. I never tell myself I can't do it. Because that would just make me rebel against myself and do it anyway. I tell myself I can but first I try to distract myself. Maybe you could try something like that to help you stop gambling? Good luck.
I used this a lot when I quit smoking. I can have a cig in 5 minutes... when I've finished this... after tea time... etc, etc. Then I get busy again and forget about it until 30 minutes or so later.
The patches/gum/etc never worked for me. I went through a few cycles of using gum to get off cigs, using patches to get off the gum, and ended up smoking again as soon as I ran out of patches... In the end, I just had to get my head in the right place. I basically convinced myself that I was really a non-smoker. Stopped hanging out with the smokers at work, sitting in smoking sections in restaurants, etc, and then, one day, I just stopped. I went home, washed all my clothes, my bed linen, etc - everything that smelled of cigarette smoke - and that was it. I had a few cravings afterwards (obviously) which I dealt with using the postponement trick of by substituting something else (like chewing on a carrot. I ate a lot of carrots in the first few months after quitting). I've had a few relapses since then, when I would buy a pack and finish it, but the trick is to not buy the second pack - ie. get back on the wagon ASAP, before it becomes your lifestyle again.
PS: Some people claim to have had success with Zyban. Never used it myself so I can't really comment. Just saying some people swear by it.