Repository navigation
Reference Script Functions Globals
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.
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()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")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")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")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)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")Cuebot by Tech Daddy Digital · MIT license · Privacy
Cuebot Docs (the same pages, nicer to read)
- Home
- Start here
-
Guides
- Chat commands
- The mod portal
- Overlays and alerts
- Writing your own overlay widgets
- Text-to-speech
- Music and now playing
- Points, store and giveaways
- Subathons and goals
- Stream apps and devices
- VTuber apps
- Stream Deck
- The phone app
- Donations and integrations
- Discord bot
- The setup assistant and AI tools
- The assistant on your own computer
- Moving from Streamer.bot
- Cuebot's servers
- Writing code (C# and Python)
- Python in detail
- Using your own code editor
- Controlling Cuebot from other programs
- Backups and your data
- Linux
- Command-line options
- Troubleshooting
- What's experimental
- Reference
