Thumbnail

Script

Multi-language ARC Script: build, run and debug Blockly, JavaScript, EZ-Script or Python with Intellisense, run/save/load and Roboscratch support

How to add the Script robot skill

  1. Load the most recent release of ARC (Get ARC).
  2. Press the Project tab from the top menu bar in ARC.
  3. Press Add Robot Skill from the button ribbon bar in ARC.
  4. Choose the Scripting category tab.
  5. Press the Script icon to add the robot skill to your project.

Don't have a robot yet?

Follow the Getting Started Guide to build a robot and use the Script robot skill.


How to use the Script robot skill

The Script robot skill lets you add custom behavior to your Synthiam ARC project by writing a program (“a script”). A script can control or read from many other ARC skills (servos, cameras, speech, sensors, Auto Position, etc.) and can be used for anything from simple tests (like “say hello”) to full robot routines.

The Script skill supports these programming options:

Before You Start (Quick Checklist)

  1. Add the Script skill to your project: Project → Add Skill → Scripting → Script
  2. Add the robot skills you want to control (example: a servo controller, a camera, speech synthesis, etc.). Your script will send commands to those skills.
  3. Open the Script skill’s settings, pick a language, create your script, and save.

Main Window

Script skill main window numbered diagram
1. Start/Stop Button

Starts or stops the script assigned to this skill. Use Start to run your program and Stop to halt it.

Tip: If nothing happens when you press Start, open Settings and confirm you saved your script and selected the correct language tab.
2. Status Display

Shows messages from your script and the current state (running, stopped, errors, etc.). When troubleshooting, check here first—syntax mistakes and missing skills often show up as status messages.

Settings (General Concepts)

In Settings, you choose the script language and edit your program. Each language view includes tools to help you test and manage your script.

  • Save often: Save your work after changes so the main window runs the latest version.
  • Use Run/Test: Some editors include a Run button so you can test before saving.
  • Use the built-in manuals: The Script skill includes helpful documentation within the settings for programming and ARC commands.

Settings - Blockly

Script skill Blockly settings numbered diagram
1. Title Field

Sets the name of this Script skill as it appears in your ARC project. You can rename it to something descriptive (example: Dance Routine or Greeting Script).

Note: Changing the title also changes the name used by controlCommand() calls that reference this skill.
2. Roboscratch Module Checkbox

Enables this script to be used as a module by Roboscratch. Leave this unchecked unless you know you are building a Roboscratch module.

3. Start/Stop Button

Runs or stops your Blockly program directly from the Settings screen. This is handy while you’re building and testing.

4. Clear Sketch Button

Clears the Blockly workspace (your blocks). Use this if you want to start over.

Tip: Save first if you might want to restore your work later.
5. Create Variable Button

Creates a new variable you can use in your blocks. Variables let you store values (like a counter, a distance reading, or a servo position) and reuse them.

6. Load Worksheet Button

Loads a previously saved Blockly worksheet (your block layout). Useful for reusing programs across projects or restoring older versions.

7. Save Worksheet Button

Saves the current Blockly worksheet so you can reopen it later.

8. Camera Preview

Shows the configured camera feed. This is especially useful when your Blockly program uses camera-based skills (tracking, object recognition, etc.).

9. Block Selection Area

The toolbox containing available blocks. Choose categories (movement, logic, variables, etc.) and drag blocks into the worksheet.

10. Status Display

Shows messages from the Blockly script while it runs (progress, errors, debug messages). If something does not work, check this area for hints.

11. Blockly Worksheet

The workspace where you build your program by snapping blocks together. Start with simple sequences (do A, then do B), then add logic (if/then) and loops (repeat).

Settings - JavaScript

Script skill JavaScript settings numbered diagram
1. Name Field

Sets the name of the Script skill. Use a clear name that matches what the script does (example: Patrol Mode).

2. Roboscratch Module Checkbox

Turns this script into a Roboscratch module. Beginners usually leave this unchecked.

3. Font Smaller/Larger Buttons

Adjusts editor text size for comfort. Increase the font if you are reading on a small screen.

4. Enable Intellisense Checkbox

Shows auto-complete suggestions and helpful hints while typing. This is strongly recommended for beginners because it reduces typing mistakes.

5. Script Editor

Where you write JavaScript code. Use the ARC JavaScript API to interact with other skills and the robot hardware.

6. Run Button

Runs the script in the editor without committing it as your saved version. Use this to test changes quickly before saving.

Tip: If the Run button shows errors, correct them first—then save and run from the main window.

Settings - EZ-Script

Script skill EZ-Script settings numbered diagram
1. Name Field

Names your Script skill. Naming scripts clearly helps when you have multiple Script skills in one project.

2. Roboscratch Module Checkbox

Enables Roboscratch module behavior. Leave unchecked unless you are intentionally creating a module.

3. Format Button

Automatically formats (tidies) your script for readability. This helps beginners spot missing lines, indentation problems, or messy code.

4. Font Smaller/Larger Buttons

Changes editor font size.

5. Enable Intellisense Checkbox

Enables auto-complete and command suggestions while typing. This is helpful when learning EZ-Script commands.

6. Script Editor

Where you write EZ-Script commands. EZ-Script is designed for ARC and is often very direct for robot actions and automation.

7. Run Button

Tests the script currently in the editor before saving. Use it to confirm your changes behave correctly.

Settings - Python

Script skill Python settings numbered diagram
1. Name Field

Names the Script skill instance. Choose a descriptive name so you can quickly identify it in larger projects.

2. Roboscratch Module Checkbox

Enables use as a Roboscratch module. Most beginners can ignore this option.

3. Font Smaller/Larger Buttons

Adjusts font size in the editor.

4. Enable Intellisense Checkbox

Shows coding suggestions and auto-complete while you type. This helps prevent spelling mistakes and speeds up learning.

5. Script Editor

Where you write your Python code. Use the ARC Python API to call robot commands and interact with other skills.

6. Run Button

Runs the current editor code to test it before saving. If your script errors, use the status/output area to identify what went wrong.

How to Use the Script Skill (Beginner Walkthrough)

  1. Add the Script skill:
    Project → Add Skill → Scripting → Script
  2. Open Settings and pick a language:
    • Choose Blockly if you want drag-and-drop programming.
    • Choose JavaScript / Python if you want a general-purpose coding language.
    • Choose EZ-Script if you want ARC’s classic scripting style.
  3. Create your first script:
    • Start with a simple action (example: speak a phrase, move a servo, wait 1 second).
    • Add one change at a time so you can easily tell what caused a problem.
  4. Test using the Run button (if available in that editor), then Save.
  5. Run from the Main Window: press Start to execute the saved script and watch the Status Display for progress or errors.

Control Commands for the Script robot skill

There are Control Commands available for this robot skill which allows the skill to be controlled programmatically from scripts or other robot skills. These commands enable you to automate actions, respond to sensor inputs, and integrate the robot skill with other systems or custom interfaces. If you're new to the concept of Control Commands, we have a comprehensive manual available here that explains how to use them, provides examples to get you started and make the most of this powerful feature.

Control Command Manual

ScriptStart

Starts the script to run in the background

Example:

controlCommand("Script", "ScriptStart")

ScriptStartWait

Starts the script and waits for it to complete

Example:

controlCommand("Script", "ScriptStartWait")

ScriptStop

Stop the script from running

Example:

controlCommand("Script", "ScriptStop")

GetStatus

Get the status if the script is running.

  • Returns: Boolean [true or false]

Example:

controlCommand("Script", "GetStatus")

Related Tutorials

Related Hack Events

Related Questions


ARC Pro

Upgrade to ARC Pro

Take control of your robot's destiny by subscribing to Synthiam ARC Pro, and watch it evolve into a versatile and responsive machine.