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?
this action checks whether something is true or false, then decides whether the rest of the actions should continue.
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:
False → the comparison did not match
You can then use that result to either:
- let the next actions continue
- stop the action flow completely
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.
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.
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.
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.
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.
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 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:
can mean:
Your First Real Example
Only let logged-in users open the Downloads page
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:
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.
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.
2. Check if the selected plan is Premium
- 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
- 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.
Not Equals
Use this when you want to continue only if the value is different.
Contains
Use this when you want to check whether part of a value exists inside the variable.
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.
Less Than
Also useful for numeric checks.
Is Empty
Use this when you want to know whether the variable has nothing in it.
Is Not Empty
Use this when you just want to know whether something exists.
Understanding Negate
Negate is easy to overthink. All it does is flip the answer.
If the comparison says false, Negate makes it true.
This is handy when the condition you want is the opposite of the normal one.
That effectively becomes:
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
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
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
Show premium panel
Change page
Conditional launcher start chain
Compare patch_required → Not Equals → 1 → Halt if Negative On
Launch local file
Settings-based UI chain
Show advanced settings group
Mistakes New Users Make
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
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.
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.