Help cant create ip address list

Please do help, id like to create a script wherein when the sys scheduler is disabled, automatically it will create ip address list base on ppp active name and ip, here’s my code

/system scheduler
:foreach item in=[find where disabled] do={
    :local disAcc [get $item name]
    /ppp active
    :foreach sname in=[find where name=$disAcc] do={
        :local ip [get $sname address]
        :local notif [get $sname name]
        :log warning "Acc Name: $notif IP: $ip"
        /ip firewall address add list=PPPOE-CLIENT-NOTIFY address=$ip comment=$notif
    }
}

Thankyou in advance

The description is bad, especially is not clear the final goal.

If you have a scheduler for each user, and you want to put in one address-list the IP addresses of users who have their respective scheduler disabled (and are currently online)…

:local lname “PPPOE-CLIENT-NOTIFY”
:local uname “”
:local uaddr 0.0.0.0
:local results [:toarray “”]
/ip firewall address-list remove [find where list=“PPPOE-CLIENT-NOTIFY”]
/system scheduler
:foreach item in=[find where disabled] do={
:set uname [get $item name]
/ppp active
:set results [find where name=$uname]
:if ([:len $results] = 1) do={
:set uaddr [get $results address]
/ip firewall address-list add list=$lname address=$uaddr comment=$uname
}
}

Thankyou for your response sir Rex :blush::blush::blush:. so much appreciated. The problem is almost identical to my other post

http://forum.mikrotik.com/t/ppp-secret-profile-wont-set/164743/3

each ppp secret has its own scheduler, if the ppp account scheduler is disabled it will list the ppp active IP of the disabled ppp account to ip address-list notify .

The problem is the last part of the code, it just list the first disabled scheduler and after that the code is discontinued.

I haven’t tried your revise code sir. Im riding a jeepney going home right now . I’ll gonna try it when I’m on my home :grin::grin:

Thankyou sir rex! IT works! I can now live happily ever after!