log entry and action when occurs

search better on forum, some of my script do not catch twice the same log, only new added log…


http://forum.mikrotik.com/t/how-to-make-mikrotik-beep-on-adding-new-log-entry/173034/3
:global lastLog
:if ([:typeof $lastLog] != “num”) do={:set lastLog 0}

{
:local id2num do={:return [:tonum “0x$[:pick $1 1 [:len $1]]”]}

/log
:foreach item in=[find where (([$id2num $“.id”] > $lastLog) and (message=“FCC: Attemtped to send a frame with no bonded connections established”))] do={
:set lastLog [$id2num $item]
# do something here…
}

}