-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added list-ini-values.sh bash script + updated 'autocomplete.txt'
- Loading branch information
1 parent
697065c
commit 389c7ec
Showing
5 changed files
with
109 additions
and
10 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Extracting *.ini values | ||
|
||
The app ships with an "autocomplete.txt" file that contains all the *.ini sections and keys that can be extracted from the game's executable. | ||
|
||
I made a small bash script for this. All that is needed to update the "autocomplete.txt" file is to run this: | ||
|
||
```bash | ||
$ bash ./list-ini-values.sh --path <path-to-Fallout76> --comma-separated > ./Additional\ files/autocomplete.txt | ||
``` | ||
|
||
You can also list all available *.ini keys in a human readable form: | ||
|
||
```bash | ||
$ bash ./list-ini-values.sh --path <path-to-Fallout76> | ||
``` | ||
|
||
If you want to run this script under Windows, you need either [Cygwin](https://www.cygwin.com/), [Git Bash](https://gitforwindows.org/) (which is often bundled with git anyway), or [WSL2](https://learn.microsoft.com/en-us/windows/wsl/). Pick one. | ||
|
||
Credit goes it u/LinuxVersion on Reddit: | ||
- https://www.reddit.com/r/fo76/comments/om82q0/all_2832_ini_settings_recognized_by_the_game/ | ||
- https://pastebin.com/raw/rxuSq05A |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
#!/bin/bash | ||
|
||
# To run this script on Windows, you require Cygwin, Git Bash, or WSL2. | ||
# For the --path argument, you have to input something like this: | ||
# Cygwin: /cygdrive/c/Program Files (x86)/Steam/steamapps/common/Fallout76/Fallout76.exe | ||
# Git Bash: /c/Program Files (x86)/Steam/steamapps/common/Fallout76/Fallout76.exe | ||
# WSL2: /mnt/c/Program Files (x86)/Steam/steamapps/common/Fallout76/Fallout76.exe | ||
|
||
# Credit: u/LinuxVersion on Reddit | ||
# -> https://www.reddit.com/r/fo76/comments/om82q0/all_2832_ini_settings_recognized_by_the_game/ | ||
# -> https://pastebin.com/raw/rxuSq05A | ||
|
||
function show_help () { | ||
echo "Small bash script to extract *.ini settings from the executable." | ||
echo "" | ||
echo "Usage:" | ||
echo "$ ./list-ini-values.sh --path <path-to-Fallout76.exe>" | ||
echo "" | ||
echo "Options:" | ||
echo " -p or --path <path-to-Fallout76.exe>" | ||
echo " -c or --comma-separated" | ||
echo " -h or --help" | ||
} | ||
|
||
while [[ $# -gt 0 ]]; do | ||
case $1 in | ||
-p|--path) | ||
exe_path="$2" | ||
shift | ||
shift | ||
;; | ||
-c|--comma-separated) | ||
comma_separated=1 | ||
shift | ||
;; | ||
-h|--help|-?) | ||
show_help | ||
exit 0 | ||
;; | ||
--) | ||
shift | ||
;; | ||
-*|--*|*) | ||
echo "Unknown option $1" | ||
exit 1 | ||
;; | ||
esac | ||
done | ||
|
||
if [ $# -ne 0 ]; then | ||
echo "unknown option(s): $@" | ||
exit 1 | ||
fi | ||
|
||
if [ -z "$exe_path" ]; then | ||
show_help | ||
exit 1 | ||
fi | ||
|
||
if [ ! -f "$exe_path" ]; then | ||
echo "The path '$exe_path' does not exist or isn't a file." | ||
exit 1 | ||
fi | ||
|
||
if [ "$comma_separated" = "1" ]; then | ||
grep -a -o "[abcfhirsu][iA-Z][a-zA-Z0-9_]\{2,\}:[A-Z][A-Za-z0-9_]\{2,\}" "$exe_path" | # Grab all strings that look sort of like this: uWorkshopLODRadius:Workshop | ||
sed 's/\(.*[^:]\):\(\w\+\)/\2\n\1/p' | # Separate each *.ini key and section by a newline | ||
sort | # Sort alphabetically | ||
uniq | # Remove duplicates | ||
head -c -1 | # Remove the last trailing newline | ||
tr '\n' ',' # Replace all newlines by comma_separated | ||
else | ||
grep -a -o "[abcfhirsu][iA-Z][a-zA-Z0-9_]\{2,\}:[A-Z][A-Za-z0-9_]\{2,\}" "$exe_path" | # Grab all strings that look sort of like this: uWorkshopLODRadius:Workshop | ||
sed 's/\(.*[^:]\):\(\w\+\)/[\2] \1/p' | # Clean it up: "key:section" -> "[section] key" | ||
sort | # Sort alphabetically | ||
uniq # Remove duplicates | ||
fi |