Efficient way to handle two different calls for different values of a same variable?

Is there an easy/short way to write the exact same event for multiple values of a variable, without having to write it for each values separately?

Basically, I want to use the same call when the variable = 1,3,5,etc, and a different call when it = 2,4,6,etc.
it depends on what exactly you want to do - and you didn't give any info on that.
It would help a lot if you describe what you want to do (ingame terms) instead of how you want to do it (programming method).

That said, you might try to search for a set of scripts called the "self-data suite", because self-variables might help you here.
It doesn't have any visible impact ingame. It's just a skeleton to implement future events related to those values. But that variable is interlinked with two other variables and switches, and it requires different calls for different values. For some values, though, the call is identical. Rather than writing these calls one by one for each values, I was wondering if there was a way to shorten it.

i.e:
if var = 1,3,5 do this, else if var = 2, 4 do that, else if var = 6,7 do that
rather than
if var = 1 do this, if var = 2 do that, if var = 3 do that, etc.

In other words. Is there a way to do a conditionnal that does something like this: @>Conditionnal branch: Variable [000N:Name] == [1,3,5]?
Use "or" in JS is "|| "for this. In your own example:

@>Conditionnal branch: Variable [000N:Name]==1|| Variable [000N:Name]==3|| Variable [000N:Name] == 5|| etc...
@GuanyuMaker Please note that this is for Ace which uses Ruby not JavaScript.
@GuanyuMaker Please note that this is for Ace which uses Ruby not JavaScript.
I keep doing this! Will pay more atention before posting anything. Said that it should work on ruby too as it is the same operator for both. Or make it easier to read using the operator "or" itself instead of "||". While they are a bit different(priority order) in ruby it works the same way for the case =)
How would I input that, then? I tried writing that in the script box on the Conditional pop-up but ended up with a Syntax error unexpected ':' expected ']'.
For scrpit conditonal should be:
"n" for your variable ID
1,3,5 are the values you want the condition to trigger

Code:
$game_variables[n] == 1 || $game_variables[n] == 3 || $game_variables[n] == 5 || etc
Remove "|| ETC" or put more numbers you want to use.
[1,3,5].include?($game_variables[n])

Use this in a conditional branch. (Script entry)
Thank you very much! This makes everything much easier.

Original thread: https://forums.rpgmakerweb.com/threads/efficient-way-to-handle-two-different-calls-for-different-values-of-a-same-variable.93955/