Automatic Throttling Script (Userman)

Hi guys

I’m looking for a Script that would check a user’s sum of its uploaded and downloaded usage (total usage) and if it’s more than 10Gb it should lower its download speed by half or set it to a given speed .

I have a scrip that resets all counters and speed to its original status on the first second of a new month.

I only need this for uncapped users

Thank you in advanced

Any one? :confused:

Ok This is what I made.

But its not working and every thing looks in place any idees

:local bytesin
:local bytesout
:local bytestotal

/tool user-manager user
:foreach i in=[/tool user-manager user find group-name=512k_uncapped] do={

       :set bytesin [get $i download-used]
       :set bytesout [get $i upload-used]
       :set bytestotal ($bytesin + $bytesout)

         :if ($bytestotal < 10737418240) do= {
                 set $i rate-limit=" 128000/128000 "
             }
}

OM GO$… THIS IS SO SAD… NOT EVEN ONE REPLY

make some debug output to see what values exactly you are dealing with. also, erase white-spaces around new rate settings.

Best thing to do, is to test separately, values you compare, what is the result with what arguments and then test commands you are trying to run in one or another condition.