Repository navigation
Reference Script Functions Globals
Also on the Cuebot Docs site.
Functions for C# (Cb.Call) and Python (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.call("globals.clearTemporary")Deletes a global variable.
| Value | What to put in |
|---|---|
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.call("globals.delete", name="deaths")Reads a global variable as text, the same way name shows it in a message.
| Value | What to put in |
|---|---|
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.call("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 | What to put in |
|---|---|
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.call("globals.getValue", 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 | What to put in |
|---|---|
name |
The variable name, like "deaths". |
amount |
Optional. How much to add, like 1 or 0.5. Use a negative number to subtract. Leave it out to add 1. |
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.call("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 | What to put in |
|---|---|
name |
The variable name, like "lastRaider". |
value |
The value to store, like "CoolStreamer". Numbers and true/false are stored as text. |
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.call("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