Author Topic: Countdown --- Again  (Read 6597 times)

Offline cendrick

  • Jr. Member
  • **
  • Posts: 24
  • Karma: 0
    • View Profile
Countdown --- Again
« on: May 06, 2010, 03:22:25 PM »
Hello,
I've used this countdown several times but I'm now trying to figure out how to modify it so that when the countdown reaches say....:00:00 the script will exit and thus in a playlist would go to the next script in a playlist.
Here is the code for the countdown I've been using.
You will notice that there is a variable in the scala script called wait=0, this is where I'm confused as to how to get the vbs file to communicate to the scala script that it need to move to the wait=0 slide where I could then add an exit command.
Seems easy if you knew vbscript, which I don't :(

!ScalaScript500
:"countdown.sca"
{
Group:
Integer(wait);
String(Days, Hours);
BackgroundSettings(Size(1024, 768));
Sequence:
wait = 1;
WindowsScript("countdown.vbs", ShareVariable("wait"), ShareVariable("Days"), ShareVariable("Hours"));
{
      Group:
      Display(Backdrop(Pen(1)), Margin(10, 10, 0, 0), Tabs(Explicit(80, 160, 240, 320, 400, 480, 560)), UserPalette(RGBPen(1, $0, $ffffff, $999999, $555555, $712068, $df449c, $dc110e, $662200, $ff5a00, $ff9c00, $ffee00, $8800, $dd00, $cccc, $66ff, $aa, $777777, $bbbbbb, $dddddd)));
      Text(128, 78, "Countdown Script", Face(On, Pen(2)), AntiAlias(On), Update(Normal), Font("Bitstream Vera Sans (Western [])", 50), Wrap(On, Width(886)));
      Text(134, 165, "Days: !Days", Face(On, Pen(2)), AntiAlias(On), Update(Normal), Font("Bitstream Vera Sans (Western [])", 50), Wrap(On, Width(880)));
      Text(143, 245, "Hours: !Hours", Face(On, Pen(2)), AntiAlias(On), Update(Normal), Font("Bitstream Vera Sans (Western [])", 50), Wrap(On, Width(871)));
      HardDuration(5000);
}
wait = 0;
}
----------------------------------------------------

VBScript (countdown.vbs)
----------------------------------------------------
dim d
dim n
Dim oScala
Set oScala = CreateObject("ScalaPlayer.ScalaPlayer.1")
n=DateSerial(2007, 5, 26)+TimeSerial(22, 0, 0)

While (wait = 1)
d=now()
Days = "" & int(n-d)
Hours = FormatDateTime((n-d)-int(n-d), vbLongTime)
oScala.Sleep(200)
Wend

Offline cendrick

  • Jr. Member
  • **
  • Posts: 24
  • Karma: 0
    • View Profile
Re: Countdown --- Again
« Reply #1 on: May 10, 2010, 02:29:18 PM »
Hello,

Does anyone have any suggestions?
Has anyone done this? 

thanks

Offline bwillems

  • Jr. Member
  • **
  • Posts: 16
  • Karma: 0
    • View Profile
Re: Countdown --- Again
« Reply #2 on: May 10, 2010, 05:15:40 PM »
cendrick,

In your example, it is the Scala script that defines how long to display the countdown (the HardDuration line). I think (and I can't test this at this computer) that what you need is: 

Code: [Select]
!ScalaScript500
:"countdown.sca"
{
  Group:
    Integer(wait);
    String(Days, Hours);
    BackgroundSettings(Size(1024, 768));
  Sequence:
    :"Set Flag"
    wait = 1;
    :"Run VBScript"
    WindowsScript("countdown.vbs", ShareVariable("wait"), ShareVariable("Days"), ShareVariable("Hours"));
    :"Display Countdown"
    {
      Group:
        Display(Backdrop(Pen(1)), Margin(10, 10, 0, 0), Tabs(Explicit(80, 160, 240, 320, 400, 480, 560)), UserPalette(RGBPen(1, $0, $ffffff, $999999, $555555, $712068, $df449c, $dc110e, $662200, $ff5a00, $ff9c00, $ffee00, $8800, $dd00, $cccc, $66ff, $aa, $777777, $bbbbbb, $dddddd)));
        While(wait = 1);
      Sequence:
        {
          Group:
            Text(128, 78, "Countdown Script", Face(On, Pen(2)), AntiAlias(On), Update(Normal), Font("Bitstream Vera Sans (Western [])", 50), Wrap(On, Width(886)));
            Text(134, 165, "Days: !Days", Face(On, Pen(2)), AntiAlias(On), Update(Normal), Font("Bitstream Vera Sans (Western [])", 50), Wrap(On, Width(880)));
            Text(143, 245, "Hours: !Hours", Face(On, Pen(2)), AntiAlias(On), Update(Normal), Font("Bitstream Vera Sans (Western [])", 50), Wrap(On, Width(871)));
            HardDuration(500);
        }
    }
}

The above has the Scala Script setting the wait flag and then running the VBScript and then looping until the wait flag gets reset - which is done in the VBScript:

Code: [Select]
----------------------------------------------------

VBScript (countdown.vbs)
----------------------------------------------------
dim d
dim n
Dim oScala
Set oScala = CreateObject("ScalaPlayer.ScalaPlayer.1")
' set the target date/time
n=DateSerial(2010, 5, 26)+TimeSerial(22, 0, 0)
d=now()

' loop until we reach the target
While (d < n)
  d=now()
  Days = "" & int(n-d)
  Hours = FormatDateTime((n-d)-int(n-d), vbLongTime)
  oScala.Sleep(500)
Wend

' tell Scala we're done
wait = 0

Like I said, I can't test the syntax of my Scala code right now so it probably has some bugs. When you get it figured out, please post your solution.

Bill

Offline cendrick

  • Jr. Member
  • **
  • Posts: 24
  • Karma: 0
    • View Profile
Re: Countdown --- Again
« Reply #3 on: May 11, 2010, 08:10:20 AM »
Hi Bill,

I appreciate you taking a look at this for me.
I've made the changes you suggested and it pretty much works the same way as how I had it.  When the time goes to '0', the script keeps running showing the :00 time on the screen.  What I'm trying to figure is how to get the script to quit.  Seems like there should be a way to loop this countdown while a var is true and once its false, ie: :00 time then the var would then be false and the loop would proceed to the next event which could be a go to command which could be set to exit script.

Thoughts?

Rick

Offline bwillems

  • Jr. Member
  • **
  • Posts: 16
  • Karma: 0
    • View Profile
Re: Countdown --- Again
« Reply #4 on: May 11, 2010, 10:01:25 AM »
Rick,

The Scala script should "fall out the bottom" and continue with the next item in the playlist. If this script is the only thing in your test playlist then it is just going to keep playing.

Also, you could make the target date and time (what you are counting down to) a variable in the Scala Script that would then be set in Content Manager instead of you creating a new script each time.

Bill

Offline cendrick

  • Jr. Member
  • **
  • Posts: 24
  • Karma: 0
    • View Profile
Re: Countdown --- Again
« Reply #5 on: May 11, 2010, 10:34:01 AM »
Hello Bill,

I was able to figure out how to modify this so it now works just fine.  I changed the way it loops by changing the repeat to 'until'.
See code below.
How would you link the vbs file in the CM so that easy changes could be made to the end time?
Would love to do that as this time would change a lot.

!ScalaScript500
// Saved by Scala Designer 5 Release 5.1.5 at 2010-05-11 10:23:26
:"countdownb.sca"
{
  Group:
    Integer(wait);
    String(Days, Hours);
    BackgroundSettings(Size(1024, 768));
  Sequence:
    {
      Group:
        Until(wait=0);
      Sequence:
        :"Set Flag"
        wait = 1;
        :"Run VBScript"
        WindowsScript("countdownbb.vbs", ShareVariable(wait), ShareVariable(Days), ShareVariable(Hours));
        :"Display Countdown"
        {
          Group:
            Display(Backdrop(Pen(1)), Margin(10, 10, 0, 0), Tabs(Explicit(80, 160, 240, 320, 400, 480, 560)), UserPalette(RGBPen(1, $0, $ffffff, $999999, $555555, $712068, $df449c, $dc110e, $662200, $ff5a00, $ff9c00, $ffee00, $8800, $dd00, $cccc, $66ff, $aa, $777777, $bbbbbb, $dddddd)));
            Text(130, 102, "!Hours", AntiAlias(On), OnReplay(Replace), Under(Off, Thickness(3)), Font("Bitstream Vera Sans (Western [])", 50), Wrap(On, Width(884)));
        }
    }
    Quit(1);
}

Offline bwillems

  • Jr. Member
  • **
  • Posts: 16
  • Karma: 0
    • View Profile
Re: Countdown --- Again
« Reply #6 on: May 11, 2010, 05:17:15 PM »
Rick,

Glad to hear you got it working!

To reuse this, create some variables to define the target date/time:

Code: [Select]
!ScalaScript500
// Saved by Scala Designer 5 Release 5.1.5 at 2010-05-11 10:23:26
:"countdownb.sca"
{
  Group:
    Integer(wait, d_yyyy, d_mm, d_dd, t_hh, t_mm, t_ss);

...

:"Run VBScript"
        WindowsScript("countdownbb.vbs", ShareVariable(wait), ShareVariable(Days), ShareVariable(Hours), ShareVariable(d_yyyy), ShareVariable(d_mm), ShareVariable(d_dd), ShareVariable(t_hh), ShareVariable(t_mm), ShareVariable(t_ss));

...

}

And in the VBScript:

Code: [Select]
----------------------------------------------------

VBScript (countdown.vbs)
----------------------------------------------------
dim d
dim n
Dim oScala
Set oScala = CreateObject("ScalaPlayer.ScalaPlayer.1")
' set the target date/time
n=DateSerial(d_yyyy, d_mm, d_dd)+TimeSerial(t_hh, t_mm, t_ss)

...

Now, when you publish to Content Manager you get a template. Make sure the d_ and t_ variables are not optional (don't check the box) and now you get to define them when you use the template to create a message.

I haven't done this specifically so I kind of glossed over that last part...

Bill

Offline cendrick

  • Jr. Member
  • **
  • Posts: 24
  • Karma: 0
    • View Profile
Re: Countdown --- Again
« Reply #7 on: May 12, 2010, 12:46:42 PM »
Bummer...

I don't have template ex so I bet this won't work for me huh?
I knew I should of bought that 'expensive' plugin :(

Offline cendrick

  • Jr. Member
  • **
  • Posts: 24
  • Karma: 0
    • View Profile
Re: Countdown --- Again
« Reply #8 on: May 12, 2010, 04:04:22 PM »
Partial Solution;

What I've been able to do is to create a script in designer with a link to a shared vbs file on a server.  When the player runs it does display the countdown correctly.
However my big hope and plan was to be able to access this vbs file and modify the end time so that the countdown could in fact change 'live' as it was counting down.
The purpose would be if we needed say an extra minute or two before the timer hit 0 we could in theory modify this vbs file.
However when the shared vbs file is changed it does not affect the countdown at all.  Even if the player is stopped and restarted it still shows the old countdown timer.
It seems the only way to get the new vbs file to be recognized is to go back into designer and re-publish the script then it does play correctly until you change the vbs end time again.  Make sense?
This is interesting.....if I play the countdown directly out of designer...the countdown begins, if I then go into my vbs script at the shared location and modify the end time where I would be either adding to or taking away time...the designer playback does show that change but unfortunately it shows both the new time and the old time...flipping back and forth...ugly.
So, with this test it appears that the vbs file is being retained somehow in memory or in some sort of buffer?  I'm no programmer....only know enough to get to this point and scream:)
Anyone have any suggestions?

Thank you,

Rick

Offline bwillems

  • Jr. Member
  • **
  • Posts: 16
  • Karma: 0
    • View Profile
Re: Countdown --- Again
« Reply #9 on: May 13, 2010, 09:48:13 AM »
Rick,

There are a couple of problems:

You said that if you modify the VBscript in place then (at least in Designer) both the new time and the old time flip back and forth. I looked back at the code you posted on Tues and I think I see what's causing this: the WindowsScript call is within your Repeat/Until loop. This means that you are calling the VBScript every time through the Repeat loop. Since the VBScript also has a loop in it, you have several instances of the VBScript running at the same time. Change the VBScript to remove the loop so it runs just once and then exits:

Code: [Select]
VBScript (countdown.vbs)
----------------------------------------------------
dim d
dim n
Dim oScala
Set oScala = CreateObject("ScalaPlayer.ScalaPlayer.1")
' set the target date/time
n=DateSerial(2010, 5, 26)+TimeSerial(22, 0, 0)
d=now()
Days = "" & int(n-d)
Hours = FormatDateTime((n-d)-int(n-d), vbLongTime)

' tell Scala if we're done
if (d < n) then wait = 0

' we should also be doing some cleanup
Set oScala = Nothing

Problem #2: the reason why we're seeing different behavior between Designer and the Player is because, when we publish the script, the VBScript is packaged and sent with the rest of the Scala Script to the Player. That is, even though Designer is running the VBScript from your shared location, the Player is running it from a local location. Essentially, we can't (easily) change the VBScript on-the-fly.

If we can't change the VBScript and we can't use Templates then the VBScript needs to get the Target date/time another way. Since you already have a shared location on a server, let's use that. Put a text file in that location and call it CountDownTarget.txt. The only line of this file will be the date and time separated by commas (so 5/12/2010 5:04:22 PM is "2010,5,12,17,4,22") - You can use whatever format you want by the code below is expecting this format.

Code: [Select]
VBScript (countdown.vbs)
----------------------------------------------------
dim oFS, myFile
dim d
dim n
Dim oScala
dim strTemp

' just keep chugging if we have an error
on error resume next

Set oScala = CreateObject("ScalaPlayer.ScalaPlayer.1")

' Create File System Object
Set oFS  = CreateObject("Scripting.FileSystemObject")
Set myFile = oFS.OpenTextFile(" ... path to CountDownTarget.txt ...", 1, False, 0)

' read the target
strTemp = myFile.ReadLine
myFile.Close

' extract the target date/time
strTemp = split(strTemp, ",", -1, 1)

' set the target date/time
n=DateSerial(int(strtemp(0)), int(strtemp(1)), int(strtemp(2)))+TimeSerial(int(strtemp(3)), int(strtemp(4)), int(strtemp(5)))
d=now()
Days = "" & int(n-d)
Hours = FormatDateTime((n-d)-int(n-d), vbLongTime)

' tell Scala if we're done
if (d < n) then wait = 0

' clean up
Set oScala = Nothing
Set myFile = Nothing
Set oFS = Nothing

You'll need to edit the above to include the path to CountDownTarget.txt. Again, I haven't tested the above so it could be buggy - especially that part with Split-ing strTemp.

You could also make it use a local file (instead of your shared folder on the server) and then upload the file manually as non-scheduled content or create a Publish Location.

Let me know how it goes.

Bill

Offline cendrick

  • Jr. Member
  • **
  • Posts: 24
  • Karma: 0
    • View Profile
Re: Countdown --- Again
« Reply #10 on: May 13, 2010, 10:54:38 AM »
I appreciate you working on this.
I'll give this a try today and post back.

rick ;)

Offline tc

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
    • View Profile
Re: Countdown --- Again
« Reply #11 on: August 13, 2010, 07:56:38 AM »
I know I'm a little late to the discussion but I've been working on a countdown here as well.  It runs within a Scala script, primarily using the Timing.seconds variable to calculate time remaining to a date.  Its a little tricky since timing.seconds is the number of seconds since Jan 1, 1980.  Theres a bunch of math and variables to calculate it all, but the script I've put together seems to work.   The players I have are running win xp. 

Does this script work on your machines?

Code: [Select]
!ScalaScript500
// Saved by Scala Designer 5 Release 4.0.9 at 2010-08-13 08:25:40
:"CountDown.sca"
{
  Group:
    External Integer(TimeRemaining_Seconds, TimeRemaining_Minutes, TimeRemaining_Hours, TimeRemaining_Days, FullSecondsRemainingToTargetDate, TargetDateInSeconds, SecondsToTargetThisYear, SecondsElapsedThruYearStart, TARGET_DAY, TARGET_HOUR, TARGET_MINUTE, TARGET_SECOND, TARGET_YEAR, LEAP_YEARS_SINCE_1980, SecondsInYear, SecondsInLeapYear, DD, HH, MM, SS);
    BackgroundSettings(Size(1920, 100));
  Sequence:
    TARGET_YEAR = 2011;
    TARGET_DAY = 1;
    TARGET_HOUR = 0;
    TARGET_MINUTE = 0;
    TARGET_SECOND = 0;
    SecondsInYear = 31536000;
    SecondsInLeapYear = 31622400;
    LEAP_YEARS_SINCE_1980 = 8;
    SecondsElapsedThruYearStart = (((TARGET_YEAR - 1980 - LEAP_YEARS_SINCE_1980)*SecondsInYear)+(LEAP_YEARS_SINCE_1980*SecondsInLeapYear));
    SecondsToTargetThisYear = (((TARGET_DAY-1)*24*60*60)+(TARGET_HOUR*60*60)+(TARGET_MINUTE*60)+(TARGET_SECOND));
    TargetDateInSeconds = (SecondsToTargetThisYear + SecondsElapsedThruYearStart);
    TimeRemaining_Days = (FullSecondsRemainingToTargetDate/60/60/24);
    TimeRemaining_Hours = (FullSecondsRemainingToTargetDate-(TimeRemaining_Days*24*60*60))/60/60;
    TimeRemaining_Minutes = (FullSecondsRemainingToTargetDate-(TimeRemaining_Days*24*60*60)-(TimeRemaining_Hours*60*60))/60;
    TimeRemaining_Seconds = (FullSecondsRemainingToTargetDate-(TimeRemaining_Days*24*60*60)-(TimeRemaining_Hours*60*60)-(TimeRemaining_Minutes*60));
    FullSecondsRemainingToTargetDate = (TargetDateInSeconds-(timing.seconds));
    DD = TimeRemaining_Days;
    HH = TimeRemaining_Hours;
    MM = TimeRemaining_Minutes;
    SS = TimeRemaining_Seconds;
    :"DayDisplay"
    {
      Group:
        Display(Backdrop(Pen(2)), Margin(2, 2, 0, 0), Tabs(Explicit(80, 160, 240, 320, 400, 480, 560)), UserPalette(RGBPen(1, $0, $ffffff, $999999, $555555, $712068, $df449c, $dc110e, $662200, $ff5a00, $ff9c00, $ffee00, $8800, $dd00, $cccc, $66ff, $aa, $777777, $bbbbbb, $dddddd)));
        Rect(-2, 83, 1925, 23, Outline(On), Transparent(Off), Thickness(2), Area(On, Opacity(61), Pen(16)));
        Text(1369, 82, "days ", Face(On, Pen(2)), Focus(Off, Pen(11)), Outline(Off, Pen(1)), Shadow(Off, Pen(1)), Transparent(Off), AntiAlias(On), Under(Off, Pen(2)), Font("Bitstream Vera Sans (Western [])", 20), Kerning(None), Wrap(Off, Width(814)));
        Text(1501, 81, "hours", Face(On, Pen(2)), Backdrop(Off, Pen(3)), Focus(Off, Pen(11)), Outline(Off, Pen(1)), Shadow(Off, Pen(1)), Transparent(Off), Bevel(Off, Base(Pen(3)), Left(Pen(18)), Right(Pen(17)), Top(Pen(19)), Bottom(Pen(4))), AntiAlias(On), Under(Off, Pen(2)), Font("Bitstream Vera Sans (Western [])", 20), Kerning(None), Wrap(Off, Width(814)));
        Text(1635, 80, "minutes", Face(On, Pen(2)), Backdrop(Off, Pen(3)), Focus(Off, Pen(11)), Outline(Off, Pen(1)), Shadow(Off, Pen(1)), Transparent(Off), Bevel(Off, Base(Pen(3)), Left(Pen(18)), Right(Pen(17)), Top(Pen(19)), Bottom(Pen(4))), AntiAlias(On), Under(Off, Pen(2)), Font("Bitstream Vera Sans (Western [])", 20), Kerning(None), Wrap(Off, Width(814)));
        Text(1788, 80, "seconds", Face(On, Pen(2)), Backdrop(Off, Pen(3)), Focus(Off, Pen(11)), Outline(Off, Pen(1)), Shadow(Off, Pen(1)), Transparent(Off), Bevel(Off, Base(Pen(3)), Left(Pen(18)), Right(Pen(17)), Top(Pen(19)), Bottom(Pen(4))), AntiAlias(On), Under(Off, Pen(2)), Font("Bitstream Vera Sans (Western [])", 20), Kerning(None), Wrap(Off, Width(814)));
        Text(172, 24, "Countdown to 2011", Face(On, Pen(1)), Transparent(Off), AntiAlias(On), Under(Off, Pen(1)), Font("SerpentineDBol (Western [])", 50), Wrap(On, Width(1643)));
        Rect(-5, 1, 1925, 13, Face(On, Pen(2)), Outline(On, Pen(1)), Transparent(Off), Thickness(2), Area(On, Opacity(61), Pen(16)));
        Text(1624, 8, "!MM", Layer(1), Face(On, Pen(16)), Backdrop(Off, Pen(3)), Focus(Off, Pen(11)), Outline(On, Pen(1)), Shadow(Off, Offset(3, 1), Pen(11)), Bevel(Off, Base(Pen(3)), Left(Pen(18)), Right(Pen(17)), Top(Pen(19)), Bottom(Pen(4))), AntiAlias(On), Under(Off, Thickness(3), Pen(16)), Font("Bitstream Vera Sans (Western [])", 70), UseCharHeight(On), Kerning(None), Wrap(Off, Width(323)));
        Text(1483, 8, "!HH", Layer(1), Face(On, Pen(16)), Backdrop(Off, Pen(3)), Focus(Off, Pen(11)), Outline(On, Pen(1)), Shadow(Off, Offset(3, 1), Pen(11)), Bevel(Off, Base(Pen(3)), Left(Pen(18)), Right(Pen(17)), Top(Pen(19)), Bottom(Pen(4))), AntiAlias(On), Under(Off, Thickness(3), Pen(16)), Font("Bitstream Vera Sans (Western [])", 70), UseCharHeight(On), Kerning(None), Wrap(Off, Width(269)));
        Text(1346, 8, "!DD", Layer(1), Face(On, Pen(16)), Backdrop(Off, Pen(3)), Focus(Off, Pen(11)), Outline(On, Pen(1)), Shadow(Off, Offset(3, 1), Pen(11)), Bevel(Off, Base(Pen(3)), Left(Pen(18)), Right(Pen(17)), Top(Pen(19)), Bottom(Pen(4))), AntiAlias(On), Under(Off, Thickness(3), Pen(16)), Font("Bitstream Vera Sans (Western [])", 70), UseCharHeight(On), Kerning(None), Wrap(Off, Width(237)));
      Sequence:
        Text(1779, 8, "!SS", Wipe("Dissolve", Speed(10), Direction(90), Wait(Off)), Face(On, Pen(16)), Backdrop(Off, Pen(3)), Focus(Off, Pen(11)), Outline(On, Pen(1)), Shadow(Off, Offset(3, 1), Pen(11)), Bevel(Off, Base(Pen(3)), Left(Pen(18)), Right(Pen(17)), Top(Pen(19)), Bottom(Pen(4))), AntiAlias(On), Under(Off, Thickness(3), Pen(16)), Font("Bitstream Vera Sans (Western [])", 70), UseCharHeight(On), Kerning(None), Wrap(Off, Width(363)));
    }
}

Offline MJUUM

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
    • View Profile
Re: Countdown --- Again
« Reply #12 on: August 29, 2010, 12:48:22 AM »
Hi, can this script apply on Scal ICD3?

Hello,
I've used this countdown several times but I'm now trying to figure out how to modify it so that when the countdown reaches say....:00:00 the script will exit and thus in a playlist would go to the next script in a playlist.
Here is the code for the countdown I've been using.
You will notice that there is a variable in the scala script called wait=0, this is where I'm confused as to how to get the vbs file to communicate to the scala script that it need to move to the wait=0 slide where I could then add an exit command.
Seems easy if you knew vbscript, which I don't :(

!ScalaScript500
:"countdown.sca"
{
Group:
Integer(wait);
String(Days, Hours);
BackgroundSettings(Size(1024, 768));
Sequence:
wait = 1;
WindowsScript("countdown.vbs", ShareVariable("wait"), ShareVariable("Days"), ShareVariable("Hours"));
{
      Group:
      Display(Backdrop(Pen(1)), Margin(10, 10, 0, 0), Tabs(Explicit(80, 160, 240, 320, 400, 480, 560)), UserPalette(RGBPen(1, $0, $ffffff, $999999, $555555, $712068, $df449c, $dc110e, $662200, $ff5a00, $ff9c00, $ffee00, $8800, $dd00, $cccc, $66ff, $aa, $777777, $bbbbbb, $dddddd)));
      Text(128, 78, "Countdown Script", Face(On, Pen(2)), AntiAlias(On), Update(Normal), Font("Bitstream Vera Sans (Western [])", 50), Wrap(On, Width(886)));
      Text(134, 165, "Days: !Days", Face(On, Pen(2)), AntiAlias(On), Update(Normal), Font("Bitstream Vera Sans (Western [])", 50), Wrap(On, Width(880)));
      Text(143, 245, "Hours: !Hours", Face(On, Pen(2)), AntiAlias(On), Update(Normal), Font("Bitstream Vera Sans (Western [])", 50), Wrap(On, Width(871)));
      HardDuration(5000);
}
wait = 0;
}
----------------------------------------------------

VBScript (countdown.vbs)
----------------------------------------------------
dim d
dim n
Dim oScala
Set oScala = CreateObject("ScalaPlayer.ScalaPlayer.1")
n=DateSerial(2007, 5, 26)+TimeSerial(22, 0, 0)

While (wait = 1)
d=now()
Days = "" & int(n-d)
Hours = FormatDateTime((n-d)-int(n-d), vbLongTime)
oScala.Sleep(200)
Wend