Hi ,
I need a help for adding trial user if user lover then dbm -23
thats for tab to device and start the trial connect .
:local signal;
:foreach i in=[ /int wir reg find ap=no] do={
:set signal [int wir reg get $i signal-strength];
:set signal [ :pick $signal 0 [:find $signal “dBm”]]
:if ($signal ≥ -23) do={
/ip hotspot user add name=T-“$[int wir reg get $i mac-address]”
}
}
its not working … what i do wrong.
Wait your replys.
Try this
{
set required signal here
:global required 23
set your hotspot trial profil here
:global prof "trial-profile-name"
:global mac
:global signal
:global picksignal
:global action
:foreach i in=[ /int wir reg find ap=no] do={
:set signal [/int wir reg get $i signal-strength];
:set picksignal [:pick $signal 1 3 ];
:if ($picksignal >= $required) do={
:set mac [/int wir reg get $i mac-address ];
:if ([/ip hotspot user find where name="T-$mac" ] = "" ) do={
:set action [/ip hotspot user add name="T-$mac" mac-address=$mac profile="$prof" ];
:log warning ("New Trial User with Signal->$picksignal and Mac->$mac");
}}}}
thanks for your reply,
its working but user didn’t add like trial user. How can i add user like trial user. …