Jump to content

Website Online/Offline Status in GUI Form?


Hyflex
 Share

Recommended Posts

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 by XxXGoD
Link to comment
Share on other sites

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
EndIf

That 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 red

Edit: I just noticed Ping can't ping https servers

Edited by XxXGoD
Link to comment
Share on other sites

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 Gude
How 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

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 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

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 Gude
How 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

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 by XxXGoD
Link to comment
Share on other sites

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 Gude
How 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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...