Hi
I have a problem with the script increasing user uptime-limit currently logged in, skript don’t work with foreach loop for users in ip> hotspot> user.
When I remove the loop and replace “counter” the username it works fine, but I would like to do automatically. I don’t know what wrong with this loop. Please help.
#get user uptime
:local upt
#get user limit-uptime
:local lupt
limit-uptime - uptime
:local roznica
#set new user uptime
:local nupt
:local counter
:foreach counter in=[/ip hotspot user find ] do={
:set upt [/ip hotspot user get $counter uptime]
:set lupt [/ip hotspot user get $counter limit-uptime]
:set roznica ($lupt-$upt)
:if ($roznica < 5) do={
:set nupt ($upt + 15m)
/ip hotspot user set limit-uptime=$nupt [/ip hotspot user find where name =$counter]
}}