Error in script for add MAC in IP Binding

Hi everyone,

I’m new in this forum and I have a problem with a script makes by me.

The script has a list of MACs and have to add these MACs in [/ip hotspot ip-binding] cheking before if the new MAC is included or not in IP-Bindings

This is the script:

:global newMac;
:global mac;

:log info “Empezando”;
:set newMac (“00:1D:C9:A1:82:5B”, “00:1D:C9:A1:84:74”, “00:1D:C9:A1:82:86”, “00:1D:C9:A1:7F:76”, “00:1D:C9:A1:81:F0”);
:foreach i in= $newMac do={
:local cont 0;
:set mac $i;
:foreach j in= [/ip hotspot ip-binding find] do={
:if ( [/ip hotspot ip-binding get number=$j mac-address] = $mac) do={
:set cont ($cont + 1);
}
}
:if( $cont = 0 ) do={
:log info $mac;
/ip hotspot ip-binding add mac-address=$mac type=bypassed;
}
}

When I execute this code, failed in this line:
:if( $cont = 0 ) do={

and tell me the following sentence: expected end of command (line 14 column 11)

I have tried modify it but the error is always there.

Could anyone help me please?

Thank you.