Automatically Lock the user to MAC address on 1st login

here is a script to lock the MAC address for the user when he login so nobody can use this user by other MAC address
we have to add this user at
ip>hotspot>user profile
then choose the required profile and add this script at script on-login:
:delay 2
:local m [ip hotspot active get value-name=mac-address [find user=$username]]
/ip hotspot user set mac-address=$m [find name=$username]

Thank you for the reference but I used this

:local a $user
:local m [/ip hotspot active get [find user=$a] mac-address]
:log info message=(“Prueba: ;$a; ;$m;”);
/ip hotspot user set $a mac=$m;