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!

good idea would be to open terminal and open script in editor, there you will see the mark-up and clearly recognize where is the problem.
as it seems your script is copyrighted, so you have to correct it yourself.

which editor to recommend?

there is only one editor i know and it is built into RouteOS. “/system script edit source”

when you edit script that is on the router.

that correct?
error.jpg

as you see - after do it wants to see “=” (equal sign) and for comparing sent-bits-per-second to something use notation “sent-bits-per-second” instead of $“sent-bits-per-second” and you should be ok.