Scripts end contact pppoe server

Hello guys
This JavaScript function is the creation of a profile in pppoe named at the end of the end user to create for a day or two or a month automatically switches to the end of the profile, but this script does not work I have a possible help and thank you.



/system script
add name=finish source=“\r
\n{\r
\n :global date [ /system clock get date ]\r
\n :global array ( "jan","feb","mar","apr","may","jun","jul",
"aug","sep","oct","nov","dec" )\r
\n :global numday ( 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 )\r
\n :global days [ :pick $date 4 6 ]\r
\n :global tax [ :pick $date 0 3 ]\r
\n :global happy [ :pick $date 7 11 ]\r
\n :global months ([ :find $array $tax] )\r
\n :for nodays from=0 to=$months do={\r
\n :set days ( $days + [ :pick $numday $nodays ] )\r
\n }\r
\n :global daynow ($days + ($happy * 365))\r
\n/ip hotspot active\r
\n:foreach user in=[find] do={\r
\n:global active [get $user user]\r
\n/ip ho user\r
\n:foreach use in=[find name=$active] do={\r
\n:global comm [get $use comment]\r
\n:global byte ([get $use bytes-out]/1074000000)\r
\n :local mail [:tostr [get $use email]];\r
\n :global limit [:pick $mail -1 [:find $mail "@"]];\r
\n:if ( $comm < 5000 ) do={[set $use comment=($comm + $daynow) ]} else={
\r
\n:if ( ( $daynow - $comm) >= "1" ) do={[remove $use ]}\r
\n:if ( $byte >= $limit ) do={[set $use profile="low" ]\r
\n/ip ho active remove [find user=$active]} \r
\n:if ( $comm <= $daynow ) do={[set $use profile="finish" ]\r
\n/ip ho active remove [find user=$active]}\r
\n/ppp active\r
\n:foreach ppuser in=[find] do={\r
\n:global ppactive [get $ppuser name]\r
\n/ppp secret\r
\n:foreach ppuse in=[find name=$ppactive] do={\r
\n:global ppcomm [get $ppuse comment]\r
\n:if ( $ppcomm < 5000 ) do={[set $ppuse comment=($ppcomm + $daynow) ]}
\r
\n:if ( ( $daynow - $ppcomm) >= "1" ) do={[remove $ppuse ]} \r
\n:if ( $ppcomm <= $daynow ) do={[set $ppuse profile="finish" ]\r
\n/ppp active remove [find name=$ppactive]\r
\n}}}}}}}”