DHCP make static and set address

Hi, i tried to make a script from others post about dhcp lease script but i cant make it works.
so the script checking active-host-name and make static as result, after that i want to set the address using a pool that i have created. those 2 are set by checking hostname.
from CLI i wrote this

ip dhcp-server lease make-static [/ip dhcp-server lease find where host-name~"OPPO\\-"]
ip dhcp-server lease set [/ip dhcp-server lease find where host-name~"OPPO\\-"] address=HP

i want make a script looping for each hostname, but i cant figure out how to make mobile phone name as variable and looping it acitions for each any brand mobile phone.