Ping/Server Status widget

So I'm creating a theme for my gaming center that usesd DesktopX. I was wondering if anyone could help.
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.
1,368 views 3 replies
Reply #1 Top
Kris @ Stardock was kind enmough to shware this with me . . . IO'm just passing it along. If the forum strips out the code, you can reach me at Email

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


Posted via WinCustomize Browser/Stardock Central
Reply #2 Top
That checks if your own computer is connected to the internet, but it doesn't ping any other machines.

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


Posted via WinCustomize Browser/Stardock Central