Skip to content

Reference Script Functions Globals

Kristopher Barrantes edited this page Nov 5, 2026 · 2 revisions

Global variables script functions

Also on the Cuebot Docs site.

Functions for C# (Cb.Call) and Python (a cb method each, or cb.call). See Script functions for how to use them.

A Run Python code step in the action editor

globals.clearTemporary

Deletes every temporary global variable (the ones that are not saved). Saved ones stay.

Gives back: How many variables were deleted.

C#

var answer = await Cb.Call("globals.clearTemporary");

Python

answer = cb.globals_clear_temporary()

globals.delete

Deletes a global variable.

Value In Python What to put in
name name The variable name, like "deaths".

Gives back: true when the variable existed, false when there was nothing to delete.

C#

var answer = await Cb.Call("globals.delete", new { name = "deaths" });

Python

answer = cb.globals_delete(name="deaths")

globals.get

Reads a global variable as text, the same way name shows it in a message.

Value In Python What to put in
name name The variable name, like "deaths".

Gives back: The value as text, or null when there is no such variable.

C#

var answer = await Cb.Call("globals.get", new { name = "deaths" });

Python

answer = cb.globals_get(name="deaths")

globals.getValue

Reads a global variable and keeps its type, so a number stays a number and true/false stays true/false.

Value In Python What to put in
name name The variable name, like "deaths".

Gives back: The value as a number, true/false or text, or null when there is no such variable.

C#

var answer = await Cb.Call("globals.getValue", new { name = "deaths" });

Python

answer = cb.globals_get_value(name="deaths")

globals.increment

Adds to a number in a global variable, like a death counter. A missing variable starts at 0. Fails when the variable holds text that is not a number.

Value In Python What to put in
name name The variable name, like "deaths".
amount amount Optional. How much to add, like 1 or 0.5. Use a negative number to subtract. Leave it out to add 1.
persisted persisted Optional. true (the default) saves it so it is still there after a restart; false keeps it only until Cuebot closes.

Gives back: The new value.

C#

var answer = await Cb.Call("globals.increment", new { name = "deaths", amount = 1 });

Python

answer = cb.globals_increment(name="deaths", amount=1)

globals.set

Saves a value in a global variable. Every action can read it, and messages can show it with name. The value is stored as text.

Value In Python What to put in
name name The variable name, like "lastRaider".
value value The value to store, like "CoolStreamer". Numbers and true/false are stored as text.
persisted persisted Optional. true (the default) saves it so it is still there after a restart; false keeps it only until Cuebot closes.

Gives back: Nothing.

C#

var answer = await Cb.Call("globals.set", new { name = "lastRaider", value = "CoolStreamer" });

Python

answer = cb.globals_set(name="lastRaider", value="CoolStreamer")

Clone this wiki locally