;basic ping times test Dim $PngTimes[100] ;PINGTEST $PngTimes[1] = Ping("www.autoitscript.com", 500) If $PngTimes[1] = 0 Then $PngTimes[1] = "error" ;PINGTEST $PngTimes[2] = Ping("google.com", 500) If $PngTimes[2] = 0 Then $PngTimes[2] = "error" ;PINGTEST $PngTimes[3] = Ping("yahoo.com", 500) If $PngTimes[3] = 0 Then $PngTimes[3] = "error" ;PINGTEST $PngTimes[4] = Ping("cnet.com", 500) If $PngTimes[4] = 0 Then $PngTimes[4] = "error" ;PINGTEST $PngTimes[5] = Ping("www.newegg.com", 500) If $PngTimes[5] = 0 Then $PngTimes[5] = "error" ;PINGTEST $PngTimes[6] = Ping("www.tomshardware.com", 500) If $PngTimes[6] = 0 Then $PngTimes[6] = "error" ;PINGTEST $PngTimes[8] = Ping("youtube.com", 500) If $PngTimes[8] = 0 Then $PngTimes[8] = "error" ;PINGTEST $PngTimes[9] = Ping("download.com", 500) If $PngTimes[9] = 0 Then $PngTimes[9] = "error" ;PINGTEST $PngTimes[11] = Ping("timestore.org", 500) If $PngTimes[11] = 0 Then $PngTimes[11] = "error" ;PINGTEST $PngTimes[12] = Ping("timestore.com", 500) If $PngTimes[12] = 0 Then $PngTimes[12] = "error" ;PINGTEST $PngTimes[13] = Ping("geocities.com", 500) If $PngTimes[13] = 0 Then $PngTimes[13] = "error" ;PINGTEST $PngTimes[14] = Ping("automatedqa.com", 500) If $PngTimes[14] = 0 Then $PngTimes[14] = "error" ;PINGTEST $PngTimes[15] = Ping("wikipedia.org", 500) If $PngTimes[15] = 0 Then $PngTimes[15] = "error" ;PINGTEST $PngTimes[16] = Ping("microsoft.com", 500) If $PngTimes[16] = 0 Then $PngTimes[16] = "error" ;PINGTEST $PngTimes[17] = Ping("vmware.com", 500) If $PngTimes[17] = 0 Then $PngTimes[17] = "error" ;PINGTEST $PngTimes[18] = Ping("msdn.microsoft.com", 500) If $PngTimes[18] = 0 Then $PngTimes[18] = "error" ;PINGTEST $PngTimes[19] = Ping("usbank.com", 500) If $PngTimes[19] = 0 Then $PngTimes[19] = "error" ;PINGTEST $PngTimes[20] = Ping("aol.com", 500) If $PngTimes[20] = 0 Then $PngTimes[20] = "error" ;Now write results to an output file $file = FileOpen("C:\" & @ComputerName & " pingtimes.txt", 1) ; Check if file opened for reading OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf FileWriteLine($file, "************************************************************") FileWriteLine($file, "** PING TIMES ** " & @MON & " " & @MDAY & ", " & @YEAR & " - " & @HOUR & ":" & @MIN & " **") FileWriteLine($file, "************************************************************") FileWriteLine($file, $PngTimes[1] & " www.autoitscript.com") FileWriteLine($file, $PngTimes[2] & " google.com") FileWriteLine($file, $PngTimes[3] & " yahoo.com") FileWriteLine($file, $PngTimes[4] & " cnet.com") FileWriteLine($file, $PngTimes[5] & " www.newegg.com") FileWriteLine($file, $PngTimes[6] & " www.tomshardware.com") FileWriteLine($file, $PngTimes[8] & " youtube.com") FileWriteLine($file, $PngTimes[9] & " download.com") FileWriteLine($file, $PngTimes[11] & " timestore.org") FileWriteLine($file, $PngTimes[1] & " timestore.com") FileWriteLine($file, $PngTimes[1] & " geocities.com") FileWriteLine($file, $PngTimes[1] & " automatedqa.com") FileWriteLine($file, $PngTimes[1] & " wikipedia.org") FileWriteLine($file, $PngTimes[1] & " microsoft.com") FileWriteLine($file, $PngTimes[1] & " vmware.com") FileWriteLine($file, $PngTimes[1] & " msdn.microsoft.com") FileWriteLine($file, $PngTimes[1] & " usbank.com") FileWriteLine($file, $PngTimes[1] & " aol.com") Dim $ICount, $I, $ISum, $PngAve $ICount = 0 $ISum = 0 For $I = 1 To 20 If $PngTimes[$I] <> "error" Then $ICount = $ICount + 1 $ISum = $ISum + $PngTimes[$I] EndIf Next If $ICount > 0 Then $PngAve = $ISum / $ICount Else $PngAve = "No results to average!" EndIf FileWriteLine($file, $PngAve & " - Average Ping Time") FileWriteLine($file, " ") FileWriteLine($file, "************************************************************") FileWriteLine($file, "** END PING TIMES ** ") FileWriteLine($file, "************************************************************") FileWriteLine($file, " ") FileClose($file)