Table of Contents
π Variables
Variables are like little boxes that store information for your bot. They help bots remember numbers, items, or player progress.
π What is a Variable?
- A variable is a value your bot can keep track of.
- Think of it like a note the bot writes down: βscore = 5β or βcoins = 10.β
- Bots can then check or change that note during interactions.
π§© Types of Variables
There are two main kinds of variables:
* Bot Variables
- Belong to the bot itself.
- Shared across all players who interact with that bot.
- Example: βBot score = 10β (everyone sees the same score).
* Player Variables
- Belong to each individual player.
- Different players can have different values.
- Example: βPlayer coins = 5β (each player has their own coin count).
β Changing Variables
Bots can change variables using actions:
- Set β Give the variable a specific value (e.g., score = 0).
- Increment β Add 1 to the variable (e.g., score becomes 6).
- Decrement β Subtract 1 from the variable (e.g., lives become 2).
- Add/Subtract β Change the variable by a chosen number (e.g., coins +10).
- Random β Set the variable to a random number within a range.
β Checking Variables
Conditions let bots check variables:
- = (equals to) β Is the variable the same as a number?
- > (greater than) β Is the variable bigger than a number?
- < (less than) β Is the variable smaller than a number?
- >= (greater than or equal to) β Is the variable at least a number?
- β (less than or equal to) β Is the variable no more than a number?
Example:
βIf player coins >= 10 β Give ticket.β
Summary
Variables are the memory of your bot. They let bots:
- Keep track of scores, coins, or progress
- Change values during interactions
- Check values to decide what happens next
Use Actions to change variables and Conditions to check them.
