Very true. All compulsive behavior serves an emotional purpose, usually to regain control over feeling helpless over circumstances perceived as frustrating and intolerable. The quick fix or mood changer of gambling or drinking reverses feelings of helplessness and helps regain control (temporarily) of how ones feels. The antidote is the replace the quick fix with a high value behavior that empowers you in escaping the trap of feeling helpless, powerless and lacking control.