LanguageUpdated 2026-07-24

GPC script structure and syntax

How a Cronus Zen .gpc file is organized, from compile-time declarations through init, main, combos, and functions.

Overview

A GPC source file is compiled before it runs on a Cronus device. Put compile-time declarations and global storage before runtime blocks, then organize behavior around main, optional init, combos, and user functions.

The main block is mandatory. Keep source order and declaration placement explicit so the compiler can distinguish setup from executable statements.

Key facts

  • Every runnable script requires a main block.
  • init is optional and executes once when the script starts.
  • main executes repeatedly while the slot is active.
  • Remap and unmap declarations belong before runtime blocks.

GPC syntax examples

Examples are intentionally small. Replace identifiers only with values documented for your target.

Minimal runnable fileexample.gpc
init {
    // one-time setup
}

main {
    // repeated runtime logic
}

Functions, commands, and terms

Names below are catalog entries, not guessed signatures. Open the official sources for current parameter and return-value details.

NameKindPurpose
mainkeyword

Declares the mandatory repeating execution block.

initkeyword

Declares the optional one-time initialization block.

combokeyword

Declares a named timed sequence.

functionkeyword

Declares a reusable user function.

Common mistakes

Omitting main.

Placing declarations inside executable statements.

Assuming source runs top-to-bottom only once.

Official GPC sources

Use these first-party references to confirm exact syntax and runtime behavior for your installed firmware and Studio version.

Related GPC references