Steven Roberts fled empty-handed when the woman who worked at the shop threatened him with a baseball bat.
The following day Roberts failed in an attempt to rob an off-licence after threatening the owner with a potato peeler.
-> Fire extinguishers set off as police arrest two men in large fight at Norman Bar in Leeds city centreRoberts was locked up for five years and eight months over the offences at the stores in Featherstone and Streethouse, near Wakefield.
Leeds Crown Court heard how the 36-year-old went into a shop in Featherstone on February 22 this year and pulled two pencils out of his pocket.
Roberts said to the woman behind the counter: “Give me your money. These have got AIDS in them.”
The woman then threatened Roberts with a baseball bat and told him to get out.
Roberts tried to grab the bat but then left.
The next day he went into a store on George Street, Streethouse, and threatened the shop owner with a knife.
The weapon had a smooth blade similar to a potato peeler.
Heather Gilmore, prosecuting, said the owner told Roberts to get out.
The defendant then tried to get to the till but the shop owner hit him with a metal pole on the back of the wrist and chased him away.
Police were contacted and arrested Roberts nearby on Whinney Lane.
-> Gary McAllister lost teeth in unprovoked knuckle duster attack reveals former Leeds United star Dominic MatteoMiss Gilmore said: “Asked if he knew why he was being stopped he said ‘yeah, for that attempted robbery.’”
Roberts, of Arncliffe Road, Eastmoor, Wakefield, told the officers during interview that he had committed the offences to pay for drugs.
He pleaded guilty to two offences of attempted robbery and having an offensive weapon.
The court heard Roberts has previous convictions for robbery and witness intimidation.
Felicity Campbell, mitigating, said Roberts was sorry for what he had done and had committed the offences when he had slipped back into using drugs to cope with his emotions.
Judge Neil Clark told Roberts: “Clearly you were desperate for money.”