script does not work in 3.30

I urgently need help colleagues.
I upgraded from version 3.22 to 3.30 and stopped working script separation of bandwidth for users, depending on their number and activity. Here's the script worked in 3.22
######################
:local MaxRateDownload ("1000000");
:local MaxRateUpload ("250000");
:local ActiveThresholddown ("50000");
:local ActiveThresholdup ("20000");
:local ParentDownload ("Download");
:local ParentUpload ("Upload");
######################

######################
:local z;
:local i;
:local ii;
:local userX;
:global onlineclientsdown (0);
:global onlineclientsup (0);
:global connected (0);
######################

######################
:foreach i in=[/ppp active find] do={ :set userX [/ppp active get $i name];
:global connected ($connected+1);
/interface monitor-traffic [ /interface find name=$userX ] once do {:if ($"sent-bits-per-second" >=$ActiveThresholddown) do { :set onlineclientsdown ($onlineclientsdown+1);}} };

:foreach ii in=[/ppp active find] do={ :set userX [/ppp active get $ii name];
/interface monitor-traffic [ /interface find name=$userX ] once do {:if ($"received-bits-per-second" >=$ActiveThresholdup) do { :set onlineclientsup ($onlineclientsup+1);}} };

:if ($onlineclientsdown = 0) do {:set onlineclientsdown (1)};
:if ($onlineclientsup= 0) do {:set onlineclientsup (1)};

:local ratelimitdown ($MaxRateDownload/$onlineclientsdown)
:local ratelimitup ($MaxRateUpload/$onlineclientsup)

:foreach z in=[/ppp active find] do={ :set userX [/ppp active get $z name];
/queue tree set [/queue tree find name=($userX . "_down")] parent=$ParentDownload packet-mark=($userX . "_down") queue=pcq_download priority=8 max-limit=$ratelimitdown

/queue tree set [/queue tree find name=($userX . "_up")] parent=$ParentUpload packet-mark=($userX . "_up") queue=pcq_upload priority=8 max-limit=$ratelimitup};
######################

######################
:local kbsmaxdown ($MaxRateDownload/1000);
:local kbsmaxup ($MaxRateUpload /1000);
:local kbsthr ($ActiveThresholddown/1000);
:local kbsdown ($ratelimitdown/1000);
:local kbsup ($ratelimitup/1000);

#:log warning ("Shaper:");
#:log info ("MaxRate Download : " . $MaxRateDownload . " bps /" . $kbsmaxdown . " kbs / Upload : " . $MaxRateUpload . " bps /" . $kbsmaxup . " kbs");
#:log info ("Threshold: Download : " . $ActiveThresholddown . " bps /" . $kbsthr . " kbs / Upload : " . $ActiveThresholdup . " bps /" . $kbsthr . " kbs");
#:log info ("Connected Users : " . $connected ." ---- ". "Active Users : Download : " . $onlineclientsdown . " / Upload : " . $onlineclientsup);
#:log info ("User Speed Download : " . $ratelimitdown . " bps /" . $kbsdown . " kbs / Upload : " . $ratelimitup . " bps /" . $kbsup . " kbs");
######################

(C) Inlarion icq 429-587 Copyright!

Try to copy that into it over SSH with a program like putty. It will highlight in red where it has a problem with the syntax of the script. That will at least get you pointing in the right direction to look.