Script
:local newIP [/ip cloud get public-address ]
:global currentIP [/ip firewall address-list get [find comment=wan] address]
:if ( $currentIP != $newIP ) do={
:put [/ip firewall address-list set address=$newIP [find comment=wan]];
:put [/ip firewall nat set dst-address=$newIP [find comment=wan]];
}