AutoIt ping script.

Here’s an AutoIt script that functions as a regular ping utility. It pings your specified destination 5 times and calculates the average round trip time.

Dim $a=0
$target=InputBox (“Pinger”, “Enter ping target: “)
if $target=”” then
Exit
endif
for $g=1 to 5
$pong = Ping ($target,250)
If @error = 0 Then
Msgbox(0,”Ping ” & $g & ” of 5″,”Response from ” & $target & ” in “& $pong & ” ms”,1)
elseif @error = 1 Then
Msgbox(0,”Ping ” & $g & ” of 5″, $target & ” is offline”,1)
elseif @error = 2 Then
Msgbox(0,”Ping ” & $g & ” of 5″, $target & ” is unreachable”,1)
elseif @error = 3 Then
Msgbox(0,”Ping ” & $g & ” of 5″, $target & ” is a bad destination”,1)
Else
Msgbox(0,”Ping ” & $g & ” of 5″, “Unknown error encountered”,1)
EndIf
$a=$pong + $a
next
Msgbox (4096, “Results”, “Average roundtrip time: ” & $a / 5 & ” ms”)

Advertisements

One Response to “AutoIt ping script.”

  1. Anonymous Says:

    nice

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: