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

Saturday, May 6, 2006 by I.R. Brainiac | Discussion: DesktopX

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
I.R. Brainiac
Reply #1 Saturday, May 6, 2006 9:39 AM
Formatting was lost...hope it still makes sense.

look at "what goes here" in State =
I.R. Brainiac
Reply #2 Saturday, May 6, 2006 12:33 PM
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.
Iben
Reply #3 Sunday, May 7, 2006 12:48 PM
~
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
Skarny
Reply #4 Sunday, May 7, 2006 4:16 PM
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
I.R. Brainiac
Reply #5 Sunday, May 7, 2006 11:48 PM
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).
I.R. Brainiac
Reply #6 Sunday, May 7, 2006 11:51 PM
Scripting these things is too frustrating...I wouldnt even have got that far if it hadnt been for RomanDA and his cpu meter widgets.
Skarny
Reply #7 Tuesday, May 9, 2006 6:19 AM
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
I.R. Brainiac
Reply #8 Tuesday, May 9, 2006 8:47 AM
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.

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!



web-wc01