I’m looking to write a script that checks to see if a host is up (as a boolean) so I can use it in an if statement.
I wrote this but not working 
:if (string.find([/tool/ping address=192.168.0.5 count=1],“timeout”) ) do={ :put “value is false” } else={ :put “value is true” }
:if (:find [/tool/ping address=192.168.0.5 count=1] “timeout” 0 ) do={ :put “value is false” } else={ :put “value is true” }
Also the scripts in netwatch (the ‘test’ script), are arguments passed into these at all?
if (write.at.random true) what do you expect?
:if ([:ping address=192.168.0.5 count=1] = 0) do={
:put "reply NOT received"
} else={
:put "reply received"
}
Yes, I got the echos incorrect on my first post as I had copied it, but it still gave the same text if the host was up or down.
Unfortunately, the code you gave does not appear to work either.
[j@MikroTik] > /system script run script1
Columns: SEQ, HOST, SIZE, TTL, TIME
SEQ HOST SIZE TTL TIME
0 1.1.1.1 56 58 25ms735us
reply received
[j@MikroTik] > /system script run script1
Columns: SEQ, HOST, STATUS
SEQ HOST STATUS
0 192.168.192.192 timeout
reply received
[j@MikroTik] >
Why not???
Nex time specify that you use RouterOS v6 or v7…
for v7:
:if ([:typeof ([:ping address=195.168.0.5 count=1 as-value]->"time")] = "nothing") do={
:put "reply NOT received"
} else={
:put "reply received"
}
anav
5
Fixed it for you, in the spirit of the title! 
Not sure I get your joke
But thank you for the help
You really do not noticed that the @anav version is for joke and on my previous post is present the working version???
anav
9
I found it amusing, maybe the yolk is on you… * as in an inseminated egg* lol…
Really sorry but I can’t understand your broken English
Thanks again for the help