A drug addict who used a knife to hold up a pharmacy was acting out of desperation, with his offending described as a “cry for help”.