docs: wording, consistency

This commit is contained in:
əlemi 2023-11-20 19:23:11 +01:00
parent eb723f76f5
commit 783a619bae
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -1,5 +1,5 @@
# treepuncher # treepuncher
An hackable headless Minecraft client, built with [aiocraft](https://git.alemi.dev/aiocraft/about) an hackable headless Minecraft client, built with [aiocraft](https://git.alemi.dev/aiocraft/about)
### Features ### Features
* persistent storage * persistent storage
@ -9,14 +9,14 @@ An hackable headless Minecraft client, built with [aiocraft](https://git.alemi.d
* world processing * world processing
## Quick Start ## Quick Start
Treepuncher is still in development and thus not available yet on PyPI, to install it fetch directly from git: `treepuncher` is still in development and thus not available yet on PyPI, to install it fetch directly from git:
* `pip install "git+https://git.alemi.dev/treepuncher@v0.3.0"` * `pip install "git+https://git.alemi.dev/treepuncher@v0.3.0"`
Treepuncher can both be run as a pluggable CLI application or as a library, depending on how much you need to customize its behavior `treepuncher` can both be run as a pluggable CLI application or as a library, depending on how much you need to customize its behaviour
### as an application ### as an application
Treepuncher ships as a standalone CLI application which you can run with `python -m treepuncher` `treepuncher` ships as a standalone CLI application which you can run with `python -m treepuncher`
* create your first addon (a simple chat logger) inside `./addons/chat_logger.py` * create your first addon (for example, a simple chat logger) inside `./addons/chat_logger.py`
```py ```py
from dataclasses import dataclass from dataclasses import dataclass
from treepuncher import Addon, ConfigObject from treepuncher import Addon, ConfigObject
@ -33,7 +33,7 @@ class ChatLogger(Addon):
async def print_chat(event: ChatEvent): async def print_chat(event: ChatEvent):
print(f"{event.user} >> {event.text}) print(f"{event.user} >> {event.text})
``` ```
* create a config file: `my_bot.ini` * create a config file for your session (for example, `my_bot`): `my_bot.ini`
```ini ```ini
[Treepuncher] [Treepuncher]
server = your.server.com server = your.server.com
@ -45,10 +45,11 @@ code = microsoft_auth_code
[ChatLogger] [ChatLogger]
prefix = CHAT |:: prefix = CHAT |::
``` ```
* run the treepuncher client : `python -m treepuncher my_bot` * run the treepuncher client : `python -m treepuncher my_bot` (note that session name must be same as config file, minus `.ini`)
### as a library ### as a library
* instantiate the Treepuncher object under the hood `treepuncher` is just a library and it's possible to invoke it programmatically
* instantiate the `treepuncher` object
```py ```py
from treepuncher import Treepuncher from treepuncher import Treepuncher
@ -73,24 +74,24 @@ client.run()
``` ```
## Authentication ## Authentication
Treepuncher supports both legacy Yggdrasil authentication (with options to override session and auth server) and modern Microsoft OAuth authentication. It will store the auth token inside a session file, to be able to restart without requiring credentials again. `treepuncher` supports both legacy Yggdrasil authentication (with options to override session and auth server) and modern Microsoft OAuth authentication. It will store the auth token inside a session file, to restart without requiring credentials again
To be able to use Microsoft authentication you will need to register an Azure application (see [community](https://wiki.vg/Microsoft_Authentication_Scheme) and [microsoft](https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app) docs on how to do that). to be able to use Microsoft authentication you will need to register an Azure application (see [community](https://wiki.vg/Microsoft_Authentication_Scheme) and [microsoft](https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app) docs on how to do that).
This is a tedious process but can be done just once for many accounts, sadly Microsoft decided that only kids play minecraft and we developers should just suffer... this is a tedious process but can be done just once for many accounts, sadly Microsoft decided that only kids play minecraft and we developers should just suffer...
**Be warned that Microsoft may limit your account if they find your activity suspicious** **be warned that Microsoft may limit your account if they find your activity suspicious**
Once you have your `client_id` and `client_secret` use [this page](https://fantabos.co/msauth) to generate a login code: put in your `client_id` and any state and press `auth`. once you have your `client_id` and `client_secret` use [this page](https://fantabos.co/msauth) to generate a login code: put in your `client_id` and any state and press `auth`.
You will be brought to Microsoft login page, input your credentials, authorize your application and you will be redirected back to the `msauth` page, but now there should be a code in the `auth code` field. you will be brought to Microsoft login page, input your credentials, authorize your application and you will be redirected back to the `msauth` page, but now there should be a code in the `auth code` field
Put this code in your config and you're good to go! put this code in your config and you're good to go!
If you'd rather use classic Yggdrasil authentication, consider [ftbsc yggdrasil](https://yggdrasil.fantabos.co) ([src](https://git.fantabos.co/yggdrasil)) if you'd rather use classic Yggdrasil authentication, consider [ftbsc yggdrasil](https://yggdrasil.fantabos.co) ([src](https://git.fantabos.co/yggdrasil))
Legacy Yggdrasil authentication supports both an hardcoded password or a pre-authorized access token legacy Yggdrasil authentication supports both an hardcoded password or a pre-authorized access token
## Contributing ## Contributing
Development is managed by [ftbsc](https://fantabos.co), mostly on [our git](https://git.fantabos.co). If you'd like to contribute, get in contact with any of us using any available form. development is managed by [ftbsc](https://fantabos.co), mostly on [our git](https://git.fantabos.co). If you'd like to contribute, get in contact with any of us using any available form