During the Fourth Anglo-Dutch War (1780-1784), he was taken prisoner and held in Madras, where he witnessed the struggle between the British army and Hyder Ali, the Sultan and "de facto" ruler of the Kingdom of Mysore, and the famine that crippled the city in 1782. Released at the end of the year, he arrived at Ceylon (present-day Sri Lanka) in early 1783. From June to September, he embarked on a hiking tour of the island from Jaffnapatnam to Colombo, then left for Calcutta in West Bengal.