Script does not run after upgrade!!

need ur help colleagues,
after upgrading from 2.9.51 to 4.10 .. the script isn’t running anymore..
how can i fix this?

There were some changes to the script interpreter from V2.x to both V3.x and V4.x. You will need to modify the script to comply with those changes. See the User Manual here
http://wiki.mikrotik.com/wiki/Manual:Scripting
If you need help, and it isn’t a horribly complex script, you might post it here. Maybe someone will help you.

I really didn’t know how to write it and make it work!!

here is the script that it was working on 2.9 and would like to make it work on 4.10.

:local traf;
/queue simple
:for i from=1 to= 254 do = {
:if ([/queue simple find target-addresses=(“172.28.2.” . $i)] != “”) do={
:set traf [get [find target-addresses=(“172.28.2.” . $i)] total-bytes]
:if ($traf <204857600) do = {
set [find target-addresses=(“172.28.2.” . $i)] max-limit=64000/256000 limit-at=64000/256000
}
}
}

This shows ok now:

:local traf;
/queue simple
:for i from=1 to= 254 do={
:if ([/queue simple find target-addresses=("172.28.2." . $i)] != "") do={
:set traf [get [find target-addresses=("172.28.2." . $i)] total-bytes]
:if ($traf < 204857600) do={
set [find target-addresses=("172.28.2." . $i)] max-limit=64000/256000 limit-at=64000/256000
}
}
}

ADD: I corrected only format errors. I did not check it to see if it does what you require.

it still not working ..
the script is running ( i can see this when the cpu is 100% ) but nothing is changed in my queue.. meaning users passing the 200M still running at normal speed after the script is turned on.

anyone know how to fix this guys!!

How did you go with this. I just upgraded one of mine and have the same problem.

Currently, 01/2014 - Router OS v6.7, I had a similar problem, the script stopped working:
The reason is that parameters were renamed: replace “target-addresses” with “target”.
It is also necessary to specify the IP addresses including subnet mask: “172.16.66.” . $i . “/32”.

The full version of a similar script (restrict hungry users):

:local traf;
/queue simple
:for i from=20 to=244 do={
   :if ([/queue simple find target=("172.16.66." . $i . "/32")] != "") do={
      :set traf [get [/queue simple find target=("172.16.66." . $i . "/32")] total-bytes]
      :if ($traf  > 536870912) do={
        set [find target=("172.16.66." . $i . "/32")] max-limit=1024k/1024k
      }
   }
}

Hopefully, this will help someone…