Jump to content



Photo

Website Online/Offline Status in GUI Form?


  • Please log in to reply
11 replies to this topic

#1 XxXGoD

XxXGoD

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 397 posts

Posted 26 February 2012 - 07:15 PM

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, 26 February 2012 - 07:15 PM.








#2 XxXGoD

XxXGoD

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 397 posts

Posted 26 February 2012 - 07:41 PM

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, 26 February 2012 - 07:46 PM.


#3 XxXGoD

XxXGoD

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 397 posts

Posted 27 February 2012 - 03:31 PM

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?

#4 mihaibr

mihaibr

    Wayfarer

  • Active Members
  • Pip
  • 59 posts

Posted 27 February 2012 - 04:21 PM

#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 by mihaibr, 27 February 2012 - 04:22 PM.


#5 XxXGoD

XxXGoD

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 397 posts

Posted 27 February 2012 - 05:05 PM

Yeah I already tried that and it still doesnt work. It says its offline even if its online.

#6 BrewManNH

BrewManNH

    באָבקעס מיט קודוצ׳ה

  • MVPs
  • 6,877 posts

Posted 27 February 2012 - 05:22 PM

What is the site you're trying to check?

How to ask questions the smart way!

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 editorGUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.

GUIToolTip UDF Demo - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips.

Posted Image


#7 XxXGoD

XxXGoD

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 397 posts

Posted 27 February 2012 - 05:28 PM

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/

#8 somdcomputerguy

somdcomputerguy

  • Active Members
  • PipPipPipPipPipPip
  • 2,385 posts

Posted 27 February 2012 - 05:56 PM

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, 27 February 2012 - 06:04 PM.

- Bruce /* somdcomputerguy */If you change the way you look at things, the things you look at change.

#9 BrewManNH

BrewManNH

    באָבקעס מיט קודוצ׳ה

  • MVPs
  • 6,877 posts

Posted 27 February 2012 - 06:36 PM

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 to ask questions the smart way!

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 editorGUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.

GUIToolTip UDF Demo - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips.

Posted Image


#10 XxXGoD

XxXGoD

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 397 posts

Posted 27 February 2012 - 07:35 PM

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, 27 February 2012 - 07:37 PM.


#11 BrewManNH

BrewManNH

    באָבקעס מיט קודוצ׳ה

  • MVPs
  • 6,877 posts

Posted 27 February 2012 - 08:42 PM

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.

How to ask questions the smart way!

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 editorGUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.

GUIToolTip UDF Demo - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips.

Posted Image


#12 XxXGoD

XxXGoD

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 397 posts

Posted 27 February 2012 - 10:33 PM

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?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users