Change a list
Add to, remove from, sort, shuffle or empty a list variable.
data.list changes a variable of the list type, whose items are separated by commas.
Settings
| Setting | What it does |
|---|---|
| List variable | The variable to change. |
| Do | Add items, add items it doesn't have, remove an item, remove the item at a position, take the last item off, sort it, shuffle it, drop repeats, or empty it. |
| Item | What to add (several separated by commas) or remove, or a position: from 1, or -1 for the last. |
Ways out
out. Turn on If it fails for a red way out.
Produces
| Token | Value |
|---|---|
{list.count} | How many items it has now |
{list.item} | What was just removed by position or taken off the end |
Notes
- Runs changing the same list take turns, so two members joining a queue at once both end up on it.
- Removing an item ignores capitals and removes every copy.
- Read the list anywhere as
{var.name}, loop over it with For each item, and test it with is one of in a Comparison. - Items can't contain commas.
Example
A /queue join command adds {user.id} with Add items it doesn't have; /queue next takes the first item off with Remove the item at a position and 1, and pings <@{list.item}>.
Related
- Manipulate text, for list functions that don't change the variable
- Pick at random