Compare a Variable


Compare a Variable Dev-Only

Compare a Variable is one of the most powerful actions in the entire launcher. It lets your launcher make decisions.

Without it, your launcher can only do things in a straight line. With it, your launcher can start asking questions like:

  • Is the user logged in?
  • Does this variable contain the right value?
  • Is a text box empty?
  • Is the selected option equal to Premium?
  • Should the launcher continue, or stop here?
In plain English:
this action checks whether something is true or false, then decides whether the rest of the actions should continue.
Pro Tip

If you want your launcher to behave differently depending on user input, saved values, account status, settings, or conditions, this is the action that makes it possible.


What This Action Actually Does

Compare a Variable reads the value of a variable, compares it against a rule, and then gives a result:

True → the comparison matched
False → the comparison did not match

You can then use that result to either:

  • let the next actions continue
  • stop the action flow completely
Simple example:

Check if user_logged_in equals 1.
If it does, continue.
If it does not, stop the rest of the actions.

Why It Matters

This action is what turns your launcher from a simple interface into a real logic system.

Without Compare a Variable Every click does the same thing every time.
With Compare a Variable Your launcher can react differently depending on what is happening.

That means you can build:

  • login checks
  • premium access checks
  • empty field validation
  • conditional page changes
  • settings-based behaviour
  • branching action flows

The Parameters

The Compare a Variable action uses a few simple fields. Once you understand these, the action becomes much easier to use.

Variable Name

This is the variable you want to check.

Example username
user_role
selected_plan
login_token

Condition

This is the rule used to compare the variable.

Depending on what you want to do, common conditions include:

  • Equals – exact match
  • Not Equals – anything except that value
  • Contains – the value includes some text
  • Greater Than – useful for numbers
  • Less Than – useful for numbers
  • Is Empty – nothing is stored
  • Is Not Empty – something exists

Value To Compare

This is the value you are comparing against.

Example Check if user_role equals developer

Some conditions, such as Is Empty or Is Not Empty, may not need a value here.

Negate

This flips the result.

So if the comparison would normally return true, negating it makes it false. If it would normally return false, negating it makes it true.

This is useful when you want to reverse a condition without rewriting the whole logic.

Halt if Negative

This is the important one.

If enabled, and the final result is false, the launcher stops running any further actions in that chain.

This is what gives the action its real power.
It lets you create “if this is not true, stop here” logic.

How To Think About It

The easiest way to understand this action is to think of it like a security guard.

The variable is what the guard checks.
The condition is the rule.
The value is what the guard expects.
Halt if Negative means “do not let anything else through if this fails.”

So a flow like this:

Compare a Variable → Change Page → Show Objects → Play Sound

can mean:

“Only do all of this if the variable passed the check.”

Your First Real Example

Only let logged-in users open the Downloads page

Goal Only open page 5 if the user is logged in.

Let’s say you already have a variable called user_logged_in. It stores:

  • 1 when logged in
  • 0 when not logged in

Your action chain would look like this:

1. Compare a Variable
2. Change Page

Configure the compare action like this:

  • Variable Name: user_logged_in
  • Condition: Equals
  • Value To Compare: 1
  • Negate: Off
  • Halt if Negative: On

Then place Change Page directly after it.

Result:

  • If the value is 1, the page change happens
  • If the value is anything else, the chain stops and the page never opens

Beginner Examples

1. Check if a text field is empty

This is perfect for login forms, search boxes, and registration pages.

Goal Stop the login process if the username field is empty.

First, use Push to Variable to push the input value into a variable, such as login_email.

Then configure Compare a Variable like this:

  • Variable Name: login_email
  • Condition: Is Empty
  • Value To Compare: leave blank
  • Negate: Off
  • Halt if Negative: Off

After that, you can show an error label or warning.

Tip: if you want the rest of the login chain to stop unless the field has a value, use Is Not Empty with Halt if Negative turned on.

2. Check if the selected plan is Premium

Goal Show premium-only objects if the user picked the Premium plan.
  • Variable Name: selected_plan
  • Condition: Equals
  • Value To Compare: premium
  • Negate: Off
  • Halt if Negative: On

Then place Show Objects underneath it.

3. Check whether a token exists

Goal Only try auto-login if a saved token actually exists.
  • Variable Name: login_token
  • Condition: Is Not Empty
  • Value To Compare: leave blank
  • Negate: Off
  • Halt if Negative: On

This is one of the cleanest real-world uses for this action.


Using Different Conditions

Equals

Use this when the variable must match exactly.

Example user_role equals admin

Not Equals

Use this when you want to continue only if the value is different.

Example maintenance_mode not equals 1

Contains

Use this when you want to check whether part of a value exists inside the variable.

Example owned_products contains plugin_discord

This is great when a variable stores a bigger block of text, JSON text, or a comma-separated list.

Greater Than

Use this for numeric checks.

Example download_count greater than 0

Less Than

Also useful for numeric checks.

Example age_gate less than 18

Is Empty

Use this when you want to know whether the variable has nothing in it.

Example promo_code is empty

Is Not Empty

Use this when you just want to know whether something exists.

Example avatar_url is not empty

Understanding Negate

Negate is easy to overthink. All it does is flip the answer.

If the comparison says true, Negate makes it false.
If the comparison says false, Negate makes it true.

This is handy when the condition you want is the opposite of the normal one.

Example Check whether selected_region equals EU, but negate the result.

That effectively becomes:

“Continue only if the region is not EU.”

You could also achieve this using Not Equals, but Negate is still useful in more complex setups.


Understanding Halt if Negative

This is the setting that turns Compare a Variable into a real control action.

When Halt if Negative is enabled:

  • if the check passes, the next action runs
  • if the check fails, everything after it stops
Example Action chain:

Compare a Variable
Show Objects
Change Page
Play Sound

If the comparison fails and Halt if Negative is on, none of those later actions happen.

This makes the action perfect for:

  • access control
  • validation checks
  • blocking incorrect input
  • preventing actions from running when conditions are not met

Real-World Examples

1. Block access to a premium page

Let’s say you store the user’s plan in account_plan.

  • Variable Name: account_plan
  • Condition: Equals
  • Value To Compare: developer
  • Halt if Negative: On

Then place Change Page underneath it.

Result: only Developer users reach that page.

2. Only show a warning if a field is empty

Push the field value into a variable first, then:

  • Variable Name: email_input
  • Condition: Is Empty
  • Halt if Negative: Off

After that:

  • Show warning label
  • Play error sound

In this setup, the compare action is not blocking the chain. It is being used as a check before a warning sequence.

3. Only continue if the downloads list is not empty

After fetching downloads, store the result or count in a variable.

  • Variable Name: download_count
  • Condition: Greater Than
  • Value To Compare: 0
  • Halt if Negative: On

Then show the downloads page or list objects.

4. Check if a product is owned

If you store product data in a variable, use Contains.

  • Variable Name: owned_products
  • Condition: Contains
  • Value To Compare: minecraft_plugin
  • Halt if Negative: On

Then show the Minecraft tools section only if it matches.

5. Stop launch unless a file path exists

If you store a detected install folder in a variable:

  • Variable Name: install_path
  • Condition: Is Not Empty
  • Halt if Negative: On

Then place your launch action underneath it.

Result: the launcher only tries to start the game if the path is there.


Example Chains You Can Build

Login validation chain

Push username input to variable
Compare username variable → Is Not Empty → Halt if Negative On
Push password input to variable
Compare password variable → Is Not Empty → Halt if Negative On
Run login action

Premium access chain

Compare account_plan → Equals → developer → Halt if Negative On
Show premium panel
Change page

Conditional launcher start chain

Compare install_path → Is Not Empty → Halt if Negative On
Compare patch_required → Not Equals → 1 → Halt if Negative On
Launch local file

Settings-based UI chain

Compare theme_mode → Equals → advanced → Halt if Negative On
Show advanced settings group

Mistakes New Users Make

Forgetting to fill the variable first Compare a Variable only checks what is already stored. If nothing was pushed into that variable, the result may not be what you expect.
Using the wrong condition Using Equals when you really need Contains is a very common mistake.
Expecting it to “do” something visible This action checks logic. It does not change the UI on its own unless other actions follow it.
Forgetting Halt if Negative If you want the chain to stop on failure, this must be enabled.

Best Practices

  • Use clear variable names like user_logged_in, selected_plan, or install_path
  • Use Is Empty and Is Not Empty often for validation
  • Use Contains for larger strings or product lists
  • Use Greater Than and Less Than only for real numeric checks
  • Turn on Halt if Negative when you want this action to block the rest of the chain
  • Keep your compare actions near the top of the action list so they filter the flow early

Advanced Notes

For more advanced users, Compare a Variable is essentially your gatekeeper action. It allows you to create branching logic inside a linear action system.

In practice, that means you can build conditional behaviour without writing traditional code:

  • simulate “if this, then continue” logic
  • protect actions behind validation checks
  • control access to pages, panels, and features
  • combine it with variables, JSON actions, and login actions for much more advanced systems
In other words:
this action is the moment your launcher stops being a static interface and starts behaving like a real application.

Final Thoughts

If you only learn one advanced action properly, make it this one.

Once you understand how to compare a variable, check the result, and decide whether the launcher should continue, the rest of the logic system becomes much easier to understand.

Pro Tip

A very good next step after this is learning Push to Variable and Set Object Property from Variable, because those actions pair perfectly with Compare a Variable.