How To choose The Best Channel ??

Hi Every one
I have written a script to choose the channel which noise-floor is lower, but it seems it doesn,t work well
Look at My script what parameter can I choose to have the Best channel ??

:foreach i in=[/interface wireless find mode=ap-bridge] do={/interface wireless monitor $i once do={:if ($noise-floor > -98) do={:local tmpfreq [/interface wireless get $i frequency ];
:log error $tmpfreq ;
:set tmpfreq ($tmpfreq + 5);
:log warning $tmpfreq;
:if ($tmpfreq < 2472) do={/interface wireless set $i frequency=$tmpfreq} else={/interface wireless set $i frequency=2412 ;}}}}

is this in client side or in AP side?

Regards
Leon

Of course on Access Point’s Side

Is it on 2.9 or 3.0 ?

It is on 2.9.49

notice how noise-floor changes between each time you reset/reconfigure a wireless interface.