Script to change pcq rates on certain time

I’m trying to build a script to DOUBLE some pcq rates on a certain hour of the day.
this is what I tried

/queue type set [find where pcq-rate!=0] pcq-rate=([/get [find where name~"MYPCQ"] value-name=pcq-rate]*2)



/queue type set [find where pcq-rate!=0] pcq-rate=([get [find where kind=pcq] value-name=pcq-rate]*2)

i’m getting this error everytime

invalid internal item number

Please advise on how to do it.

You can create two script and schedule them as start and stop like this

Lower pcq-rate

/queue type set pcq-rate=50 [/queue type find where name=MYPCQ]

Increase pcq-rate

/queue type set pcq-rate=100 [/queue type find where name=MYPCQ]

There is a large number of pcq types and everyone has a different value, i need something to multiply the current value of ALL pcq-rates and multiply it by 2.
Please advise.

This should do:

:foreach i in=[/queue type find where name~"MYPCQ"] do={
/queue type set pcq-rate=([/queue type get number=$i pcq-rate]*2) numbers=$i }

It will double all pcq-rate for all queues that do contains the text MYPCQ

You can use the same to divide it by later /2

Awesome! I will try it out.
Thank you so much!

You are welcome :slight_smile:
Did an update of the post above to shorten it more.

Example test for all Queues with letter D

[admin@test-router] > /queue type export
 # apr/19/2019 21:33:29 by RouterOS 6.44.2
# software id = xxxx
#
#
#
/queue type
add kind=pcq name=Demo pcq-rate=400
add kind=pcq name=Data pcq-rate=100
[admin@test-router] > [
[... :foreach i in=[/queue type find where name~"D"] do={
[{... /queue type set pcq-rate=([/queue type get number=$i pcq-rate]*2) numbers=$i }
[... ]
[admin@test-router] > /queue type export
# apr/19/2019 21:33:40 by RouterOS 6.44.2
# software id = xxxx
#
#
#
/queue type
add kind=pcq name=Demo pcq-rate=800
add kind=pcq name=Data pcq-rate=200