The LED Script

The script syntax for LED Sign V3.1 is 100% backward compatible with previous versions of LED Sign. If your script ran on V2.x it will run on V3.1. However, a V3.1 script may not run on V2.x.

Syntax

A "command" consists of a function/transition followed by zero or more parameters in keyword/value format:

<function/transition> <parameters...>
Each command must be on one line. A line that starts with a "!!" is a comment. Here is an example of a script:
!! Just a simple script
Do
   !! Move "Hello" up onto the sign
   ScrollUp delay=30 center=true text=Hello
   Sleep delay=1000

   !! Scroll "This is a test" left onto the sign
   ScrollLeft delay=30 startspace=20 endspace=80 text=This is a test
   Sleep delay=300

!! Repeat infinitely
Repeat times=-1

You can write a script with the same text editor that you use to write your HTML. Programs like Windows Notepad or Macintosh teachtext will work fine.

Functions/Transitions

The different functions/transitions available in LED Sign are as follows:
Func/Trans Description
Appear Cause text to appear on the sign
Sleep A delay
ScrollUp Scroll whatever is on the sign and the new message on going from bottom to top.
ScrollDown Scroll whatever is on the sign and the new message on going from top to bottom.
ScrollLeft Scroll whatever is on the sign and the new message on going from right to left.
ScrollRight Scroll whatever is on the sign and the new message on going from left to right.
ScrollCenter Scroll whatever is on the sign and the new message originating from the center.
OverUp same as ScrollUp except it overwrites whatever is on the sign.
OverDown same as ScrollDown except it overwrites whatever is on the sign.
OverLeft same as ScrollLeft except it overwrites whatever is on the sign.
OverRight same as ScrollRight except it overwrites whatever is on the sign.
OverCenter same as ScrollCenter except it overwrites whatever is on the sign.
Pixel Pixel in a new message
Blink Cause what ever is on the sign to blink
Do begin a "Repeat" block
Repeat end a "Repeat" block
Reload Reload the script. Whenever LED Sign gets the Reload command, it will reload the script over the URL. Useful if information is updated frequently (like stock quotes). The LED "script" may be a CGI program or may be passed through a server-side include process. An example use of reload:
      Do
            [Display some messages/information]
      
      !! display those messages 5 times
      Repeat times=5
      !! Now reload the script to get any possible changes
      Reload
Chain Similar to reload, except the current script "chains" to a new script. The script parameter is required; it specifies the URL of the new script. The LED "script" may be a CGI program or may be passed through a server-side include process. Example:
      Do
            [Display some messages/information]
      
      !! display those messages 5 times
      Repeat times=5
      !! Chain to a new script
      Chain script=http://another.site.name/led/scripts/times-square.led

Parameters

The parameters supported are listed below. Capitalization is significant. If the parameter is omitted from the command, the default value (if applicable) is used. Parameter usage with each function/transition is shown in the next section.

Parameter Description
text=<string> The text to display next (after the transition completes). Must be the last parameter in a command; the rest of the line is read as the text to display. The string may contain date/time tags and color tags.
Default: "no text specified"
clear=true Causes transition to blank display. Equivalent to text=
delay=<pos int> Sets step delay (milliseconds). For transitions, this is the delay between each step in the transition (e.g., row or column of LEDs). For the Sleep command, this is the total time to sleep (again, milliseconds).
Default: 40 ms. for transitions, 1000 ms. for Sleep
startspace=<pos int> Space in LEDs to add to the beginning of the current message text.
Default: 10 LEDs
endspace=<pos int> Space in LEDs to add to the end of the current message text.
Default: 20 LEDs
center=true Causes the current message to finish in the center of the display. Note that startspace and endspace are ignored if this parameter is used. If the width of the display is insufficient to contain the entire message, only the center part will be visible when the transition completes.
times=<-1 | pos int> Specifies the number of times a Repeat loop will run. -1 specifies infinity, i.e., the Repeat loop will run forever.
Default: -1 (infinity)
pixels=<pos int> Used with Pixel to set the number of LEDs that are randomly changed at each time step. Higher values cause the transition to complete more quickly, as more pixels are changed for each step. Vary this and the delay parameter together to achieve the desired effect.
Default: 15
URL=<URL string> Specifies a URL-link to be associated with this transition or function. Frame/window target may also be specified, following a comma after the URL itself. For more information on frame and window target names, see the Netscape or Microsoft documentation on these features. A URL may be specified with Blink and Sleep. The URL may be local or remote, and if local, must be absolute (begin with a '/'). Examples:
  URL=http://java.sun.com/
  URL=/news/breakin.html
  URL=/reports/weekly.html,new_window  <== URL with frame/window target
Default: none
script=<URL string> Used with Chain (required parameter). Specifies the URL of the script to be run next (chained-to). The current script stops execution at this point. Note that LED scripts do not have to come from files. You can run a CGI program to generate the script, or send a file through your server's "server-side include" processor and use its dynamic substitution features to get really fancy. WebSite Pro's ODBC/SQL interface (as well as its SSI engine) can be used to generate LED scripts.
  script=http://solo.dc3.com/java/etc/led/scripts/demo.led
  script=/demo/led/test.led
  script=/cgi-bin/weather.pl
  script=/~wsapi/dbml/getstocks-led.dbml?id1=MSFT&id2=NSCP

Parameter Usage

The following table shows which parameters may be used with each function/transition. Parameters enclosed in square brackets are optional, and may default if they don't appear in the command. Vertical bar means alternation ("or"). [spacing] is a shorthand for:
   [center=true] | 
   [startspace=<pos int>] [endspace=<pos int>]

Func/Trans Applicable Parameters
Appear [clear=true] [spacing] [URL=<URL string>] [text=<string>]
Sleep [URL=<URL string>] [delay=<pos int>] (defaults to 1000)
ScrollUp [clear=true] [URL=<URL string>] [delay=<pos int>] [spacing] [text=<string>]
ScrollDown [clear=true] [URL=<URL string>] [delay=<pos int>] [spacing] [text=<string>]
ScrollLeft [clear=true] [URL=<URL string>] [delay=<pos int>] [spacing] [text=<string>]
ScrollRight [clear=true] [URL=<URL string>] [delay=<pos int>] [spacing] [text=<string>]
ScrollCenter [clear=true] [URL=<URL string>] [delay=<pos int>] [spacing] [text=<string>]
OverUp [clear=true] [URL=<URL string>] [delay=<pos int>] [spacing] [text=<string>]
OverDown [clear=true] [URL=<URL string>] [delay=<pos int>] [spacing] [text=<string>]
OverLeft [clear=true] [URL=<URL string>] [delay=<pos int>] [spacing] [text=<string>]
OverRight [clear=true] [URL=<URL string>] [delay=<pos int>] [spacing] [text=<string>]
OverCenter [clear=true] [URL=<URL string>] [delay=<pos int>] [spacing] [text=<string>]
Pixel [clear=true] [URL=<URL string>] [delay=<pos int>] [pixels=<pos int>] [spacing] [text=<string>]
Blink [delay=<pos int>] [URL=<URL string>] [times=<pos int>]
Do (no parameters)
Repeat times=<-1 | pos int> (the "times" parameter is required)
Reload (no parameters)
Chain script=<URL string> (the "script" parameter is required)

Text Color Tags

In LED Sign you can make the "on" LEDs eight different colors:

The way you specify a color is with a '\' followed by 'r', 'o', 'y', 'g', 'c', 'b', 'p', or 'w'. Everything after a color specification will be that color until another color is specified or the end of the line is reached. Each line starts out with the default of red. The text specified as:
  text=This \ois \ya \gtest
will appear on the sign as "This is a test" but with "Test" being red, "is" being orange, "a" being yellow and "test" being green.

Date/Time Tags

LED Sign also has the capability of displaying the current time/date. The tags are specified in the text just like the colors. Here are the time/date tags:

The way the time/date tags are used is by preceding them by a backslash ('\') and enclosing them in brackets ({}). Here is an exaple:
  ScrollLeft text=The current time is \{tt}. Today is \{dd} \{mm} \{dn}, \{YY}.
The line above in a script would print somthing like "The current time is 6:19 pm. Today is Sun Oct 29, 1995." on the sign.

URL connections

If a function/transition includes the URL parameter, the sign's border will change to the "hot link" color (see applet parameters), and if the user clicks on the sign, the linked-to page will be displayed. If the URL is followed by a comma and a "target" name, the new document will be opened in the specified frame or (new) window. For more information on frame and window targets, see the Netscape or Microsoft documentation on these features. Examples:
     ScrollLeft URL=http://java.sun.com/ text=Uh... Java is Cool!
     ScrollLeft URL=http://java.sun.com/ endspace=40 text=Click here for Java
     ScrollUp URL=/reports/weekly.html,report_window
The URL tag is also valid for the Sleep and Blink functions. So you can be displaying a message and sleeping, and they can still click on the sign and have it take them to the URL. Example:
     Appear center=true URL=http://Java.sun.com/ text=Java Home
     Sleep URL=http://www.sun.com/ delay=4000
     !! Wait a long time to give them a chance to click

Notes

The "text" parameter must be the last parameter because the string after the "text=" is your message. What you see is what you get.

If the "clear=true" parameter is given to one of the transitions, it will cause the sign to clear (turn off LEDs) in the manner of the transition. i.e. "ScrollDown clear=true" would clear the sign by scrolling whatever is on the sign downward off of the sign.

If the "center=true" option is set, then the message will be centered on the sign if it fits on the sign. It doesn't make sense to center a message if it is longer than the sign. So, if your message isn't centering, then it is probably too long. The "startspace" and "endspace" parameters are ignored when the "center=true" parameter is given.

The script is much like HTML in how it handles function tags and parameters. It will ignore anything it does not recognize. However, there are some ways to stop the applet. For example, "delay=fifty" is incorrect because "delay" requires an integer and would thus cause the applet to stop. There is some script error output. If you are having trouble with LED Sign running your script, check your java console (under options menu in Netscape); any error output is printed there.


The LED Sign Java applet is written and Copyright 1995 by Darrick Brown
Changes to this applet are written by and Copyright 1996 by Robert B. Denny