need help with flood-ping script

I am trying to graph the ping time from the CPE to the AP. I am installing this script on the CPE and having it ping the gateway. The script seems to always take the first floodping result.. which is usally a 0

[admin@MntRobAP] /tool> :local "max-rtt"; /tool flood-ping  66.xxx.xxx.4 count 10   do={ :put [$"max-rtt"]} 
0
      sent: 1
      sent: 10
  received: 10
   min-rtt: 12
   avg-rtt: 15
   max-rtt: 23

Since I am looking for max-rrt I should get a 23, but you can see it returns a 0.
Is there any way to tell the script to wait for the floodping command to end before getting the value?

or is there some other way to get ping stats.

thanks!

do={} is executed at start, end and at every ‘interval’, and you only want the last

:local maxRtt; /tool flood-ping 66.xxx.xxx.4 count=10 do={:if ($sent = 10) do={:set maxRtt $"max-rtt"}}; :put $maxRtt;

Where do you find these odd constructs, I can’t seem to find any documentation for them!

thanks.. that worked great.

Im not sure I understand what you mean when you ask where I found the constructs ?

The other day you asked about /interface monitor-traffic do={} and this is about /tool flood-ping do={}, and I just haven’t seen these do={}'s used in that manner before, and as I said, they are not well documnted.