Also you posted this line earlier, just in case you were still having problems with it. There was a $ instead of @ for the ipaddress0 macro.

$MyIP = Join(Split($IPADDRESS0, ' '), '')

should be...

$MyIP = Join(Split(@IPADDRESS0, ' '), '')