Hours after he got out of prison, a man hit himself against a moving public bus and then asked the driver for money.

Tan Lian Seng, 60, who had been in and out of prison almost 20 times - most recently for a similar fake accident scam, was given seven years' preventive detention yesterday.

He was convicted last month after a seven-day trial for attempting to cheat SBS Transit driver Kiong Chee Ong on May 18 last year.

The court heard evidence from witnesses and saw closed-circuit television footage from the bus that Tan was standing in the bus lane near a bus stop in Tampines Avenue 5 for no apparent reason.

Mr Kiong testified that as he was driving out of the bus stop, he saw Tan standing in the road and sounded his horn, but Tan did not move. He then tried to move into the second lane to avoid Tan.

While doing this, he checked his side mirrors and saw Tan suddenly hit the vehicle. He stopped and informed his control centre.

When Mr Kiong approached Tan and asked if there was anything wrong with him, Tan asked him for for money and became angry when he refused. Mr Kiong was certain that the bus did not hit Tan, or cause any injury to him.

The court called for corrective training and preventive detention reports on Tan, who was found suitable for both.

Deputy Public Prosecutor Nathaniel Khng said the reports stated that Tan's risk of re-offending was high, with a 62 per cent or more probability of recidivism within two years of release.

District Judge Shawn Ho noted that Tan had been given many chances, but re-offended hours after his release from prison.

"The public needs to be protected from your actions,'' he told Tan.

The maximum period of preventive detention is 20 years.