A 19-year-old Indiana college student contemplated foraging for crickets and licked damp walls for water after getting locked inside a gated cave for nearly 60 hours.

Indiana University freshman Lukas Cavar didn’t end up eating the small insects but did use two energy bar wrappers to collect moisture and empty water bottles to collect rainfall and puddled cave water.

The Bloomington man, whose parents are Indiana University linguistics professors, was on a spelunking trip to Sullivan Cave when he became separated Sunday afternoon from 12 other members of the university’s Caving club.

WORLD'S LARGEST WILDLIFE MUSEUM OPENS AHEAD OF NATIONAL HUNTING AND FISHING DAY

He said when he reached the cave’s entrance, he found that club members had padlocked the gate, unaware he was still inside. With no cellphone signal, Cavar could only scream for help in hopes of motorists at a nearby road might hear him.

Cavar tried to pick the lock with a paper clip. When that didn’t work, he had to figure out how he was going to survive with barely any supplies.

“It took me a little while to wrangle my emotions and sort of approach things analytically, sensibly, to come up with a game plan to survive,” Cavar said Thursday, two days after he was rescued.

His parents filed a missing person report with university police when he didn’t arrive back to campus with the club. A high school friend later informed the Caving Club’s president Cavar was missing.

Two club leaders immediately returned to the cave late Tuesday after finding a pile of clothing in a vehicle club members used to travel to the cave two days earlier. They found Cavar uninjured and asleep behind the locked gate.

MAN TRIES TO BARBECUE RATTLESNAKE, GETS BIT ON FACE

“I’m really glad to be alive. It feels like I’ve been given a second chance,” said Cavar, who returned to classes Thursday and has no plans for another spelunking trip.

A message posted by the Caving Club’s president on a website for Indiana University student organizations says the club’s “rigorous protocols” for accounting for members during cave excursions had failed.

“We had a failure in our leadership to closely follow all these safety procedures,” the message states, according to Indiana Daily Student. "The risk that our member was exposed to as a result of these failures is a vivid reminder of why we have protocols."

In a Facebook post on Tuesday, Cavas assured his friends and family he was safe.

"Just wanted to let everyone know that I'm safe and sound!" he wrote. "Just got rescued about 30 minutes ago. Boy, it's good to be back on the surface!"

The Associated Press contributed to this report.