I’m making a simple batch game, and I’m trying to find out how to use the value of a variable with an unknown name. Example:
I dont know the name or the value of the var1 variable, because it is automatically generated at an earlier point in the game.
The only thing I know is the 3rd line: set var3=var2.
I need my game to use the value of “var1” in an if statement like shown in the last line.
How would I do this?
set var1=5
set var2=var1
set var3=var2
if ??? EQU something something...
It took a few edits, but I finally came up with a truly bullet proof option (method 5).
In method 5, if var3 is replaced by a variable name that contains
"then you will have to escape some quotes. But if you are sophisticated enough to put a quote in a variable name then you already know how to do that 🙂