This puzzles me... I have tested each of the lines of script on our office Mikrotik before deploying it to the current Mikrotik with the same version.
The second :if ($monitors>7000000)... line was entered because after monitors was greater than 14 nothing else happened.
Now I have noticed that the log shows the value of monitors every time the scripts run but sometimes skips logging the value of traffic.
I have even forced traffic to be greater then 14 but the rest of the script never runs.
The value of traffic will continue to increment until the value of monitors drops below 700000. Then it goes back to 0.
:global traffic
:global monitors
:local counter
:local numberofqueues
:local in
/interface monitor-traffic Lookout once do={:set monitors $"tx-bits-per-second"}
:if ($monitors>7000000) do={:set traffic ($traffic+1)} else={:set traffic 0}
:if ($monitors>7000000) do={:log info $monitors;:log info $traffic;}
:if ($traffic>14) do={:set counter 1;:set numberofqueues [/queue simple print count];:set numberofqueues {$numberofqueues-1};:while ($counter < $numberofqueues) do={:set in {"*".[:tostr $counter]}; /queue simple set $in burst-limit=3M/3M; :set counter ($counter + 1);};}
:if ($traffic>14) do={:set traffic 1; /system script run wait5;}
Just to clarify the numberofqueues part is required because the last two queues are defaults that we do not change.