How to First Define User Defined Variables

What is a good way to pre-set a user defined variables in a such a way that it doesn't reset the defined variable every time you run the script?

For example, I am trying to set up a variable called _SummonDrinks, so I use the set_property command which adds it to my prefs. But, every time I re-run the script it will obviously just re-define the _SummonDrinks to false.

Basically, I just want it to put the variable in the .txt with its default value, but I am not sure how to do this without defining it a first time which would in turn define it every time I run the script, unless I comment it out or something.
 
get_property(prop) returns an empty string if the property doesn't exist, so this should work:
Code:
if (get_property("propertyname"=="")) set_property("propertyname", "default value" );
Although in your example you could just check to see if _SummonDrinks is not True, which would return the desired answer whether it was False or unset.
 
Top