Simple Queue Script using Variables

I wish to be able use a script to create simple queues and child queues using variables defined in the script – means i don’t have to change the script only the variables.
At present i can create the parent via script however the max-limit= and limit-at will not accept upload/download variables. it will accept single variable only and then creates the queue with max-download=unlimited.
This then creates problem on creation of child queues to this parent as the download-max is smaller than the download.
Example of what im trying to achieve below - Overall objective is to have a single script that can have variables edited and not have to change the entire script for different applications.
obviously ive only included one child queue but there are more.

:global name value=Works-Depot
:global port value=ether8-Hotspot
:global upload value=10200k
:global download value=10200k

/queue simple
add name=$name queue=default/default target=$port max-limit=$upload/$download
add name=“$name-voip” max-limit=$upload limit-at=$limit-up/$limit-down packet-marks=
DSCP.46 parent=$name priority=1/1 queue=default/default
target=$port

if this script can help u, use it, work in 6.40.3

:for e from=2 to=254 do={
/queue simple add name=“user $e” target=“10.20.28.$e” dst=ether3 max-limit=10000000/10000000 queue=default/default total-queue=default
}

u can edit the 2 and 254 , the “user” and ip ofc the max limit ect .

temorizador

Thanks Guys,
I worked it out - it was just a matter of getting the syntax right!

/queue simple
add name=$QueueName queue=default/default target=$InterfaceName max-limit=(($DownloadSpeedK * 105 / 100).“k/”.($UploadSpeedK * 105 / 100).“k”)