Scripting Help needed

Hi

I want to create a Widget that shows me my Online and Offline Status in an Animation.
I use the following Script:
--------------------------------
'Called when the script is executed
Sub Object_OnScriptEnter
Object.SetTimer 500, 5000
End Sub

'Called when the script is terminated
Sub Object_OnScriptExit
Object.KillTimer 500
End Sub

Sub Object_OnTimer500
If System.InternetConnected=True Then
Object.state = "NetOn"
Else
Object.state = "NetOff"
End If
End Sub
-------------------------------
The Widget works well. But when I disconnect my Internet Connection, the Widget is reconnecting.
How can I change the Script to prevent the Widget is reconnecting?
2,891 views 6 replies
Reply #1 Top
Object.SetTimer 500, 5000

This little piece of code says to check every 5000 ms.

'Called when the script is terminated
Sub Object_OnScriptExit
Object.KillTimer 500
End Sub

This little snippet says kill the time when the object is closed.

I think you need to add Object.KillTimer 500 to the Net off ELSE in If System.InternetConnected.

But I am jsut learning so it's more of a strong suggestion than an answer.


Posted via WinCustomize Browser/Stardock Central
Reply #3 Top
If he kills the timer when he detect he's going offline he won't be able to detect when he goes online.

I'm not sure the code tries to reconnect the internet. I thought it was suppose to only check. Might be a question for support.
Reply #4 Top
There is no satisfactory way I have found to do this which is a frustration.
My understanding is that DX pings microsoft.com when System.InternetConnected is called to assess whether the user is online.
This tends to cause the PC to try to connect which I personally do not think is ideal as a solution ... but what do I know!

For guidance on creating objects relating to web access check the online resources (Link) in the section Developer's Guide ... Tutorials ... Internet access via DesktopX objects at the bottom.
Reply #5 Top
Thanks Martin.
But I don't understand this Tutorial (my English is not so good).
I think I let it be.

Greetings
maddox4u
Reply #6 Top
You would need to switch off the option to automatically connect to the internet when there is no connection already present in the control panel. I don't know of any other way to resolve this problem as windows is auto detecting an attempt to connect too the internet and then trying to connect you.