[help] Sysstats Scripting, Accessing Nested Items

Please skip to edit2

The help file has this:

If you’ve looked at some of the existing configs you might have noticed that overlays can be nested inside other overlays so SysStatsModel.Overlays(0) might return you another collection of overlays, which might return another collection of overlays etc. etc.. A script should know what to expect.

I've bold-ed (emboldened?) the part I'm confused about. I've seen some samples of it's use and heck I've modded some scripts with it in place, but I still fail to understand how nested items are accessed.

Say you have the following config, can someone tell me how I can access all of the parts?

CompositeOverlay1
---ImageOverlay
---CompositeOverlay2
------TextOverlay
---------CompositeOverlay3
------------MeterOverlay

To access CompositeOverlay1, it's SysStatsModel.Overlay(0) right? Is ImageOverlay then SysStatsModel.Overlay(0-1)?

Or if I set cO1=SysStatsModel.Overlay(0), can I then access ImageOverlay with cO1(0)?

edit: Okay, I see in a clock config that the reference is as such SysStatsModel.Overlays(0)(1), haven't tried it yet though it's sensible - like accessing multidimensional arrays (uh somewhere).

edit2:

I'm working on a script and it doesn't update the config as I want it to. Here's the script:

Function ScriptMeter_Update
  Dim unformatted, timeString, twelveHrMark, meterToFormat

  ' unformatted is a string of the following format "9:20 AM"
  ' meterToFormat is linked to a FixedMeter
  set unformatted   = SysStatsModel.Overlays(0)(0).Format
  set meterToFormat = SysStatsModel.Meters(2)
  set timeString    = Split(unformatted,":")
  set twelveHrMark  = Split(timeString(1)," ")

  If(twelveHrMark(1) = "AM") Then
     meterToFormat.Value = timeString(0)
  Else
     meterToFormat.Value = 12+timeString(0)
  End If

  meterToFormat.Update()

  ScriptMeter_Update = true
End Function

Is there something wrong w/ the script? The config itself is a modified Timezone clock w/ the following setup:

Meters:
Meter0=XML feed from weather.com
Meter1=The script above
Meter2=FixedMeter to change value in above script
Meter3=FixedMeter

Overlays:
CompositeOverlay
---Text getting value from Meter0
---Text getting value from Meter0
---Meter getting value from Meter2
---Meter getting value from Meter3

#210859

Thanks for the reply judge.

Does the FixedMeter's value update at all? Because, I can't get it to do so. At least, when I check it's value from the Configure dialog, the FixedMeter that is supposed to change doesn't.

#211871

Thanks for the advice judge. Got the script working well now. :)

#212078