malosa Posted December 10, 2014 Share Posted December 10, 2014 (edited) Hi all , I have a question: Does anyone know a good script that it watch if my internet is still connected ? its for my security system , once in a while my wlan is disconnected /disabled i want a script that watch if internet is gone it disables and enables my internet like this script , only it needs to run constantly and only stop if i press Q . Its on windows 7 #RequireAdmin ShellExecuteWait("netsh.exe", 'int set interface "Wi-Fi" disable', "", "", @SW_HIDE) ShellExecuteWait("netsh.exe", 'int set interface "Wi-Fi" enable', "", "", @SW_HIDE) HotKeySet ("q", "quitme") Func quitme() Thanks in Advance! Edited December 10, 2014 by malosa Link to comment Share on other sites More sharing options...
Geir1983 Posted December 10, 2014 Share Posted December 10, 2014 Maybe you can use this? https://www.autoitscript.com/wiki/Connected Link to comment Share on other sites More sharing options...
malosa Posted December 10, 2014 Author Share Posted December 10, 2014 (edited) thx , but that is only checking the connection , but if the connection is down i want to put my script into it so it disables and enables my network card like the little script above , and i want that its monitor constantly Maybe you can use this? https://www.autoitscript.com/wiki/Connected Maybe you can use this? https://www.autoitscript.com/wiki/Connected Edited December 10, 2014 by malosa Link to comment Share on other sites More sharing options...
lorenkinzel Posted December 10, 2014 Share Posted December 10, 2014 Perhaps you can use the code shown in https://www.autoitscript.com/wiki/Connected as a function in your monitoring script? Then when connection is down trigger another function rather than showing a message box. Here's a simple (has to be for me) monitoring-type script: AdLibRegister("checkSec", 4154) While 1 Sleep(10) WEnd Func checkSec() $seconds = @SEC $firstDigit = StringLeft($seconds, 1) If $firstDigit = 3 Then a() EndIf If $firstDigit = 5 Then b() EndIf EndFunc Func a() MsgBox(0, "", "looks like it was thirty-something" & @CRLF & "sure wish I was", 3) EndFunc Func b() MsgBox(0, "", "looks like it was fifty-something" & @CRLF & "I know how it feels", 3) EndFunc Link to comment Share on other sites More sharing options...
232showtime Posted December 10, 2014 Share Posted December 10, 2014 (edited) hello there, I should post my question here coz i dont want to create a new thread like this, this example is for LAN only, https://www.autoitscript.com/wiki/Connected I was searching for WAN do you have any idea where I could get examples for WAN??? Edited December 10, 2014 by 232showtime ill get to that... i still need to learn and understand a lot of codes Correct answer, learn to walk before you take on that marathon. Link to comment Share on other sites More sharing options...
Spider001 Posted December 10, 2014 Share Posted December 10, 2014 (edited) ; https://www.autoitscript.com/autoit3/docs/functions/Ping.htm #include <MsgBoxConstants.au3> Example() Func Example() ; Ping the AutoIt website with a timeout of 250ms. Local $iPing = Ping("autoitscript.com", 250) If $iPing Then ; If a value greater than 0 was returned then display the following message. MsgBox($MB_SYSTEMMODAL, "", "The roundtrip-time took: " & $iPing & "ms.") Else MsgBox($MB_SYSTEMMODAL, "", "An error occurred with @error value of: " & @error) EndIf EndFunc Edited December 10, 2014 by Spider001 Link to comment Share on other sites More sharing options...
somdcomputerguy Posted December 11, 2014 Share Posted December 11, 2014 I use and have used this UDF successfully in a few of my scripts - http://www.autoitscript.com/wiki/AutoIt_Snippets#IsInternetConnectedThanks guinness. 232showtime 1 - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
232showtime Posted December 11, 2014 Share Posted December 11, 2014 I use and have used this UDF successfully in a few of my scripts - http://www.autoitscript.com/wiki/AutoIt_Snippets#IsInternetConnected Thanks guinness. nice, question answered for my part... ill get to that... i still need to learn and understand a lot of codes Correct answer, learn to walk before you take on that marathon. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now