Jump to content

Internet monitor


Aceguy
 Share

Recommended Posts

#include <GuiConstants.au3>
#include <GuiListView.au3>

$xlength = 150
$ylength = 100

Global $drop_count,$dropped,$time

$mon = GUICreate("commentpile", $xlength, $ylength, 193, 125, $WS_BORDER+$WS_POPUP,$WS_EX_TOOLWINDOW+$WS_EX_TOPMOST)

GUICtrlCreateLabel("Internet Monitor v1.0", 0, 0, $xlength, -1, $ES_CENTER, $GUI_WS_EX_PARENTDRAG)
GUICtrlSetFont(-1, 7)

$list = _GUICtrlListView_Create($mon, "", 2, 15, $xlength - 8, $ylength - 20)

_GUICtrlListView_InsertColumn($list, 0, "Column 1", 70)
_GUICtrlListView_InsertColumn($list, 1, "Column 2", 70)

$drop_count = 0
$time=0
$dropped = False
$drop_last=0
_GUICtrlListView_AddItem($list, "Dropped: ")
_GUICtrlListView_AddSubItem($list, 0, $drop_count, 1)
_GUICtrlListView_AddItem($list, "Status: ")
_GUICtrlListView_AddSubItem($list, 1, "Checking", 1)
_GUICtrlListView_AddItem($list, "Time: ")
_GUICtrlListView_AddSubItem($list, 2, $time, 1)

GUISetState(@SW_SHOW)


while 1
Do
Sleep(3000)
_GUICtrlListView_AddSubItem($list, 1, "Up", 1)
$ping=Ping("www.google.com",2500)
if @error=0 Then
    $dropped=False
    $drop_last=0
Else
    $dropped=True
EndIf
ConsoleWrite($dropped&@lf)
until $dropped=True

$minute = Floor(Mod(($time / 60), 60))
$time+=3

if $drop_last=0 Then 
$drop_count += 1
$drop_last=1
EndIf

_GUICtrlListView_AddSubItem($list, 2, $minute&":"&$time, 1)
_GUICtrlListView_AddSubItem($list, 0, $drop_count, 1)
_GUICtrlListView_AddSubItem($list, 1, "Down", 1)
WEnd

Edited by Aceguy
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...