User talk:Sitevb
From MikroTik Wiki
"NetCut((vision))"
/system scheduler add comment="\C7\E3\D3\DF \CD\D1\C7\E3\EC" disabled=no interval=1m name=\
"NetCut((vision))" on-event=":global ho [/ip dhcp-server lease find]\r\
\n:global num \"\"\r\
\n:global htr 0\r\
\n:global theve \"\"\r\
\n:global dur 1\r\
\n:foreach h1 in=\$ho do={\r\
\n:global host [/ip dhcp-server lease get \$h1 host-name]\r\
\n:if ([:len \$host] >0) do={\r\
\n:set num (\$num . \",\" . \$host)\r\
\n:set htr (\$htr + 1)\r\
\n}}\r\
\n:global numArr [:toarray \$num];\r\
\n:foreach h2 in=\$numArr do={\r\
\n:global hh 0\r\
\n:if (\$dur > 0) do={\r\
\n:foreach k in=\$numArr do={ :if (\$k=\$h2) do={:set hh (\$hh + 1) } }\r\
\n:if (\$hh>2) do={\r\
\n:if ([:len \$theve] >0) do={:set theve (\$theve . \",\" . \$h2)} else={:se\
t theve \$h2}\r\
\n}}}\r\
\n:if (\$dur > 0) do={\r\
\n:if ([:len \$theve] >0) do={\r\
\n:log warning (\"New theve: \" . \$theve)\r\
\n:global theveArr [:toarray \$theve];\r\
\n:foreach h2 in=\$theveArr do={\r\
\n:foreach i in= [/ip dhcp-server lease find host-name=\$h2] do={\r\
\n:global ipnum [/ip dhcp-server lease get \$i address]\r\
\n:global mac [/ip dhcp-server lease get \$i mac-address]\r\
\n:global unum [/ip hotspot active find address=\$ipnum]\r\
\n:if (\$dur > 0) do={\r\
\n/ip hotspot ip\r\
\n:if ([find address=\$ipnum]=\"\") do={\r\
\nadd mac-address=\$mac address=\$ipnum comment=\$h2 type=blocked} else={ se\
t [find address=\$ipnum] type=blocked \r\
\n}}}}}}" policy=\
ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive,api \
start-time=startup