the script for "Limiting a user to a given traffic" doesn't

Hi,
There is a script on the Wiki that is described to work for limiting users with high amount of download:

:local traf;
/queue simple
:for i from=1 to= 254 do = {
:if ([/queue simple find target-addresses=(“192.168.1.” . $i)] != “”) do={
:set traf [get [find target-addresses=(“192.168.1.” . $i)] total-bytes]
:if ($traf > 104857600) do = {
set [find target-addresses=(“192.168.1.” . $i)] max-limit= 32000/64000
}
}
}

I tried to use the script for myself. But, it had some writing errors that I tried to correct it as below:

:local traf;
/queue simple;
:for i from=1 to= 254 do= {
:if ([/queue simple find target-addresses=(“192.168.10.” . $i)] != “”) do={
:set traf [:get [:find target-addresses=(“192.168.10.” . $i)] total-bytes]; :if ($traf < 52428800) do= { :set [:find target-addresses=(“192.168.10.” . $i)] max-limit= 4MB/4MB } } }

However, there is some other errors in the script that because of my lack of knowledge on the scripting, I can’t solve.

Please, take a look & let me know the problem with it.

Thanks

Finally, I solved it using this code:

:local traf; :for i from=1 to= 254 do= { :if ([/queue simple find target-addresses=(“192.168.10.” . $i . “/32”)] != “”) do={ set traf [/queue simple get [/queue simple find target-addresses=(“192.168.10.” . $i . “/32”)] total-bytes]; :if ($traf > 52428800) do= { /queue simple set [/queue simple find target-addresses=(“192.168.10.” . $i. “/32”)] max-limit= 1M/1M } } }

However, there is serious problem. “total-bytes” equals the user’s uploaded amount. Not its download!

How can I solve it?!

Thanks