I Have mikrotik CCR1016-12G
I set Mikrotik hotspot system On CCR
I set all device using ip hotspot ip binding
/ip hotspot ip binding
like this

but on ip dhcp server leases
/ip dhcp-server leases
i must make static all ip from ip binding
i already try to create schedule script like this:
:foreach x in=[/ip hotspot ip-binding find] do={
:local macaddr ([/ip hotspot ip-binding get $x mac-address ])
:local addr ([/ip hotspot ip-binding get $x address ])
:local toaddr ([/ip hotspot ip-binding get $x to-address ])
:local komen ([/ip hotspot ip-binding get $x comment])
:local server ([/ip hotspot ip-binding get $x server])
/ip dhcp-server lease add address=$addr mac-address=$macaddr comment=$komen always-broadcast=yes use-src-mac=yes server=$server }
but this code note effective because i must delete all leases address before running this script
and some device always got random ip from server before script finish to execute finally device notbypassed because ip not same with ip address on ip binding
this script before i running script
/ip dhcp-server lease remove [find ]
help to to solve script using auto create make static ip dhcp on dhcp server leases from ip binding