Hyflex Posted February 26, 2012 Share Posted February 26, 2012 (edited) I am trying to incorporate a website status into my script hopefully so I can add it to my GUI but am not sure how to make some text on my GUI change color depending on the website status.. I was guessing something like this... While 1 If Ping("google.co.uk", 200) Then ; Add code here for "Online" GUI Code Else ; Add code here for "Offline" GUI Code EndIf WEnd I know I could of used _INetGetSource but I think Ping will suffice. Edited February 26, 2012 by XxXGoD Link to comment Share on other sites More sharing options...
Hyflex Posted February 26, 2012 Author Share Posted February 26, 2012 (edited) I should of prolly posted this:If Ping("home.website.com", 200) Then If Ping("login.website.com", 200) Then _GUICtrlStatusBar_SetText($GUIStatus, " Website = Online Login Server: Online") Else _GUICtrlStatusBar_SetText($GUIStatus, " Website = Online Login Server: Offline") EndIf Else If Ping("login.website.com", 200) Then _GUICtrlStatusBar_SetText($GUIStatus, " Website = Offline Login Server: Online") Else _GUICtrlStatusBar_SetText($GUIStatus, " Website = Offline Login Server: Offline") EndIf EndIfThat is the only thing I have semi-working and that can't go in the while loop as they keep switching between online and offline... + It doesn't give me any colors (I want to be able to set online as green and offline as redEdit: I just noticed Ping can't ping https servers Edited February 26, 2012 by XxXGoD Link to comment Share on other sites More sharing options...
Hyflex Posted February 27, 2012 Author Share Posted February 27, 2012 Done some further digging and it appears that the https server I'm trying to ping is rejecting/blocking pings... is there any alternative way to check if a https server is online? Link to comment Share on other sites More sharing options...
mihaibr Posted February 27, 2012 Share Posted February 27, 2012 (edited) #include <Inet.au3> If _INetGetSource('http://www.google.com')=="" Then MsgBox(0,"","Site offline") Else MsgBox(0,"","Site online") EndIf replace http://www.google.com with the site you want to check Edited February 27, 2012 by mihaibr Link to comment Share on other sites More sharing options...
Hyflex Posted February 27, 2012 Author Share Posted February 27, 2012 Yeah I already tried that and it still doesnt work. It says its offline even if its online. Link to comment Share on other sites More sharing options...
BrewManNH Posted February 27, 2012 Share Posted February 27, 2012 What is the site you're trying to check? If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
Hyflex Posted February 27, 2012 Author Share Posted February 27, 2012 I can't actually say the main site im trying to check however anther script i am working on could do with a checekr too and it has the same problem so here is one: https://login.netgame.com/ Link to comment Share on other sites More sharing options...
somdcomputerguy Posted February 27, 2012 Share Posted February 27, 2012 (edited) This is just a rewrite of the code in post #4. Basically, if it can get the source code of a page, it'll say 'online'. If it can't, it'll say 'offline'. #include <Inet.au3> If _INetGetSource('https://fastmail.fm') <> "" Then MsgBox(0, "", "Site online") Else MsgBox(0, "", "Site offline") EndIf edit: I just noticed that this code will not work with that game site as the URL. Oh well.. Edited February 27, 2012 by somdcomputerguy - 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...
BrewManNH Posted February 27, 2012 Share Posted February 27, 2012 Seems like the site might be actively blocking the ability to see if it's online that way. You can't ping it, you can't download the site, so basically you can't see if it's online unless you go to it. I even tried it with http://www.downforeveryoneorjustme.com/netgame.com and it returned that it was down. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
Hyflex Posted February 27, 2012 Author Share Posted February 27, 2012 (edited) Seems like the site might be actively blocking the ability to see if it's online that way. You can't ping it, you can't download the site, so basically you can't see if it's online unless you go to it. I even tried it with http://www.downforeveryoneorjustme.com/netgame.com and it returned that it was down.How is that even possible because surely DNS servers wouldn't work either...See: http://www.downornot.com/login.netgame <-- they can detect if it's up or down... Edited February 27, 2012 by XxXGoD Link to comment Share on other sites More sharing options...
BrewManNH Posted February 27, 2012 Share Posted February 27, 2012 DNS servers don't care if a site is up or down, they just look for record updates. If the site hasn't updated its DNS record, then eventually it will not be reachable at all. I could pull the plug on a computer and my DNS server here will still tell me its old IP address until it purges old records. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
Hyflex Posted February 27, 2012 Author Share Posted February 27, 2012 DNS servers don't care if a site is up or down, they just look for record updates. If the site hasn't updated its DNS record, then eventually it will not be reachable at all. I could pull the plug on a computer and my DNS server here will still tell me its old IP address until it purges old records.I see, is there a way to use the link i gave above to check the websites status via autoit? 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