DX2 timer interference
Saturday, January 10, 2004 by digital_trucker | Discussion: Stardock Software
The following is the clock hand script:
'Called when the script is executed
Sub Object_OnScriptEnter
object.SetTimer 3333,1000
End Sub
Sub Object_OnTimer3333
Object.Rotation = Second(Now)*6
End Sub
'Called when the script is terminated
Sub Object_OnScriptExit
End Sub
The following is the gauge pointer script:
'Called when the script is executed
Sub Object_OnScriptEnter
Object.SetTimer 10, 100
Dim CPULoad
Dim NeedleDestination
End Sub
Sub Object_OnTimer10
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select LoadPercentage from Win32_Processor",,48)
For Each objItem In colItems
CPULoad = objItem.LoadPercentage
Next
NeedleDestination = 235+(CPULoad*2.5)
Object.Rotation = NeedleDestination
End Sub
'Called when the script is terminated
Sub Object_OnScriptExit
Object.KillTimer 10
End Sub
Why do they interfere with each other?
Reply #2 Sunday, January 11, 2004 3:50 AM
as for your problem I looked at this a while earlier in the evening and didn't see anything wrong with the script. the only discrepancy was that one object had a kill timer in the exit sub and the other doesn't, but I can't see how that would affect anything. I am sure others have read this and have no idea what's wrong, just like me.

Reply #3 Sunday, January 11, 2004 3:59 AM
Reply #4 Sunday, January 11, 2004 4:08 AM
Reply #5 Sunday, January 11, 2004 4:39 AM
Reply #6 Sunday, January 11, 2004 5:16 AM
As far as the code, I've come to the conclusion that the problem is simply that VBScript is too slow to handle this kind of operation smoothly. Looks like I'm going to have to learn to code dll's to do what I want to do. Any tips on where to start to learn how to code dll's?
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, January 11, 2004 2:03 AM
https://www.stardock.com/products/desktopx/docs/