Need script help for state = and drive letter config ina DX widget

Cant get drive letter graphic to change states when I configure the perfmon2 to different drives,always shows default.



And...how do I make the widget configurable through the exported widgets properties?I went through the add preferences routine,but it would only show on a new widget with no other scripting.Once I added the rotate arm section it no longer showed a preference tab.



The widget works fine as long as it it set to just one capability and one drive letter(you can only choose from your OWN available drives,it needs to work on other folks setup)



heres what I got minus the Add preferences bit.....frustratingly yours...I.R. noBrainiac

'Called when the script is executed
Sub Object_OnScriptEnter
Call RotateArm(-90,58,50,"pointerplasma","text")
Object.SetTimer 1121, 5000
End Sub

Sub Object_OnTimer1121
Call RotateArm(-90,58,50,"pointerplasma","text")


End Sub

Sub RotateArm(minangle,maxangle,ZeroPercent,Obj,Mtr)
meter = DesktopX.Object(Mtr).Text
meter = mid(meter,5)
t = len(meter)
meter = left(meter,t-1)
If Invert = True Then meter = 100-meter
If meter < ZeroPercent Then
angle = minangle + (((360 - minangle) / ZeroPercent) * meter)
Else
angle = (maxangle / ZeroPercent) * (meter - ZeroPercent)
End If
DesktopX.Object(Obj).Rotation = angle


End Sub
Sub Object_OnTimer1121
DesktopX.Object("driveletter").State = what goes here?

End Sub
'Called when the script is terminated
Sub Object_OnScriptExit

End Sub
3,405 views 8 replies
Reply #1 Top
Formatting was lost...hope it still makes sense.

look at "what goes here" in State =
Reply #2 Top
I'm tired,I have a headache,I give up....I just wasted 3 days on what should be a simple widget.I've googled and read every DX thread and doc til I'm coocoo.Until DX has decent creation interface(I couldnt skin WB without Skinstudio),I'm thru.Coding is greek to me.Its too much to expect the avg skinner to be able to do this.No wonder theres nothing but meters and calenders and clocks in the widget section.
Reply #3 Top
~
When something doesn't work like it should.
A bug is probably responsible,
and belongs to someone else besides you
Mr.Brainiac.
~


Posted via WinCustomize Browser/Stardock Central
Reply #4 Top
I'm not sure I could help, but maybe if you send me the object I can have a look. From the script it's a little hard for me to work out exactly what you are doing, but one thing I notice right away is that you can't have 2 identical Subs (you have two OnTimer 1121 Subs) in the same script, it will only use one of them...I think.

If you send it to me I might be able to help? Might not My email is on this page http://skarnivorous.wincustomize.com/info.aspx?acid=387257
Reply #5 Top
Hiya Iben!
Skarnivorous,thanks for the offer...I uploaded it as is in the widget section.If you feel like playing with it,please do,I'll be offline soon fo awhile(again).
Reply #6 Top
Scripting these things is too frustrating...I wouldnt even have got that far if it hadnt been for RomanDA and his cpu meter widgets.
Reply #7 Top
I've made an edited one for you I.R. Brainiac. I didn't see a way of getting the information you wanted from the Stardock Meter plugin, so I just rerouted the script to get the information from a VBScript file system object (fso). Works nice, but of course, you'll need to do the states etc But this is what you wanted. Click the main meter to change to the next available drive on your computer. P.S. You need to check your alignment of your meter numbers. As you go from 0 to 100, they shift further right, and get incorrectly positioned. http://www.freewebtown.com/skarn/edited.dxpack

Posted via WinCustomize Browser/Stardock Central
Reply #8 Top
Wow,thanks Skarnivorous!Works great(at least til I go past the last available drive,then I get a script error)I should be able to get it together now. Maybe I can get it done before I have to leave.(again)

Thanks for taking the time.