From 97f2069f339b617233660850c83d4fc81606f916 Mon Sep 17 00:00:00 2001 From: theenoro Date: Wed, 3 Aug 2022 09:39:04 +0200 Subject: [PATCH] added starbound modupdater --- README.md | 5 ++- .../updater/starbound_modupdater/README.md | 18 ++++++++++ .../updater/starbound_modupdater/config.yaml | 6 ++++ .../starbound_modupdater.py | 35 +++++++++++++++++++ 4 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 universally/updater/starbound_modupdater/README.md create mode 100644 universally/updater/starbound_modupdater/config.yaml create mode 100644 universally/updater/starbound_modupdater/starbound_modupdater.py diff --git a/README.md b/README.md index 0798710..35f4465 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,9 @@ Short scripts for everything ---- +- Universally + - Updater + - [starbound_modupdater (python)](./universally/updater/starbound_modupdater/README.md) - Windows - Network - - [ping_logger](./windows/network/ping_logger/index.md) \ No newline at end of file + - [ping_logger (cmd)](./windows/network/ping_logger/index.md) \ No newline at end of file diff --git a/universally/updater/starbound_modupdater/README.md b/universally/updater/starbound_modupdater/README.md new file mode 100644 index 0000000..862fae8 --- /dev/null +++ b/universally/updater/starbound_modupdater/README.md @@ -0,0 +1,18 @@ +# starbound_modupdater + + +In the `config.yaml` you only have to change the `account` value and the `mods`. The `mods` only need the mod ids from steam. + +```yaml +account: STEAMACC +game: 211820 +modsfolder: ./mods/ +mods: + - MOD IDs +``` + +The script could be adapted to fit other games. + +Files: +- [config.yaml](./config.yaml) +- [starbound_modupdater.py](./starbound_modupdater.py) \ No newline at end of file diff --git a/universally/updater/starbound_modupdater/config.yaml b/universally/updater/starbound_modupdater/config.yaml new file mode 100644 index 0000000..685cb0b --- /dev/null +++ b/universally/updater/starbound_modupdater/config.yaml @@ -0,0 +1,6 @@ +account: STEAMACC +game: 211820 +modsfolder: ./mods/ +mods: + - 729480149 + - MOD IDs \ No newline at end of file diff --git a/universally/updater/starbound_modupdater/starbound_modupdater.py b/universally/updater/starbound_modupdater/starbound_modupdater.py new file mode 100644 index 0000000..f03d76f --- /dev/null +++ b/universally/updater/starbound_modupdater/starbound_modupdater.py @@ -0,0 +1,35 @@ +#/bin/python3.6 +import json +from yaml import load, dump +try: + from yaml import CLoader as Loader, CDumper as Dumper +except ImportError: + from yaml import Loader, Dumper + + +# ------------------------------------------- + + + +f = open("./config.yaml", "r") + +config = load(f, Loader=Loader) + +commandBuilder = "" + +dic = { + 'assetDirectories':[ + + ], + "storageDirectory" : "../storage/" +} + +for mod in config["mods"]: + commandBuilder += " +workshop_download_item "+str(config["game"])+" "+str(mod)+" " + dic["assetDirectories"].append("../mods/"+str(mod)+"/"); + +print(commandBuilder) + + +with open('data.json', 'w', encoding='utf-8') as f: + json.dump(dic, f, ensure_ascii=False, indent=4) \ No newline at end of file