https://www.youtube.com/watch?v=jgDYClRGjvI
Check this video
Login script
# Set Default Rate Limit k/s #Set User # Set User Profile
:global DRateLimit "9000"
:global UName "asd"
:global ProName "MultiShare_Pro"
# Remove Default Queue
/queue simple remove [/queue simple find name~"$UName"]
# Count Login Device
:local DeviceCount [/ip hotspot active print count-only where user=$UName]
# Set Queue Per Device
:local QPerDevice ($DRateLimit / $DeviceCount)
# Add Queue to New Login Device
/queue simple add name=$address target=$address max-limit=($QPerDevice."k/".$QPerDevice."k") comment=$user place-before=0;
# Reset Queue to Logined Device
:foreach QReset in=[/queue simple find comment =$UName] do={/queue simple set $QReset max-limit=($QPerDevice."k/".$QPerDevice."k")}
Logout Scrip:
# Remove Queue From Logout Device
/queue simple remove [/queue simple find name =$address]
# Count Device Login
:local DeviceCount [/ip hotspot active print count-only where user=$UName]
# --------------------if all Device Logout
:if ($DeviceCount =0) do={
:log info "All are Devices Logout
"
}\
else={
# Set Queue Per Device
:local QPerDevice ($DRateLimit / $DeviceCount)
# Reset Queue to Logined Device
:foreach QReset in=[/queue simple find comment =$UName] do={/queue simple set $QReset max-limit=($QPerDevice."k/".$QPerDevice."k")}
}