useful script !!! if can make it

hello professional MT user
i have a beautiful solution to manage pppoe connection by user total uasage TX/RX bytes

on interface tab–>traffic tab → TX/RX bytes
we have total usage of the users
by this data we can make qouta scripts
if user use all of her qouta that we selected for him,pppoe connection will be disable until we want

CAN YOU HELP ME TO GENERATE THIS SCRIPT

How many PPPoE session are we talking about?

You have to remember scripting is not ment for big jobs like this, and processing more then 200 entries by scripts will actually make your CPU go 100%.
We tested with a script that processes IPSec policies and modifies them, and on a RB1100AHx2, on more then 200 entries, the CPU maxed.

thank you 4 attention
but my pppoe users are maximum 50 pepole
and
tx/rx byte counter is for each pppoe interface
isnt per session

Perhaps you can utilize RouterOS’ accounting feature?
http://wiki.mikrotik.com/wiki/Manual:IP/Accounting

IP accounting is ok for small traffic amounts but as it has to be collected / cleared it is quite easy for the system to get overrun with IP pairs in a heavy traffic environment.
NetFlow is a better option for this sort of tracking and there are free and paid systems that can be used for collecting this info.

That said, addressing farhadjalali’s original request; it would be possible to script something like this to save the details to simple queues or a text file on the router.
I’ve done similar for static IP/queue listings here: http://www.mikrotik-routeros.com/2010/01/automated-usage-script-without-usermanager/ that will have a bunch of helpful ideas if you want to write your own script to do it.