Netwatch Script Question

hi ,

I just currently using one of the scripts for failover.

i just want to understand some part of the script.

/system script add name=pinging source={
  :if ([/ping 1.1.1.1 count=5] = 0) do={
    /tool e-mail send \
      to=example@example.com \
      subject="Can't ping 1.1.1.1"
    }
  }

The 2nd line

 :if ([/ping 1.1.1.1 count=5] = 0) do={

What does the code actually do?
Is 0 the number of replies that is needed for the condition to be successful or is it sort of an exit status?

Some console commands are most useful if their output can be used as an argument value in other commands. In console, this is done by “returning” value from commands. Return value is not displayed on the screen. When you type such a command between square brackets ‘[’ ‘]’, this command is executed > and it’s return value is used as the value of these brackets> . This is called command substitution.

https://www.mikrotik.com/documentation/manual_2.7/System/Scripting.html
I don’t know, why I cannot find this info in more recent source.

Thanks for reply and the link.

Ive tested the output of

:put [/ping 8.8.8.8 count=15];

Ive created a firewall rule on the router to block inbound traffic if the source is 8.8.8.8. Ill be re-enabling and disabling the firewall rule to control the count of successful pings.

There is a number on the end of ping test. Its the count of the successful pings.
ping to 8.8.8.8.PNG