Check this script by jotne (you might need/want to adapt It to your specific requirements, but It Is a solid base):
http://forum.mikrotik.com/t/dhcp-automatic-dynamic-to-static/129147/1
Check this script by jotne (you might need/want to adapt It to your specific requirements, but It Is a solid base):
http://forum.mikrotik.com/t/dhcp-automatic-dynamic-to-static/129147/1