Conditions¶
A condition decides which branch of an If step runs. It is a list of rules; the condition holds when all of them hold, or any of them, as you choose. Macros shows how to build one; this page lists what you can put in it.
A rule¶
Each rule has up to three parts, left to right on its row:
- What to check. Pick a variable (such as
{bits}or an earlier step's output), a live value (such as Current scene), or Type a value… to write your own text with{variables}in it. - The comparison, from the list below. The list only offers comparisons that fit what you check.
- What to compare with: a value, a
{variable}, or a choice from a list (scenes, roles) when the app has one.
Not in front of a rule turns it around. Add group adds a nested set of rules with its own all/any, for things like live and (bits ≥ 500 or a moderator). A group can have Not too.
Comparisons¶
Both sides are filled in and trimmed first. Two plain numbers (1000, -2.5) are compared as numbers; anything else is compared as text, ignoring capital letters.
| Comparison | Offered for | Holds when |
|---|---|---|
is / is not (= / ≠ for numbers) |
text, numbers, roles | The two sides are equal (or not). |
| contains | text | The left side contains the right side anywhere. |
| starts with / ends with | text | The left side starts (or ends) with the right side. |
| > / ≥ / < / ≤ | numbers | Both sides are numbers and the left is greater / at least / less / at most. Never holds when either side isn't a number. |
| is one of | text, numbers | The left side equals one of the values on the right, separated by commas: 1000, 2000, 5000. |
| matches pattern | text | The left side matches a regular expression, ignoring capital letters. For power users: ^!so\b. |
| is empty | text | The left side is empty after the variables are filled in. Has no right side. |
| is at least | {user_role} |
The role on the left is the role on the right or higher. |
| is on / is off | yes/no live values | The live value is true (or false). |
The roles in order: everyone < subscriber < vip < moderator < broadcaster. Every run has {user_role}, the role of whoever caused it.
Live values¶
A live value is read from an integration at the moment the rule is checked, so it reflects what is happening right now, not when the event fired. In the What to check list they're grouped as Live · Twitch, Live · OBS Studio and so on.
An integration that isn't connected fails the If step
A rule that reads a live value from an integration that isn't connected (OBS closed, Twitch logged out) usually can't be answered, so the If step fails, and the macro stops unless it is set to Continue on error. The rule editor warns you while the integration is offline. A few values answer anyway: Discord is connected is simply off, and the Steam values say nothing is being played while Steam isn't running.
Yes/no values offer is on and is off. Number values offer =, ≠, >, ≥, <, ≤ and is one of. Text values offer the text comparisons.
Twitch¶
| Live value | Kind | Meaning |
|---|---|---|
| Stream is live | Yes/no | Twitch shows the stream as live. |
| Viewers | Number | Current viewer count; 0 when offline. |
| Minutes live | Number | How long the stream has been live; 0 when offline. |
| Stream title | Text | Your current stream title. |
| Category | Text | The game or category. |
OBS Studio¶
Input is muted asks which audio source.
| Live value | Kind | Asks for | Meaning |
|---|---|---|---|
| Current scene | Text | The scene on air. You can pick the value from your OBS scenes. | |
| Preview scene | Text | The studio mode preview scene; empty when studio mode is off. You can pick the value from your OBS scenes. | |
| Streaming | Yes/no | OBS is streaming. | |
| Recording | Yes/no | OBS is recording. | |
| Replay buffer running | Yes/no | The OBS replay buffer is running. | |
| Virtual camera running | Yes/no | The OBS virtual camera is running. | |
| Studio mode | Yes/no | Studio mode is on. | |
| Input is muted | Yes/no | Audio input, picked from your OBS audio sources | The chosen audio source is muted. |
Steam¶
| Live value | Kind | Meaning |
|---|---|---|
| Playing a Steam game | Yes/no | You are playing a game on Steam. |
| Steam game | Text | The name of the game being played; empty when none. |
| Steam game's app ID | Text | The app ID of the game being played; empty when none. You can pick the value from your Steam games. |
| Hours in the Steam game | Number | Your total hours in the game being played, this session included, with one decimal; 0 when none. |
Discord¶
| Live value | Kind | Meaning |
|---|---|---|
| Discord is connected | Yes/no | The Discord app is running on this computer and CroStream is connected to it. |
| Discord user | Text | The display name of the account signed in to Discord. |
Queues¶
Each asks which queue.
| Live value | Kind | Asks for | Meaning |
|---|---|---|---|
| Items waiting | Number | Queue, picked from your queues | How many items are waiting in a queue. |
| Queue is paused | Yes/no | Queue, picked from your queues | A paused queue holds its items. |
Tools¶
Counter value asks which counter. A counter that doesn't exist yet reads as 0.
| Live value | Kind | Asks for | Meaning |
|---|---|---|---|
| Counter value | Number | Counter, picked from your counters | A counter's value; 0 for a counter that does not exist yet. |
Viewers¶
These read the viewer database. Each asks which viewer: it starts as {user_login}, whoever caused the run, and takes {variables}, so {arg1} checks the person named in a chat command. A viewer CroStream has never seen reads as 0 (and Viewer is known is off).
| Live value | Kind | Asks for | Meaning |
|---|---|---|---|
| Viewer's points | Number | Viewer (starts as {user_login}) |
The viewer's point balance. |
| Viewer's watch time (minutes) | Number | Viewer (starts as {user_login}) |
Minutes the viewer has watched. |
| Viewer's chat messages | Number | Viewer (starts as {user_login}) |
Chat messages the viewer has written. |
| Viewer's bits | Number | Viewer (starts as {user_login}) |
Bits the viewer has cheered. |
| Viewer's gifted subs | Number | Viewer (starts as {user_login}) |
Subs the viewer has gifted. |
| Viewer's sub months | Number | Viewer (starts as {user_login}) |
Months the viewer has subscribed. |
| Viewer's follow age (days) | Number | Viewer (starts as {user_login}) |
Days since the viewer followed; 0 when they do not follow. |
| Viewer's streams | Number | Viewer (starts as {user_login}) |
How many streams the viewer watched or chatted in. |
| Viewer is known | Yes/no | Viewer (starts as {user_login}) |
Whether the viewer is in the database. |
Limits¶
- Groups nest at most 5 deep, and one condition holds at most 50 rules, groups included.
- A pattern (matches pattern) is at most 200 characters as written.
- A live value's argument (a viewer, a counter name) is at most 100 characters.
Related¶
- Macros: building If, Switch and Stop steps.
- Variables: what you can check.
- Make a macro decide: a worked example.