I've written several of Nmap scripts over the years, whenever something strikes my fancy.
Several of the scripts above have required new libraries.