Determining the speed of data transmission in the subnet by means of scripts or rules

Hello! Sorry for my bad english. The question is: Is it possible for Microtics (scripts and / or rules) to determine that a specific IP address on the local network is currently loading data from the WAN, for example, at a speed of 50Mbps and write this src-ip in the address list. The task is to monitor the connection speed of each ip address to the subnet and when it reaches the threshold value of the download speed, place it in a special addressist for several minutes. Strictly speaking, this is not necessary to limit its speed, but to redirect it to WAN2, thus freeing WAN1 from the load. Waiting for clarifying questions.
P.S. maybe I can use Torch?

You can’t use torch with scripts (i.e. can’t read the torch readings from a script).
What you can do is to have a /queue simple - one entry for each IP from LAN. Then your script can just get the “rate” parameter for each queue entry and check upload or download (need some parsing to split up/down and separate bps/kbps/Mbps unit from the number)

Thank you! Now it is clear where to start.

/ip firewall address-list remove [/ip firewall address-list find list=OwerSpeed];
:foreach i in=[/queue simple find] do={
:local comm;
:local speed [/queue simple get $i rate];
:if ($speed != “0bps/0bps”) do={
:local ipaddress [:tostr [/queue simple get $i target]];
:set $ipaddress [:pick $ipaddress 0 [:find $ipaddress “/”]];
:set $speed [:pick $speed ([:find $speed “/”]+1) [:len $speed]];
:local post [:pick $speed ([:find $speed “.”]+2) [:len $speed]];
:set $speed [:pick $speed 0 [:find $speed “.”]];
:set $comm ($speed.$post);
:if ($post = “Mbps”) do={
:if ($speed >= 30) do={/ip firewall address-list add address=$ipaddress list=OwerSpeed comment=$comm}
}
}
}