Yet another low wireless signal script

Here’s a script I’m using to “tag” low signal wireless users, maybe someone will find it useful:

:local ipaddr;
:local macaddr;
/interface wireless registration-table
:foreach i in=[ /interface wireless registration-table find ap=no] do={
  :set ipaddr [get $i last-ip]
  :set macaddr [get $i mac-address]
  :if (([get $i signal-to-noise] < 30) and ($ipaddr != "")) do={
    :if ([/ip firewall address-list find list="LowSignal" address=$ipaddr] != "") do={
    /ip firewall address-list enable [find list="LowSignal" address=$ipaddr]
    } else={ /ip firewall address-list add list="LowSignal" address=$ipaddr comment=$macaddr }
    :log warning ("LowSignal: " . $ipaddr . " S/N ratio too low (" . [get $i signal-to-noise] . "dB)")
  } else={ /ip firewall address-list disable [find list="LowSignal" address=$ipaddr] }
}

It adds IP addresses of wireless clients with s/n ratio lower than 30dB to firewall access list named “LowSignal”, so you can do various stuff with them (for example, slow them down).