#1

hi guys share ko lang guys gamit ko na fix uptime limit sana po makatulong sa inyo.. 


Credits to mr.aljhon tronics 
Donation is very welcome: 
Gcash account: Angel Jhon 09305273559
Paypal account: paypal.me/angeljhon08



1.) add a script to the end of On-Logout in user profile

User Profile On Logout

/sys sch set [find where name=$user] comment="";


2.) copy and paste to terminal to create scheduler

Mikrotik Terminal

/system scheduler add interval=5s name="uptime backup" on-event=":local hsactiveuptime;\r\ \n:local hsuser;\r\ \n:local hslimit;\r\ \n\r\ \n:if ([/ip hotspot active print count-only] > 0) do={\r\ \n:foreach i in=[/ip hotspot active find] do={\r\ \n:set hsactiveuptime [/ip hotspot active get \$i uptime];\r\ \n:set hsuser [/ip hotspot active get \$i user];\r\ \n:set hslimit [/ip hotspot user get \$hsuser limit-uptime];\r\ \n/system scheduler set [find where name=\$hsuser] comment=\"temp \$hsacti\ veuptime\";\r\ \n\t\t}\r\ \n\t}\r\ \n" policy=\ ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \ start-time=startup add name="uptime restore" on-event=":local ucom;\r\ \n:local hsolduptime;\r\ \n:local hsnewuptime;\r\ \n:local hsactiveuptime;\r\ \n:local hsuser;\r\ \n:local temp; \r\ \n:foreach ie in=[/sys sch find] do={\r\ \n :set \$ucom [/sys sch get \$ie comment]; \r\ \n:if (\$ucom != \"\") do={ \r\ \n:set \$temp [:pick \$ucom 0 4];\r\ \n:if (\$temp = \"temp\") do={\r\ \n :set \$hsuser [/sys sch get \$ie name]; \r\ \n:if ([/ip hotspot user find name=\$hsuser]) do={\r\ \n:set \$hsolduptime [/ip hotspot user get [find where name=\$hsuser] limi\ t-uptime];\r\ \n:set \$hsactiveuptime [:pick \$ucom 5 ([:len \$ucom] + 1)]; \r\ \n:set \$hsnewuptime (hsolduptime - \$hsactiveuptime);\r\ \n/ip hotspot user set [find where name=\$hsuser] limit-uptime=\$hsnewupti\ me;\r\ \n/sys sch set [find where name=\$hsuser] comment=\"\";} else={ /sys sch r\ emove \$ie;}\r\ \n}}}" policy=\ ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \ start-time=startup

--Forum Rules --BBcodes


image quote pre code