Roku HD110 User Guide - Page 69

Sample script, Roku Objects, HELLO.BRS, Roku&gt, AUTORUN.BRS, Roku BrightScript Reference

Page 69 highlights

Sample script Here is how to create a very simple script: 1 Using a text editor, create a file called HELLO.BRS by entering this line: print "hello world" 2 Save HELLO.BRS into the root directory of a SD card. 3 Insert the SD card into BrightSign. 4 Connect the serial port of BrightSign to your PC using a null modem cable. 5 On your PC, run HyperTerminal (see BrightSign shell for details). 6 Turn on BrightSign and wait for the Roku> shell prompt to appear. 7 Type: script hello.brs You should see "hello world" on your PC screen. 8 If you want the script to autorun upon boot, rename it AUTORUN.BRS. Roku Objects As well as the BrightScript language itself, BrightSign relies upon a library of Roku Objects to expose the hardware to the scripting language. Each Roku Object provides access to certain capabilities. For example, there is a roVideoPlayer object and a roTouchScreen object. To create an object in a script, you need to use the CreateObject() function. When writing scripts, refer to the following two manuals: • Roku BrightScript Reference: Describes the scripting language • Roku Object Reference: Describes Roku Objects, such as roVideoPlayer 63 • •

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118

63
Sample script
Here is how to create a very simple script:
1
Using a text editor, create a file called
HELLO.BRS
by entering this line:
print “hello world”
2
Save HELLO.BRS into the root directory of a SD card.
3
Insert the SD card into BrightSign.
4
Connect the serial port of BrightSign to your PC using a null modem cable.
5
On your PC, run HyperTerminal (see
B
rightSign
shell
for details).
6
Turn on BrightSign and wait for the
Roku>
shell prompt to appear.
7
Type:
script hello.brs
You should see “hello world” on your PC screen.
8
If you want the script to autorun upon boot, rename it
AUTORUN.BRS
.
Roku Objects
As well as the BrightScript language itself, BrightSign relies upon a library of Roku Objects to
expose the hardware to the scripting language. Each Roku Object provides access to certain
capabilities. For example, there is a roVideoPlayer object and a roTouchScreen object. To create
an object in a script, you need to use the CreateObject() function.
When writing scripts, refer to the following two manuals:
Roku BrightScript Reference:
Describes the scripting language
Roku Object Reference:
Describes Roku Objects, such as
roVideoPlayer