Hello guys, I am quite new to mikrotik scripting and I would like to ask for help regarding my script which I would like to introduce. I would like my computer to be started by WOL when some traffic will be recorded on firewall filter rule. I am not sure if I am going the right way at all. The purpose of this for me is to be able to remotely start the computer (media server) whenever ip (share) is tried to be reached from TV. Here is the script I am developing. I would really appreciate some insight or even help.
:local seed 0 #counter
:foreach i in=[/ip firewall filter find comment=MEDIA_SERVER] # finding correct filter rule by comment
do={
:if item in=[/ip firewall filter fint bytes>0] do={ # if bytes in the rule are > 0 set counter to the number
:set seed ($seed+[/ip firewall filter get $item bytes])
:set seed1 ($seed) # set control counter
:if (seed > 0) and (seed != seed1) do: {
/tool wol mac=“my MAC adress” interface=ether4
}