Some examples
Your bot can read a box (to show it in a message), change a box (to give someone more coins) and check a box (to see if someone has enough coins to buy something).
Three kinds of variables
DogeBot has three kinds. They all use curly brackets, like{this}.
1
Built-in variables
Ready-made. You don’t make these, they’re always there. For example
{user_name} is the name of the person who used the command, and {server} is the server name.See Built-in variables.2
Your own variables (custom variables)
You make these yourself, and the bot remembers them forever, even when it restarts. They always start with
DBVAR_, like {DBVAR_coins}.See Make a variable.3
Short-lived values
Some blocks make a value that only lasts while the command is running. For example a command input called
amount gives you {option_amount}, and a Temporary value block gives you {whatever-you-named-it}. When the command ends, they’re gone.See Short-lived values.How the bot uses them
When your bot runs a block, it first looks for anything in curly brackets and swaps it for what’s in the box. So this:What next?
Make a variable
Step by step.
Use variables in blocks
Save, add, take away and show them.
Lists and objects
Shops, backpacks and settings.
Daily coins
A full example that uses variables.
