Hotspot: active users count

Hi all,

I’d like to create a basic script to count the active users, so I can reset the speedlimit per user, in order to maximize bandwith when only a few users are logged in. The script itself shouldn’t be too hard, but I simply can’t figure out how to count the total users logged in. Could someone push me in the right direction? I assume it has some command in the “/ip hotspot active”-dir?

I don’t need a complete script, but just this command :wink:

Thank you in advance!

noes

ahh, figured it out already, now I fully understand the :len command! :smiley:

:put [:len [/ip hotspot active find]]

print count-only is a lot faster

its possible to run this from login html pages ??
thx

A better alternative to this would be to setup PCQ based queues that automatically allocate share available bandwidth between online users.
This way there’s no need for any independent scripting to determine how the queues should/could change.

Check out the presentation done here: http://www.tiktube.com/?video=mEeI3iCGhLLqJKFEKHJsmrovllGoILDp=
And accompanying slides: http://mum.mikrotik.com/presentations/US11/us11-megis.pdf