Need help with sysstats and VB-code

Hi

i want to get the value from a PDHMeter (CPU-meter), change the value, and give it to the sysstats-overlay (CPU-text). My problem, that i want to fix this way, is that the cpu-meter gives me wrong values; if i choose "ProcessTime->_TOTAL", i´ll get the value 100.

So i have to choose "ProcessTime->_IDLE"; this gives me a right value. But ProcessTime _TOTAL is 100-_IDLE, you know.

So, i guess i need a VB-script to get and put the value.

This is what i´ve done:

- i inserted a ScriptMeterClass called ScriptMeter.

- the overlay "CPU % Text" is configured by the ScriptMeter

i never made anything in VB, but tried to make it....but no success.

This is my VB-file:

Function ScriptMeter_GetValue(selector)

DIM meter

Set meter = SysStatsModel.Meters(0)

ScriptMeter_GetValue = meter.GetAsLong(selector)

End Function

Function ScriptMeter_PutValue(myValue)

myValue = 50

End Function

...just for testing i tried to put the value 50 to the meter, but no success.

Can someone please help me?

---------------

hi

thanx for the high count of replies....

You guys call yourself "programmer" ? Go out to find another hobby.

No experience in vb. Took me 1 hour to make it work.

//Posts Merged, Thread Moved (thanks SirSmiley), Member Warned.

Double-posting and sarcastic complaining == not cool. See that it doesn't happen again ;). -NC

P.S: I was going to write some pseudocode or PHP code about incrementing counters and banning, but I didn't feel like it. Seriously though, the attitude isn't cool.

#438198

Yeah an hour is pretty good. VBScript is actually quite simple.

To be honest I don't know if this sub-forum is all that active as your thread has only been viewed 36 times according to iSpy right now. I suspect 20 of those views happened after Judge posted. So, maybe next time you'd be better posting in the correct forum? ;)

SysStats Forum Link Under Community Applications

#438224

Hi

I was wondering, that nobody replied.

I´m programming VC since 6 years; and if you´re experienced in the syntax of this, vb is the horror.

No typedefinitions, no commas or declaration of functions. The vb-code is only 4 strings; in vc this would be a complete page of code.

#438276