Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Network Latency Bar


  • Please log in to reply
No replies to this topic
bluserver
  • Members
  • 34 posts
  • Last active: Feb 13 2012 03:51 AM
  • Joined: 07 Aug 2010
I made this script to monitor the delay of my internet connection and thanks to this guys http://www.autohotke...be8db92f2cc7370 they helped me to accomplish this.

Here is the code:
#SingleInstance, force

IP = www.autohotkey.com

Gui, +AlwaysOnTop +Border +ToolWindow
Gui, Color, EEAA99
Gui, +LastFound
WinSet, TransColor, EEAA99
Gui, Font, S8 CDefault Bold, Verdana
Gui, Add, Text, x6 y10 w60 h20 , Latency:
Gui, Add, Progress, x66 y10 w360 h20 -smooth cred vlatency, 0
Gui, Add, button, x6 y30 w420 h20 default vcheck gcheck, Check Latency
Gui, Show, x 627 y3 w435 h59, Latency Bar
Return

check:
Loop
{
	FileDelete, %A_temp%\latency.txt
	RunWait, %comspec% /C Ping %ip% -n 1 >"%A_temp%\latency.txt",,Hide
	Connected := NOT ErrorLevel
	if Connected
	{
		FileReadLine, ping, %A_temp%\latency.txt, 4
		Loop, parse, ping, =
		if a_index=3
		StringTrimRight, ping, A_LoopField, 6
		if ping < 1000
		{
			StringTrimRight, str, ping, 1
			GuiControl, , latency, %str%
			GuiControl,, check, %ip% %ping% ms
		}
		Else if ping > 1000
		{
			GuiControl,, latency, 100
			GuiControl,, check, %ip% %ping% ms
		}
	}
	Else
	{
		GuiControl,, latency, 100
		GuiControl,, check, %ip% Request Time Out!
	}	
}

GuiClose:
ExitApp

This is a GUI with a progress bar shows the percentage of my network latency. If this not works for you change the filereadline index to 3 according to Zaelia and icefreez original script.

Thats it.. Thanks..