A burglar was interrupted by security staff after entering a student flat, Lincoln Crown Court was told.
Daniel Ward was caught on CCTV cameras as he went into the ground floor flat in the Brayford Quay complex in Lincoln.
Lucky Thandi, prosecuting, said that Ward , who was accompanied by an unidentified woman, was seen acting suspiciously and was tracked by CCTV staff who monitor the building.
As a result a member of staff approached the pair and asked what they were doing.
Ward claimed it was his room but then said they had gone to the building to smoke mamba.
Miss Thandi said: “The defendant said they had not taken anything. A member of staff was instructed to contact police. On hearing this, the defendant pushed past and walked out towards Lloyds Pharmacy.”
Ward went into the pharmacy and asked to buy some vitamins. He was then seen to open a purse and made a comment that he didn’t have any change before he made off.
He was later identified and arrested.
Miss Thandi said: “He confirmed he was on the CCTV but denied he went into the flat. He said he had had a stroke and could not remember the offence.”
The court was told that he had 32 convictions for a total of 104 offences including two previous convictions for house burglary.
Ward, 38, of Moorland Crescent, Lincoln, admitted burglary of the flat on 26 July this year and stealing a purse. He was jailed for two years and eight months.
Colin Witcher, in mitigation, said Ward went to the building to take drugs and has a history of drug and alcohol abuse.
“He knows the sentence will be one of immediate custody,” said Mr Witcher.