CraftScript
  • CraftScript
  • Syntax
    • Kinds
    • Keywords
    • Language Features
  • Tutorials
    • Getting Started
      • Assurance Keywords
      • Value Keywords
      • Condition Keywords
      • Other Keywords
    • Using the Language
      • The Do Block
    • Importing External Scripts
    • Adding CraftScript to a Server
    • Environments and Contexts
  • Libraries
    • Reflection
    • Debug
    • Math
    • Parser
    • Global
Powered by GitBook
On this page
  1. Libraries

Global

Global variables available across the environment.

The global library is a single constant key<->value variable map.

It is identical between all scripts and functions that run in the environment. The data is not accessible from other environments.

import [global]

global[greeting="hello"]

run function {
    import [global]
    /say {global[greeting]}
}

The global variable container has special access protection governed by the OS kernel so that multiple programs can access it simultaneously.

PreviousParser

Last updated 1 year ago