DarkHo Posted February 28, 2010 Share Posted February 28, 2010 (edited) I was bored and i made this funny thing hehe. The Picture will switch if you don't have internet to red. Hop you like it #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= GUICreate("Status", 140, 50) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### HotKeySet("{F1}", "Terminate") TrayTip("Tip", "To Exit the program press F1", 0, 1) While 1 $var = Ping("www.google.com",250) If $var Then GUICtrlCreateIcon("online.ico", -1, 49, 5, 39, 39, BitOR($SS_NOTIFY,$WS_GROUP)) Else GUICtrlCreateIcon("offline.ico", -1, 49, 5, 39, 39, BitOR($SS_NOTIFY,$WS_GROUP)) EndIf Sleep(2000) WEnd While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE EndSwitch WEnd Func Terminate() Exit 0 EndFunc Have fun Internet Status.zip Edited February 28, 2010 by DarkHo Link to comment Share on other sites More sharing options...
dmob Posted February 28, 2010 Share Posted February 28, 2010 (edited) 's not a good idea to ping the same address too many times, plus the website might be too busy to respond before your timeout. Some suggestions: - Create an array with lots of addresses then ping each one in turn - Ping at least three addresses before you report offline Just my two cents worth.... Edited February 28, 2010 by dmob Link to comment Share on other sites More sharing options...
JRowe Posted February 28, 2010 Share Posted February 28, 2010 (edited) Get a list of google addresses, instead of pinging the domain name. Random addresses conceivably might go down, but it's highly unlikely that any significant cluster of google servers will crash at any given time. Good thinking, dmob. Edited February 28, 2010 by JRowe [center]However, like ninjas, cyber warriors operate in silence.AutoIt Chat Engine (+Chatbot) , Link Grammar for AutoIt , Simple Speech RecognitionArtificial Neural Networks UDF , Bayesian Networks UDF , Pattern Matching UDFTransparent PNG GUI Elements , Au3Irrlicht 2Advanced Mouse Events MonitorGrammar Database GeneratorTransitions & Tweening UDFPoker Hand Evaluator[/center] Link to comment Share on other sites More sharing options...
DarkHo Posted February 28, 2010 Author Share Posted February 28, 2010 Like i sad i was bored when i made it -.- 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