Script configurations are usually just a number of constants or methods defined in a specific section of the script (typically near the top).
They allow users to customize your script without having to modify the script itself.
It also allows for better code because you will likely repeat yourself less throughout your own code since instead of hardcoding values you simply use a variable.
# Change this switch as neededSwitch_ID = 5 Regex = /<some[-_ ]regex>/Sometimes, you might be working with more complex syntax like arrays or hashes or even structs depending on your preferences
Configurations are not necessarily code. They may be simply data that will be parsed. You might choose to reference an external file that will hold the data because things like spreadsheet programs are much better at maintaining tables in CSV files than an array or hash of arraysWhat are some of the best configurations you've seen?
They allow users to customize your script without having to modify the script itself.
It also allows for better code because you will likely repeat yourself less throughout your own code since instead of hardcoding values you simply use a variable.
# Change this switch as neededSwitch_ID = 5 Regex = /<some[-_ ]regex>/Sometimes, you might be working with more complex syntax like arrays or hashes or even structs depending on your preferences
Code:
equip_types = [ :axe, :sword, :wand,]