how to detect web connection is lost?

Get help with using AutoHotkey and its commands and hotkeys
User avatar
joedf
Posts: 7655
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada
Contact:

Re: how to detect web connection is lost?

05 Nov 2013, 20:42

Just replace all the "throw" lines with "Return 0" ;)
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x8GB G.Skill RipJaws V - DDR4 3280 MHz | [About Me] | [ASPDM - StdLib Distribution]
[Populate the AHK MiniCity!] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library] | [About the AHK Foundation]
User avatar
DataLife
Posts: 358
Joined: 29 Sep 2013, 19:52

Re: how to detect web connection is lost?

06 Nov 2013, 00:59

joedf wrote:Just replace all the "throw" lines with "Return 0" ;)
thanks
Check out my scripts. (MyIpChanger) (ClipBoard Manager) (SavePictureAs)
All my scripts are tested on Windows 10, AutoHotkey 32 bit Ansi unless otherwise stated.
merihcobanmc
Posts: 1
Joined: 04 Mar 2020, 05:21

Re: how to detect web connection is lost?

04 Mar 2020, 06:56

#Persistent
SetTimer,CheckInternet,100
return

CheckInternet:
msgbox hello
result := ping()
msgbox %result%
return


ping(host="8.8.8.8") {
colPings := ComObjGet( "winmgmts:" ).ExecQuery("Select * From Win32_PingStatus where Address = '" host "'")._NewEnum

While colPings[objStatus]
Return ((oS:=(objStatus.StatusCode="" or objStatus.StatusCode<>0)) ? "Offline " : "Online" )
}

Return to “Ask For Help”

Who is online

Users browsing this forum: Canengy, Elendiar, Flipeador, gerard, Google [Bot], nRec, Tre4shunter, vsub, Xtra, Yakshongas and 57 guests