Ping/Server Status widget
Sunday, June 5, 2005 by Cana3000 | Discussion: DesktopX
I need a script that does a simple ping of a game server port to see if the server is online or off and then it eather displays a blank icon if its off or a regualar icon if its on. kinda the the whole ftp ping thing but i need it to be client side with maybe javascript or a dll and if i can get the code i can probably some how integrate it into desktopX and add icons ect. hope someone can help i tried over at stardock no reply over there.
Reply #2 Monday, June 6, 2005 12:50 PM
Page number 35 in the scripting guide explains how to use System.InternetConnected and System.Ping. I haven't tried to ping a spesific port, but you might try to append it to the URL after a colon. like "www.wincustomize.com:80".
If the builtin DesktopX Ping doesn't work for you you might be able to use the INet ActiveX/COM control.
Reply #3 Monday, June 6, 2005 2:02 PM
| That checks if your own computer is connected to the internet, but it doesn't ping any other machines. |
I missed the question. Sorry.
And for the record PING is not port specific. You could get ugly and do a telnet to the server and port and if you got a response parse it out and return an action.
| telnet {server}{port} Connected to {server} or {server}{Connection Refused} |
I think.
Please login to comment and/or vote for this skin.
Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:
- Richer content, access to many features that are disabled for guests like commenting on the forums and downloading skins.
- Access to a great community, with a massive database of many, many areas of interest.
- Access to contests & subscription offers like exclusive emails.
- It's simple, and FREE!







Reply #1 Sunday, June 5, 2005 10:20 PM
I expect you want the following. Please mention Martin Conroy, Alberto Riccio, and Stardock with a little line of credit somewhere.
Kris
Dim IsConnected
'Called when the script is executed
Sub Object_OnScriptEnter
Set Sh = CreateObject("WScript.Shell")
On Error Resume Next
units =
Sh.RegRead("HKCU\SOFTWARE\Stardock\DesktopX\NaturalDesktop\units")
If err.number <> 0 Then
units = "m"
err.clear
End If
location =
Sh.RegRead("HKCU\SOFTWARE\Stardock\DesktopX\NaturalDesktop\location")
If err.number <> 0 Then
location = "48188"
err.clear
End If
Timeadjust=0
IsConnected = System.InternetConnected
If IsConnected Then
DesktopX.ScriptObject("wow_netstatus").Object.State = "On"
DesktopX.ScriptObject("wow_netstatus").Object.ToolTipText =
"Currently working online"
Else
DesktopX.ScriptObject("wow_netstatus").Object.State = "Off"
DesktopX.ScriptObject("wow_netstatus").Object.ToolTipText =
"Currently working offline"
DesktopX.Object("wow_lastupdate").Text = "Last Update: None
- Offline"
Msgbox "You are currently offline. The Natural Desktop can
only provide accurate weather information if you are online." & vbNewLine &
vbNewLine & "Once you have connected to the Internet click the connection
icon in the corner of the weather window.", vbExclamation + vbOKOnly,
"Connection error ..."
End If
Object.SetTimer 6001, 600000
Object_OnTimer6001
End Sub