The next script step is set to the value of ScriptStack(). Its optional value is used to extend the time before the player executes again, to allow the servo to move and other processes time to execute as well.
PlayMove contains an index to the move table, whose corresponding string is sent to the serial port to control the animatronic’s servos. As each player is given its time slice, if the current time is less than the end wait time, nothing is done and execution passes to the next script/player/process. Its ScriptOption value is the number of microseconds to pause, and is added to the current timer value and stared in the PlayerEndWait() cell. ScriptPause is a simple command, placed in this section because it is used to pause for long times (relatively speaking) between commands. Loop sequentially through command group in a script. Network command to clear pauses in execution at a "NetWait" point not used in scriptsĭefine a point in script at which a network command can cause a pause in executionĭefine a command that will exit a script if it is already running in a separate player Pause some random time between the two times specified on the commandĬall a script rather than running it in parallel in its own player Randomly perform one of the following n actions Play external sound file will cause servo defined in "scbase" (e.g. "Pause" or "Delay" command pauses execution for n milliseconds Goto command label MUST exist (is not checked for)ĭefinition of label used in "JumpTo" commandĭefinition of scripts which will synchronize with other script(s)ĭefinition of step in script at which to wait for synchronization CommandĮxecute script in parallel script must be defined in same fileĭefine new script main script MUST be last in file (You can also get a sense of the history of adding features, by the position in the list of each command ) If you don’t want to get bored right now with the minutiae of the commands, skip forward to the program description to see how this all works. Action Commands First, there are currently 16 commands which the interpreter recognizes. One to define flapping the wings and a second to flap them three times. :Flappy1 PlayMove, Arms Up, 30 ScriptPause, 75 PlayMove, Arms Down, 30 ScriptPause 75 EndScript, Flappy1 :Flappy Playscript, Flappy1 Playscript, Flappy1 Playscript, Flappy1 EndScript, Flappy Note that this is two scripts. This value gives the servo time to respond and can be tuned per servo brand, by experimentation. :Blinky1 PlayMove,EyesClosed,30 ScriptPause 100 PlayMove, EyesOpen,30 Scriptpause, 3000 EndScript,Blinky1 Introducing one other command “ScriptPause, nnn” (which pauses for nnn milliseconds), we can write a script to blink the eyes for three times, pausing three seconds between blinks. For example, we have Eyes Closed and Eyes Open. Multiple lines can be combined to form a player (a script executing in parallel with other scripts. Each line represents one line in a script. These components form a group, of an action, an object and a value.