#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_icon=N001.ico #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include $address = InputBox("Ping target", 'Enter any (pingable, that always replyes back) address:', "", "", "", 150) Opt("TrayMenuMode", 1) HotKeySet("{F7}", "_seekstop") IF $address > "" Then _checkconnect() Else _error() EndIf MsgBox(64, "Info:", "For exit just press F7.") Func _checkconnect() $ping = Ping($address) If $ping > 0 Then _connected() Else _disconnected() EndIf Sleep(10000) EndFunc Func _connected() TraySetIcon(@SystemDir & "\shell32.dll", 10) TraySetToolTip("Internet connection is OK") _connectionexists() EndFunc Func _disconnected() TraySetIcon(@SystemDir & "\shell32.dll", 11) TraySetToolTip("Something wrong with internet connection") EndFunc Func _connectionexists() $exists = MsgBox(68, "OK", "Fine, connection exists now. Would you like to stop seeking?") If $exists = 6 Then _nowexit() Elseif $exists = 7 Then TraySetIcon(@SystemDir & "\shell32.dll", 10) EndIf EndFunc Func _seekstop() $seekstop = MsgBox(68, "Exit?", "Would you like to stop seeking?") If $seekstop = 6 Then _nowexit() Elseif $seekstop = 7 Then Sleep (10) EndIf EndFunc Func _nowexit() Exit EndFunc Func _error() MsgBox(48, "Error", "You did not entered any address.") _nowexit() EndFunc While 1 _checkconnect() WEnd