If / Else

Perform conditional logic based on variable contents
Preview
Preview

Parameters

Inputrequired
Text

The value to be tested. Performs full parsing of %arguments%, ~persistedGlobals~ and $inlineFunctions()$

Unlike earlier version of Streamer.bot, arguments must be enclosed in %...% in order for their values to be tested. If using Does Not Exist, then just use the argument name, without the %.
Operatorrequired
Select
default:Equals

Choose the type of test to perform on the selected variable

  • Equals: Check if the variable equals a given value
  • Not Equals: Check if the variable does not equal a given value
  • Contains: Check if the variable contains the given value
  • Regex Match: Use a Regular Expression to match variable contents
  • Less Than: Check if a numeric variable is less than a given value (does NOT include the set value)
  • Greater Than: Check if a numeric variable is greater than a given value (does NOT include the set value)
  • Does Not Exist: Check if the variable name is defined at all
  • Equals (Ignore Case): Check if a string variable equals a given value, case insensitive
  • Not Equals (Ignore Case): Check if a string variable does not equal a given value, case insensitive
  • Is Null or Empty: Check if a variable is Null or empty
Regular Expressions (RegEx) are extremely powerful!
You can use tools like regex101 and RegExr to view and test your expressions.
Auto Type
Toggle
default:true

Without Auto Type, values are treated as text, or string variables, which may result in surprising results like "15" being Less Than "2"

Enable Auto Type to automatically determine the type for the variable value. This is usually what you want, unless you are deliberately performing lexicographic (alphabetical) comparison on text which might happen to contain numbers.

For example:

  • 0 can be auto-typed to a numeric type such as int or long
  • true or false can be auto-typed to a bool
Valuerequired
Text

Enter the value you would like to use for comparison.

This field is parsed, so may contain other %arguments%, ~persistedGlobals~ and $inlineFunctions()$