Little tool to change queue-simple limits for ISP's

Queue Simple Rate Setting Tool

This Tool can be helpful for ISP's to change a big number of queues simple

Written by:BrasDeutscher,PA,Brazil

Testet under RouterOS v6.37rc32

{

Enter here the max-limit search value

Required is k or M , do not use m

:global oldmax "0/0"

Enter here the limit-at search value

Required is k or M , do not use m

:global oldat "0/0"

############################################################################

Set the new max-limit value here

Required is k or M , do not use m

:global newmax "0/0"

Set the new limit-at value here

Required is k or M do not use m

:global newat "0/0"

!!-- If you use burst queue's you can set the new burst values below --!!

!!-- If not leafe all next rules as it is by my script default set --!!

If required set the new burst limit here

:global bl "0/0"

If required set the new burst-threshold here

:global bt "0/0"

If required set the new burst-time here

:global but "0s/0s"

If required set the new priority here

:global py "8/8"

You have the option to set comments here, if no leafe it as is "my comment"

:global cm ""

!!-- DO NOT CHANGE ANY BELOW --!!

:global ip
:global action
:foreach q in=[/queue simple find ] do={
:set ip [/queue simple get $q target ];
:if ([/queue simple find where ! disabled ! dynamic target="$ip" limit-at="$oldat"
max-limit="$oldmax" ] != "" ) do={
:delay 100ms;
:set action [/queue simple set [find where target="$ip" limit-at="$oldat" max-limit="$oldmax" ] limit-at="$newat"
max-limit="$newmax" burst-limit="$bl" burst-threshold="$bt"
burst-time="$but" priority="$py" comment="$cm" ];
:log warning ("O.K $ip set new Value limit-at=$newat max-limit=$newmax burst-limit=$bl");
:log warning ("O.K $ip set new Value burst-threshold=$bt burst-time=$but burst-limit=$bl comment=$cm");
} else={
set ip [/queue simple get $q target ];
:log error ("error $ip max-limit=$oldmax limit-at=$oldat not found");
}}}