0

preloaded autorun



Hi,

is it possible to load a custom autorun.brs file onto compact player internal memory and for this autorun script to be used, on power-up, to play media files on the flash card?

looking at the shell commands, would it be the 'writebootfile' command we can use? Is it necessary to specify full paths?

3 comments

  • 0
    Avatar
    RokuLyndon



    See link to attached script below. Name your script boot.brs that you want loaded into memory. Keep in mind if you're referencing any files on the sd card, you'll need to point to the sd card explicitly. So, if you were playing movie.mpg before, you'll need to play SD:/movie.mpg.

  • 0
    Avatar
    Andrew Gray


    Hi Lyndon, thanks!



    What's the the of the string where emoticon has got inserted? " 30) " I guess?



    <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
  • 0
    Avatar
    Andrew Gray


    Running the script causes a crash with the following debug output...

    Current firmware on the unit is 3.1.46





    001: mfg=CreateObject("roMfgTest")

    002: if not mfg.WriteBootFile("", "autorun.brs") then goto finished

    003: if not mfg.WriteBootFile("boot.brs", "autorun.brs") then goto finished

    004:

    005: finished:

    006: vm = CreateObject("roVideoMode")

    007: meta = CreateObject("roAssociativeArray")

    008: meta.AddReplace("CharWidth", 15)

    009: meta.AddReplace("CharHeight", 30)

    010: meta.AddReplace("BackgroundColor", &H101010) ' Dark grey

    011: meta.AddReplace("TextColor", &Hffff00) ' Yellow

    012: tf = CreateObject("roTextField", vm.GetSafeX()+10, vm.GetSafeY()+vm.GetSafeHeight()/2, 60, 2, meta)

    013: tf.SendBlock("Internal Autorun.brs Updated. Remove Power & Flash Card.")

    014: sleep(10000)

    015: stop

    Line 0 error code &hf7: STOP



    <no source>Backtrace:

    Function Main() As Void

      entry evsp: 0



    Local Variables:

    global   &h07 rotINTERFACE:ifGlobal

    m        &h06 bsc:roAssociativeArray, refcnt=2

    mfg      &h16 bsc:roMfgTest, refcnt=1

    vm       &h16 bsc:roVideoMo
Please sign in to leave a comment.