useman and quese

what i what to do is this all my clients have pppoe connections witch connect to my radion server whitch is userman

now what i want to do is run a script every hour that will do somthing like this i dont want to limit my useres but i wnat to do a scan if user upload and download exeeds 30 gig total then it must slow down hes connection to like 256kbs upload and 512kbs download cabn anyone help me im not good with scriptuing so if you can give me a guide line to work with then i can work it out thanks

Try this script:

: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  > 3145728000) do = {
        set [find target-addresses=("192.168.1." . $i)] max-limit= 256000/512000
      }
    }
  }

In the new User Manager you will be able to specify a rate limit, which becomes active after download limit is reached.