alisc
1
hi everybody ,
I’m not English
my english not so good , excuse me
i have a question :
i found this script in Web
i want customized this
plaese help me
goal : IF ping 4.2.2.4 and time out count is 10 then , SMS Send ! ( Down )
the when 4.2.2.4 is Replay , then SMS Send ( UP )
is now , the when 4.2.2.4 is 2-3 count time out , SMS sending !
my script is :
:local result [/ping 4.2.2.4 src-address=192.168.1.1 count=9]
:global status
:if ($result = 10 && $status != true) do={
/tool sms send "usb4" "+100000000" message="Internet - UP"
/tool sms send "usb4" "+100000000" message="Internet - UP"
:set status true
} else={
:if ($result = 0 && $status != false) do={
/tool sms send "usb4" "+100000000" message="Internet - Down"
/tool sms send "usb4" "+100000000" message="Internet - Down"
:set status false
}
}
help me 
If I understand correctly:
First of all, on RouterBoard set this schedule to start 1 minute after Startup:
:global try value=10;
:global lastsms value="DOWN";
Then schedule this:
:local result value=[/ping interval=1s address=4.2.2.4 src-address=192.168.1.1 count=$try];
:if ($result>=$try and $lastsms!="UP") do={
/tool sms send port=usb4 phone-number="+100000000" message="Internet - UP";
:set lastsms value="UP";
:set try value=4;
};
:if ($result<$try and $lastsms!="DOWN") do={
/tool sms send port=usb4 phone-number="+100000000" message="Internet - DOWN";
:set lastsms value="DOWN";
};