A gambler in debt who tried to rob a shopkeeper of cash after visiting a casino avoided jail today.