A man burgled two homes after trying his luck and finding the doors unlocked, a court heard.
Daniel Jones stole a car from one of the properties – then drove it to pick up drugs from his dealer.
The 36-year-old now faces sentencing by a crown court after Kirklees magistrates heard how one of the victims confronted him outside his home.
Both raids, resulting in the theft of property worth more than £7,000, took place late at night between Tuesday and Wednesday this week.
Jones first broke into a home in Magdale, Honley, described as a gated property off a quiet road.
He accessed the house via the glass patio doors at 10.30pm and took the keys to the white Suzuki parked outside, together with a mobile phone and £40 in cash.
The victim woke the next day to find the car missing.
The following day at just after 4am Jones was caught by the owner after burgling a home in Wrigley Court, Netherton.
Alex Bozman, prosecuting, said: “The victim was in bed on top of the garage when he was woken by the sound of the garage opening.
“He looked out and saw the defendant trying to hide behind the neighbour’s vehicle, goes out and there’s a confrontation.
“The victim had asked his name, sees some identification and taken a photo of him.”
The court heard that, despite being suspicious of Jones’ behaviour, the victim did not realise that he had taken anything from his property at that point.
He later found out that his laptop, iPad and keys to his Audi had been stolen.
Jones pleaded guilty to two burglaries and taking a vehicle without the owner’s consent.
He helped police recover the car after admitting that he drove it to purchase drugs and then parked up with them.
Jones said that he stole to support his class A drug addiction.
He sold the items he took from the second home worth over £1,000 for just £50 but was not prepared to give police the details of the purchaser.
Mr Bozman added: “The defendant said he was trying door handles, found the door to the Suzuki unlocked and tried the house door which was also unlocked.
“He says he was a drug addict and had gone inside to steal to fund this habit.
“The second offence was a repeat, again he got lucky in terms of the fact that the property was insecure.”
Magistrates committed Jones, of Scotgate Road in Honley, to Leeds Crown Court on December 16 for sentencing.
He was remanded in custody in the meantime.