Results 1 to 20 of 20
  1.    #1  
    Im using the Billboard Today Plugin for my new script, but Im having a problem killing the While Loop from within the script when another PARAM (Selection) is chosen. I always get the "Script seems to be running, Cancel Old Script?" Error message. How do I stop a while loop or script without using exit?

    KillScript ( Script ) DOESNT WORK - as coded in Billboard
    Last edited by Interstink; 06/01/2007 at 11:06 PM.
  2. #2  
    Quote Originally Posted by Interstink View Post
    Im using the Billboard Today Plugin for my new script, but Im having a problem killing the While Loop from within the script when another PARAM (Selection) is chosen. I always get the "Script seems to be running, Cancel Old Script?" Error message. How do I stop a while loop or script without using exit?

    KillScript ( Script ) DOESNT WORK - as coded in Billboard
    ahhh, okay this sounds like a clue... Sounds like your KillScript is the script as your "main loop" script. If that's the case, you need to change the way you have it coded. MortScript will not let you run more than one instance of the same script, therefore it is warning you that you already have an instance running. The way I had it set up in my example is:

    Billboard calls -> Settings script calls -> Loop script

    If you put everything in one script, i.e.

    Billboard calls -> Loop script

    Then when Billboard also invokes the Loop script to handle the "Stop/Exit" Param selection, MortScript will complain that it is already running. Sorry, that's just the way Mortscript works. You need to put an intermediary script in between that is transient.

    If you are getting this error with my example *exactly* as I posted it, then something is definitely wacky. But I don't think that's the case.

    Cody, if you ran into any problems with this, please chime in.
  3.    #3  
    I did try to run it as you coded your example and got the same errors. Actually got errors from your code KillScript (Script) as an invalid argument...

    Myclock.mscr, MyClock_init.mscr, MyClock_settings.mscr

    Have been working with these and continue to have this issue.

    BUT, I have gotten my code working to pull and parse data from my network monitor and display it on today screen in a nice formated value (As long as I do not run any loops) - THANKS!
  4. #4  
    Quote Originally Posted by Interstink View Post
    I did try to run it as you coded your example and got the same errors. Actually got errors from your code KillScript (Script) as an invalid argument...

    Myclock.mscr, MyClock_init.mscr, MyClock_settings.mscr

    Have been working with these and continue to have this issue.

    BUT, I have gotten my code working to pull and parse data from my network monitor and display it on today screen in a nice formated value (As long as I do not run any loops) - THANKS!
    Odd, well in my example there are only two lines that matter here:

    Script = SystemPath( "ScriptPath" ) \ "MyClock.mscr"
    KillScript( Script )

    So you're saying these two lines gives you an "invalid argument?"

    Okay, I'm stumped, any of you MortScript experts want to take a guess on this one?

    Can you provide the full pathname of the folder where you copied this to? Maybe MortScript is getting upset about a character in the pathname...
  5. #5  
    question

    is the "if param eq so and so" in the same script as this loop?

    I put the if param in a loop called "whatever_controler". in the control you could put the killscript. this would then be killing a script that is where the loop is. if you need the loop to run all the time just put "run that loop" in all of the "if param eg" choices.

    I never had any problems with the "myclock" plugin examples. all the killscripts worked for me.

    remember... like in the myclock example. evertime you hit the pluginn from the todayscreen... the first script ran at that time is the settings.mscr and then the control.mscr. anyone of these scripts would be a good place to kill the loop script every time the plugin is about to change param.
  6. #6  
    Interstink I think you just have an older version of MortScript 4.0. Killscript was added in one of the later RC builds. The final 4.0 build should have it.
  7.    #7  
    Installing shortly... 4.0 should be 4.0 - these developers!!!

    UPDATE: Hannip, right on... I checked the version when I first had this issue and showed same 4.0 version thats on my device. Looks like an incremental did me in! Script is working perfectly. Thanks for the heads up!

    Not sure anyone would want or need this...

    Im pulling Live Router/Circuit statistics and Environmental readings (Temp, Hum., Water sensors, power-line voltages) from our Network Operations Center and putting those stats on a Today screen plugin. So far so good... All my environmental data is working!

    NEXT... Would like to rotate information displayed between values. I think I saw someone doing this - looks like it should be a "piece of cake"
    Last edited by Interstink; 06/02/2007 at 12:38 PM.
  8. #8  
    Quote Originally Posted by Interstink View Post
    Installing shortly... 4.0 should be 4.0 - these developers!!!

    UPDATE: Hannip, right on... I checked the version when I first had this issue and showed same 4.0 version thats on my device. Looks like an incremental did me in! Script is working perfectly. Thanks for the heads up!

    Not sure anyone would want or need this...

    Im pulling Live Router/Circuit statistics and Environmental readings (Temp, Hum., Water sensors, power-line voltages) from our Network Operations Center and putting those stats on a Today screen plugin. So far so good... All my environmental data is working!

    NEXT... Would like to rotate information displayed between values. I think I saw someone doing this - looks like it should be a "piece of cake"
    Wunderbar! Thanks hannip, it looks like it was added in 4.0 RC9.
  9. #9  
    Quote Originally Posted by Interstink View Post
    NEXT... Would like to rotate information displayed between values. I think I saw someone doing this - looks like it should be a "piece of cake"
    This is a pretty simple method that will work for Billboard or the Carrier display line:

    Code:
    ForEach VAL in values ( temp, hum, water, power )
        RegWriteString(..., VAL)
        Sleep(5000)
    EndForEach
    where temp, hum, water, power are all variables that have been assigned values based on your last query. Modify your RegWriteString to point to the Carrier registry entry or the Billboard registry entry as appropriate.
  10.    #10  
    Does the Billboard ONLY look to the Line1 registry value or can I have it look to other reg. values? Looks like thats the only place the ".dll" looks for display data/info.

    Also, is there a way to remove specified charaers from a value returned.

    Example:

    Returned data = <TD>100.3 kbps</>

    Would like to remove: <,>,TD,/,

    Possible? Trim, Parse???
    Last edited by Interstink; 06/02/2007 at 06:09 PM.
  11. #11  
    Quote Originally Posted by Interstink View Post
    Does the Billboard ONLY look to the Line1 registry value or can I have it look to other reg. values? Looks like thats the only place the ".dll" looks for display data/info.
    Yep, it should look in the others too. Using the MyClock example if you did the following to set the refresh value to 5 (needs to be done only once, before plugin is loaded).

    RegWriteString("HKLM", "Software\Microsoft\Today\Items\My Clock", "Refresh", 5)

    And then did in main script did this:

    RegWriteString("HKLM", "Software\Microsoft\Today\Items\My Clock", "Line1", temp)
    RegWriteString("HKLM", "Software\Microsoft\Today\Items\My Clock", "Line2", hum)
    RegWriteString("HKLM", "Software\Microsoft\Today\Items\My Clock", "Line3", water)
    RegWriteString("HKLM", "Software\Microsoft\Today\Items\My Clock", "Line4", power)

    It should auto-rotate between those strings every 5 seconds.
  12. #12  
    Quote Originally Posted by Interstink View Post
    Also, is there a way to remove specified charaers from a value returned.

    Example:

    Returned data = <TD>100.3 kbps</>

    Would like to remove: <,>,TD,/,

    Possible? Trim, Parse???
    In 4.0, your options are:
    SubStr()
    Part()
    Find()/ReverseFind()

    In 4.0.1, I think Mort has added some other stuff.
  13.    #13  
    Quote Originally Posted by zbop View Post
    In 4.0, your options are:
    SubStr()
    Part()
    Find()/ReverseFind()

    In 4.0.1, I think Mort has added some other stuff.
    I am able to narrow it down to the value, problem is the page changes and values grow (Values in front of this one) which moves or adds charaters to the HTML file and moves my values closer to start point of parse, or further from start point. So I can get it to look perfectly, but then values change before my target value and I end up with the HTML code included and part of my target value truncated.

    I cant seem to find a way of coding, REMOVE all ">" characters from string.

    You have been a great help!
  14.    #14  
    Quote Originally Posted by zbop View Post
    Yep, it should look in the others too. Using the MyClock example if you did the following to set the refresh value to 5 (needs to be done only once, before plugin is loaded).

    RegWriteString("HKLM", "Software\Microsoft\Today\Items\My Clock", "Refresh", 5)
    Still only looks to Line1, unless I put the refresh in the wrong place. Also, if this does work, wouldn't it refresh (Change values) all of the scripts I open with BillBoard? I would rather specify which script looked to which lines (Line1,Line2, etc).

    Guess I should explain what im doing a bit further.
    I have 3 Billboard choices/scripts Im working on. Each Script pulls data from server every 10 minutes when active on today screen (Eventually I will combine all scripts into ONE). Each Script I want to rotate between parsed values (a,b,c...) every x seconds when active.

    1. NOC Environment
    a. Temp
    b. Hum.
    c. Power Line Voltage

    2. NOC Traffic
    a. Inbound
    b. Outbound

    3. NOC Server(s)
    a. CPU
    b. Processor usage
    c. Storage Space
    d. Memory

    (Eventually creating duplicate scripts for over 20 servers and displaying only Alert conditions - narrows the list to 3 servers when being shown on the today screen)

    I have a great start as the environmental monitors works great now, but still only able to rotate values while data is being continuously written to the single Line1 reg. entry.
    ForEach VAL in values ( INDATA, OUTDATA, TimeData)
    RegWriteString("HKLM", ITEM, "Line1", VAL )

    Since new data is only grabbed once every 10 minutes and written to the reg. I should be able to write these values in there own line (Line1, Line2 etc) as you stated and read from each line.
  15. #15  
    Quote Originally Posted by Interstink View Post
    Still only looks to Line1, unless I put the refresh in the wrong place. Also, if this does work, wouldn't it refresh (Change values) all of the scripts I open with BillBoard? I would rather specify which script looked to which lines (Line1,Line2, etc).

    Guess I should explain what im doing a bit further.
    I have 3 Billboard choices/scripts Im working on. Each Script pulls data from server every 10 minutes when active on today screen (Eventually I will combine all scripts into ONE). Each Script I want to rotate between parsed values (a,b,c...) every x seconds when active.

    1. NOC Environment
    a. Temp
    b. Hum.
    c. Power Line Voltage

    2. NOC Traffic
    a. Inbound
    b. Outbound

    3. NOC Server(s)
    a. CPU
    b. Processor usage
    c. Storage Space
    d. Memory

    (Eventually creating duplicate scripts for over 20 servers and displaying only Alert conditions - narrows the list to 3 servers when being shown on the today screen)

    I have a great start as the environmental monitors works great now, but still only able to rotate values while data is being continuously written to the single Line1 reg. entry.
    ForEach VAL in values ( INDATA, OUTDATA, TimeData)
    RegWriteString("HKLM", ITEM, "Line1", VAL )

    Since new data is only grabbed once every 10 minutes and written to the reg. I should be able to write these values in there own line (Line1, Line2 etc) as you stated and read from each line.
    Sorry, this is probably my bad...

    The strings I gave in the example were wrong, they should have been:

    RegWriteString("HKLM", "Software\Microsoft\Today\Items\My Clock", "Refresh", 5)

    RegWriteString("HKLM", "Software\Microsoft\Today\Items\My Clock\Item1", "Line1", temp)
    RegWriteString("HKLM", "Software\Microsoft\Today\Items\My Clock\Item1", "Line2", hum)
    RegWriteString("HKLM", "Software\Microsoft\Today\Items\My Clock\Item1", "Line3", water)
    RegWriteString("HKLM", "Software\Microsoft\Today\Items\My Clock\Item1", "Line4", power)

    I think this is just confusion over terminology. Line1,Line2,Line3 correspond to additional values to display in the rotation (like your a,b,c), rather than rows of lines on the today screen.

    If you want a multiple rows of lines on the today screen, you can create three separate billboard plugins, or you can create multiple "item" definitions in the registry. You would need to replicate the registry structure under "Item1" into "Item2" and assign different "Line" and "Script" values. I think this is what you want. Note, this feature has not really been tested in awhile, so ymmv.

    Also, the Refresh value needs to be set prior to loading the plugin. You just write it once, disable the plugin and reenable it.
  16. #16  
    Quote Originally Posted by Interstink View Post
    I am able to narrow it down to the value, problem is the page changes and values grow (Values in front of this one) which moves or adds charaters to the HTML file and moves my values closer to start point of parse, or further from start point. So I can get it to look perfectly, but then values change before my target value and I end up with the HTML code included and part of my target value truncated.

    I cant seem to find a way of coding, REMOVE all ">" characters from string.

    You have been a great help!
    Sure, it the offsets are not fixed use Find() to get the starting offset, ie.

    Find(htmlstring, "<TD>")+4

    will give you the starting position of the data

    ReverseFind(htmlstring, "</TD>")-1

    will give you the end position of the data.

    From there, figure out what to pass to SubStr()
  17.    #17  
    Quote Originally Posted by zbop View Post
    Sure, it the offsets are not fixed use Find() to get the starting offset, ie.

    Find(htmlstring, "<TD>")+4

    will give you the starting position of the data

    ReverseFind(htmlstring, "</TD>")-1

    will give you the end position of the data.

    From there, figure out what to pass to SubStr()
    Fixed this issue! but thanks...
  18.    #18  
    I think this is just confusion over terminology. Line1,Line2,Line3 correspond to additional values to display in the rotation (like your a,b,c), rather than rows of lines on the today screen. THATS RIGHT

    If you want a multiple rows of lines on the today screen... NOPE, DONT NEED THAT

    Also, the Refresh value needs to be set prior to loading the plugin. You just write it once, disable the plugin and reenable it...

    What script should this refresh be in? Is this the only way to rotate values in the reg.? Values stored (Line1,Line2,Line3 etc.) must be able to rotate without doing this refresh.
  19. #19  
    Quote Originally Posted by Interstink View Post
    I think this is just confusion over terminology. Line1,Line2,Line3 correspond to additional values to display in the rotation (like your a,b,c), rather than rows of lines on the today screen. THATS RIGHT

    If you want a multiple rows of lines on the today screen... NOPE, DONT NEED THAT

    Also, the Refresh value needs to be set prior to loading the plugin. You just write it once, disable the plugin and reenable it...

    What script should this refresh be in? Is this the only way to rotate values in the reg.? Values stored (Line1,Line2,Line3 etc.) must be able to rotate without doing this refresh.
    You would typically set the refresh value as part of your installation. Once it is set, you don't need to touch it again. You can do this via a script, a registry editor, or a cab installer.

    I'm not sure what you mean that "it must be able to rotate without doing the refresh". By definition, the refresh value is the interval in seconds that billboard will (1) refresh the today line by re-reading the Line values in the registry and (2) rotate to the next Line definition IF there is more than one Line defined. Billboard will do this for you automatically, without any script involvement.

    The other alternative is to drive the rotation yourself from a script, by rewriting Line1 at your chosen interval. This was the first method I posted (the ForEach loop).

    You can do it either way.
  20.    #20  
    Quote Originally Posted by zbop View Post
    You would typically set the refresh value as part of your installation. Once it is set, you don't need to touch it again. You can do this via a script, a registry editor, or a cab installer.

    I'm not sure what you mean that "it must be able to rotate without doing the refresh". By definition, the refresh value is the interval in seconds that billboard will (1) refresh the today line by re-reading the Line values in the registry and (2) rotate to the next Line definition IF there is more than one Line defined. Billboard will do this for you automatically, without any script involvement.

    The other alternative is to drive the rotation yourself from a script, by rewriting Line1 at your chosen interval. This was the first method I posted (the ForEach loop).

    You can do it either way.
    Gotcha... Just looking to the least resource intensive method of accomplishing this with mortscript.

    BTW... newest version (Beta) of mort with floating point has helped fix my issues with gathering my values. I also forgot about simple math which sets the decimal in the right place!

Posting Permissions