Are you trying to change ALL queues or just a range of them?
If you only want to change a range, your code is fine. But, first you must use the print command to generate the number for each item. If you don’t use the print command, it doesn’t know what item corresponds to which number. Something like this:
/queue simple
print without-paging
:for x from=1 to=5 do={
set $x max-limit=512k/512k
}
If you want to change all of them, it’s pretty easy, something like this:
/queue simple
:foreach x in=[find] do={
set $x max-limit=512k/512k
}
Note that if you want to modify all items or items matching a particular criteria, you can also use “find” as a subcommand, perhaps with the criteria being further specified, e.g.
/queue simple set [find] max-limit=512k/512k
to modify all, or
/queue simple set [find where max-limit=2M/2M] max-limit=512k/512k
to modify all queues who’s current max-limit is 2M/2M.
On a related note, if you know in advance the exact numbers you’ll be modifying, you can use
/queue simple set "1,2,3,4,5" max-limit=512k/512k
(after previously issuing a print)
Or better yet, you can use the names, e.g.
/queue simple set "queue1,queue2,queue3,queue4,queue5" max-limit=512k/512k
All of these make for significantly more efficient scripts.