diff --git a/docs/guide/chat-bots.md b/docs/guide/chat-bots.md index 7d3fc522..1e08b2f2 100644 --- a/docs/guide/chat-bots.md +++ b/docs/guide/chat-bots.md @@ -8,17 +8,17 @@ **Minecraft Console Client** has a number of default built in Chat Bots (Scripts/Plugins) which allow for various types of automation. -::: warning +
Warning
**Recently we have changed the configuration format from INI to TOML, this part of the documentation has only been partially updated, it's work in progress, for the time being please refer to the `MinecraftClient.ini` for setting names, the descriptions and options should be up to date in most cases, but not guaranteed.** -::: +Tip
**Settings refer to settings in the [configuration file](configuration.md)** -::: +Tip
+ + **This might not work depending on your system or a console (terminal emulator).** + +Tip
**You need to enable [Terrain Handling](configuration.md#terrainandmovements) in the settings and it's recommended to put the bot into an enclosure not to wander off. (Recommended size 5x5x5)** - ::: +Tip
**This happens on each trigger of the task, so it does not permanently switch to alternative method.** - ::: +Tip
**You need to have [inventoryhandling](configuration.md#inventoryhandling) and [entityhandling](configuration.md#entityhandling) enabled in order for this bot to work.** - ::: +Tip
**You need to have [inventoryhandling](configuration.md#inventoryhandling) enabled in order for basic crafting in the inventory to work, in addition if you want to use a crafting table, you need to enable [terrainandmovements](configuration.md#terrainandmovements) in order for bot to be able to reach the crafting table.** - ::: +Tip
**If you're using `table` you need to set the `CraftingTable` setting.** - ::: +Tip
**If you have a case where you have to leave some fields empty, use `"Null"` to mark them as empty. Example for stone bricks: `Slots = [ "Stone", "Stone", "Null", "Stone", "Stone", "Null", "Null", "Null", "Null", ]`** - ::: +Tip
**All item types can be found [here](https://github.com/MCCTeam/Minecraft-Console-Client/blob/master/MinecraftClient/Inventory/ItemType.cs).** - ::: +Tip
**Make sure to provide materials for your bot by placing them in inventory first.** - ::: +Tip
**You need to have [inventoryhandling](configuration.md#inventoryhandling) and [terrainandmovements](configuration.md#terrainandmovements) enabled in order for this bot to work.** - ::: +Tip
**Since MCC does not yet support accurate calculation of the collision volume of blocks, all blocks are considered as complete cubes when obtaining the position of the lookahead.** - ::: +Tip
**You need to have [inventoryhandling](configuration.md#inventoryhandling) enabled in order for this bot to work** - ::: +Tip
**All item types can be found [here](https://github.com/MCCTeam/Minecraft-Console-Client/blob/master/MinecraftClient/Inventory/ItemType.cs).** - ::: +Tip
**You need to have [inventoryhandling](configuration.md#inventoryhandling) enabled in order for this bot to work** - ::: +Tip
**You need to have [entityhandling](configuration.md#entityhandling) enabled in order for this bot to work.** - ::: +Tip
**To use the automatic rod switching and durability check feature, you need to enable [inventoryhandling](configuration.md#inventoryhandling).** - ::: +Tip
**Note: To adjust the position or angle after catching a fish, you need to enable [terrainandmovements](configuration.md#terrainandmovements).** - ::: +Tip
**A fishing rod with **Mending enchantment** is strongly recommended.** - ::: +Tip
**This might get you banned by the server owners.** - ::: +Warning
**Server admins can spoof PMs (`/tellraw`, `/nick`) so enable `AutoRespond` only if you trust server admins.** - ::: +Warning
**This bot may get spammy depending on your rules, although the global [messagecooldown](configuration.md#messagecooldown) setting can help you avoiding accidental spam.** - ::: +Tip
**This file is not created by default, we recommend making a clone of the [`sample-matches.ini`](https://github.com/MCCTeam/Minecraft-Console-Client/blob/master/MinecraftClient/config/sample-matches.ini) and changing it according to your needs.** - ::: +Tip
**This feature uses the `ยง` symbol for color matching** - ::: +Tip
**The bot can be slow at times, you need to walk with a normal speed and to sometimes stop for it to be able to keep up with you, it's similar to making animals follow you when you're holding food in your hand. This is due to a slow pathfinding algorithm, we're working on getting a better one. You can tweak the update limit and find what works best for you. (NOTE: Do not but a very low one, because you might achieve the opposite, this might clog the thread for terrain handling) and thus slow the bot even more.** - ::: +Tip
**You need to have [terrainandmovements](configuration.md#terrainandmovements) and [entityhandling](configuration.md#entityhandling) enabled in order for this bot to work.** - ::: +Tip
**If the bot does not respond to bot owners, see the [Detecting chat messages](https://github.com/MCCTeam/Minecraft-Console-Client/tree/master/MinecraftClient/config#detecting-chat-messages) section.** - ::: +Tip
**This settings file is for English and is not created by the default** - ::: +Tip
**This settings file is for French and is not created by the default** - ::: +Warning
**The bot identifies players by their name (Not by UUID!). A nickname plugin or a Minecraft rename may cause mails going to the wrong player! Never write something to the bot you wouldn't say in the normal chat (You have been warned!).** - ::: +Warning
**Server admins can spoof PMs (`/tellraw`, `/nick`) so enable `RemoteControl` only if you trust server admins.** - ::: +Warning
**This bot has only been tested on Windows 10, it may not work on Linux or Mac OS due to .NET BitMap API. We're looking forward to swap the underlaying Bitmap API dependency with a library.** - ::: +Tip
**The bigger the size, the less is the quality.** - ::: +Tip
**For upscaling your maps you could use (getting a bit better quality): https://deepai.org/machine-learning-model/torch-srgan** - ::: +Warning
**On some versions older than 1.17 this could cause some performance issue on older hardware if there a lot of maps being rendered, since map updates are sent multiple times a second. Be careful.** - ::: +Warning
**Server admins can spoof PMs (`/tellraw`, `/nick`) so enable `RemoteControl` only if you trust server admins.** - ::: +Warning
**This bot does not work for 1.19, we need maintainers for it.** - ::: +Tip
**Please note that due to technical limitations, the client player (you) will not be shown in the replay file** - ::: +Warning
**You SHOULD use `/replay stop` or exit the program gracefully with `/quit` OR THE REPLAY FILE MAY GET CORRUPT!** - ::: +Tip
**It is recommended that you align subsections to the right by one tab or 4 spaces for better readability.** - ::: +Warning
**Recently we have changed the configuration format from INI to TOML, the documentation had to be updated. If you spot a mistake, please report it on our Discord or in the repository as an issue.** -::: +Tip
**Mojang accounts are going to stop working soon for everyone, they already are not working for some people.** - ::: +Warning
**Admins can impersonate players on versions older than 1.19** - ::: +Tip
**MCC supports only 1.4.6 - 1.19.2** - ::: +Tip
**Force-enabling only works for MC 1.13 +** - ::: +Tip
**For playing on Hypixel you need to use `vanilla`** - ::: +Warning
**This feature is currently not supported in `1.4.6 - 1.6`.** - ::: +Tip
**Sometimes the latest versions might not support this straight away, since Mojang often makes changes to this.** -::: +Warning
**This feature is currently not supported in `1.4.6 - 1.9`.** - ::: +Warning
**This feature is currently not supported in `1.4.6 - 1.9`.** - ::: +Tip
**Sometimes the latest versions might not support this straight away, since Mojang often makes changes to this.** - ::: +Tip
**Only works on Windows XP-8 or Windows 10 with old console** - ::: +Tip
**Make sure the spawn point is safe** - ::: +Warning
**A movement speed higher than 2 may be considered cheating by some plugins.** -::: +Tip
**Not filtering anything by default** - ::: +Tip
**Not filtering anything by default** - ::: +Tip
**%username% and %serverip% will be substituted with your username and the IP address of the server you are connected to. So you can use something like: `console-log-%username%-%serverip%.txt`** - ::: +Tip
**`%username%`, `%serverip%`, `%datetime%` are reserved variables** - ::: +Warning
**Make sure your server rules allow Proxies or VPNs before setting the setting to `true`, or you may face consequences!** - ::: +Tip
**For now this page contains only the bare basics of the Chat Bot API, enough of details to teach you how to make basic Chat Bots. For more details you need to take a look at the [ChatBot.cs](https://github.com/MCCTeam/Minecraft-Console-Client/blob/master/MinecraftClient/Scripting/ChatBot.cs) and [Examples](#examples). This page will be improved in the future.** -::: +Tip
**Here we will use terms Chat Bot and Script interchangeably** -::: +Tip
**Avoid adding whitespace between `//` and keywords** -::: +Tip
**For allocating resources like a database connection, we recommend allocating them in `AfterGameJoined` and freeing them in `OnDisconnect`** -:::. +Warning
**If you already have .NET, but an older version than `6.0`, please update to `6.0` since MCC might not work as expected or at all.** -::: +Tip
**If you're using Linux we will assume that you should be able to install git on your own. If you don't know how, search it up for your distribution, it should be easy. (Debian based distros: `apt install git`, Arch based: `pacman -S git`)** - ::: +Tip
**If you're using Linux that is either ARM, 32-bit, Rhel based, Using Musl, or Tirzen, [find an appropriate RID](https://docs.microsoft.com/en-us/dotnet/core/rid-catalog#linux-rids) for your platform and replace the `'-r linux-64` with an appropriate `-rTip
**If you're not using MAC with Intel, find an appropriate RID for your ARM processor, [find an appropriate RID](https://docs.microsoft.com/en-us/dotnet/core/rid-catalog#macos-rids) and replace the `'-r osx-64` with an appropriate `-rTip
**This section is for more advanced users, if you do not know how to install git or docker, you can take a look at other sections for Git, and search on how to install Docker on your system.** -::: +Warning
**Pay attention at warnings, Docker currently works, but you must start the containers in the interactive mode or MCC will crash, we're working on solving this.** -::: +Danger
**There is a bug with the ConsoleInteractive which causes a crash when a container is started in a headless mode, so you need to use the interactive mode. Do not restart containers in a classic way, stop then and start them with interactive mode (this command), after that simply detach with `CTRL + P` and then `CTRL + Q`.** -::: +Tip
**This section is going to get a bit technical, I'll try my best to make everything as simple as possible. If you are having trouble following along or if you encounter any issues, feel free to open up a discussion on our Github repository page.** -::: +Tip
**You're required to have some bare basic knowledge of Linux, if you do not know anything about it, watch [this video](https://www.youtube.com/watch?v=SkB-eRCzWIU) to get familiar with basic commands.** -::: +Tip
**Here we're installing everything on the root account for simplicity sake, if you want to make a user account, make sure you update the command which reference the `/root` directory with your home directory.** -::: +Warning
**The Play Store version of Termux is outdated and not supported, do not use it, use the the [Github one](https://github.com/termux/termux-app/releases/latest/).** -::: +Tip
**If your file manager does not let you run APK files, install and use `File Manager +` and give it a permission to install 3rd party applications when asked.** -::: +Danger
**Once you have installed Termux, open it, bring down the Android menu for notifications, on Termux notification, drag down until you see the following options: `Exit | Acquire wakelock`, press on the `Acquire wakelock` and allow Termux to have a battery optimization exclusion permission when asked. If you do not do this, your performance will be poorer and the Termux might get killed by Android while running in the background!** -::: +Tip
**If you decide to watch the Youtube tutorial, watch only up to `1:58`, the steps after are not needed and might just confuse you.** -::: +Tip
**If you're asked to press Y/N during the update/upgrade command process, just enter Y and press Enter** -::: +Tip
**Now every time you open Termux after it has been closed, in order to access Ubuntu you have to use this command** -::: +Tip
**This tutorial assumes that you have 64 bit version of ARM processor, if you happen to have a 32-bit version replace the link in the command above with [this one](https://download.visualstudio.microsoft.com/download/pr/cf567026-a29a-41aa-bc3a-e4e1ad0df480/0925d411e8e09e31ba7a39a3eb0e29af/aspnetcore-runtime-6.0.8-linux-arm.tar.gz)** -::: +Tip
**This tutorial assumes that you're following along and using Ubuntu 22.04, if you're using a different distro, like Alpine, go to [here](https://dotnet.microsoft.com/en-us/download/dotnet/6.0) and copy an appropriate link for your distro.** -::: +Warning
**If you're using a different download link, update the file name in this command to match your version.** - ::: +Warning
**Here we're installing .NET in `/root`, if you're installing it somewhere else, make sure to set your own path!** - ::: +Warning
**You will need a basic knowledge of Nano text editor, if you do not know how to use it, watch this [Youtube video tutorial](https://www.youtube.com/watch?v=DLeATFgGM-A)** -::: +Warning
**Here we're installing .NET in `/root`, if you're installing it somewhere else, make sure to set your own path!** -::: +Warning
**If you have a 32 ARM processor, you need to build the MCC yourself, take a look at the [Building From Source](#building-from-the-source-code) section. Also make sure to be using the appropriate `-r` parameter value for your architecture.** -::: +Tip
**This is a new section, if you find a mistake, please report it by opening an Issue in our [Github repository](https://github.com/MCCTeam/Minecraft-Console-Client). Thank you!** -::: +Tip
**Make sure to allow the installation to add it to the context menu** - ::: +Danger
**In this tutorial we will be using `Ubuntu 22.04`, make sure to select it as the OS when buying a VPS.** -::: +Tip
**Does not have Ubuntu 22.04 in the dropdown menu when ordering, you will have to re-install later or ask support to do it.** - ::: +Danger
**This will require you to have a valid debit card that can be used on internet and a mobile phone number, as well as giving that info to Amazon corporation.** -::: +Warning
**Scammers often get AWS VPS and use it to mass login on to stolen Microsoft accounts, some AWS IP addresses might be blocked by Microsoft because of that, if so, you might need to switch regions or to use a Proxy. To debug if your IP has been banned by Microsoft, use the `pingWarning
**Related to the warning above, if you have issues logging with Microsoft and you're not banned, you may want to check the Security center on your account and approve the login from the VPS, this can be the case for some users.** -::: +Tip
**If you're not banned, sometimes fetching the keys can take some time, try giving it a minute or two, if it still hangs, hit some keys to refresh the screen, or try restarting and running again. If it still happens, use tmux instead of screen.** -::: +Tip
**Skip this section if you're not using AWS. Go to [Initial VPS setup](#initial-vps-setup)** -::: +Tip
**Make sure to select the region closest to you for the minimal latency** -::: +Danger
**Make sure that it has `Free tier eligible` next to it.** -::: +Danger
**Make sure that you save this file in a safe place and do not loose it, it's of an upmost importance since it's used to access the root/admin account of the VPS. Without it you will not be able to access the root account of the VPS! Also do not let it fall into wrong hands.** -::: +Tip
**The SSH traffic from Anywhere is not the best thing for security, you might want to enter IP addresses of your devices from which you want to access the VPS manually.** -::: +Tip
**`<` and `>` are not typed, that is just a notation for a placeholder!** -::: +Tip
**`ubuntu` is a default root account username for Ubuntu on AWS!** -::: +Tip
**This section if for those who do not use AWS, if you use AWS skip it** -::: +Tip
**If you're given a custom port other than `22` by your host, you should add `-pTip
**You may be wondering why we're creating a separate user account and making it be accessible over SSH only. This is for security reasons, if you do not want to do this, you're free to skip it, but be careful.** -::: +Tip
**When you're typing a password it will not be displayed on the screen, but you're typing it for real.** -::: +Tip
**Make sure you have a strong password!** -::: +Tip
**If you've changed the `Port`, make sure you add a `-pTip
**If your VPS has an ARM CPU, follow [this](#installing-net-on-arm) part of the documentation and then return to section after this one.** -::: +Warning
**With newer versions of .NET Core 6 on Ubuntu 22.04 you might get the following error: `A fatal error occurred, the folder [/usr/share/dotnet/host/fxr] does not contain any version-numbered child folders`, if you get it, use [this solution](https://github.com/dotnet/sdk/issues/27082#issuecomment-1211143446)** -::: +Tip
**There is also a Docker method, if you're using Docker, you do not need the `screen` program.** -::: +Warning
**If you have issues with Screen command, like output not being properly formatted or program handing/freezing, try using tmux, click [here](https://www.youtube.com/watch?v=Yl7NFenTgIo) to learn how to use it.** -::: +Tip
**`mcc` here is the name of the screen, you can use whatever you like, but if you've used a different name, make sure you use that one instead of the `mcc` in the following commands.** -::: +Tip
**You need to make a screen only once, however if you reboot your VPS, you need to start it on each reboot.** -::: +Tip
**On Windows it's best using [Windows Terminal](https://docs.microsoft.com/en-us/windows/terminal/install) for the best experience and looks. Some features like emojis in the [`/chunk`](#chunk) command do not work in CMD or Powershell 5** -::: +Tip
**On Linux and macOS, you need to type: `./MinecraftClient` instead of `MinecraftClient.exe`** -::: +Tip
**Some commands may not be documented yet or are defined in description of Chat Bots, use `/help` to list them all, or you can contribute to this page.** -::: +Tip
**You need to have [Inventory Handling](configuration.md#inventoryhandling) enabled in order for this to work.** - ::: +Warning
**To use this feature you need to enable the [Terrain and Movements](configuration.md#terrainandmovements)** - ::: +Tip
**You need a terminal with emoji support, like Powershell 7, Windows Terminal or Alacritty, if you do not want emoji support and want to use cmd or powershell 5, disable emojis with: [`enableemoji`](configuration.md#enableemoji)** - ::: +Tip
**You need to have [Inventory Handling](configuration.md#inventoryhandling) enabled in order for this to work.** - ::: +Tip
**All item types can be found [here](https://github.com/MCCTeam/Minecraft-Console-Client/blob/master/MinecraftClient/Inventory/ItemType.cs).** - ::: +Tip
**You need to have [Inventory Handling](configuration.md#inventoryhandling) and [Entity Handling](configuration.md#entityhandling) enabled in order for this to work.** - ::: +Tip
**All entity types can be found [here](https://github.com/MCCTeam/Minecraft-Console-Client/blob/master/MinecraftClient/Mapping/EntityType.cs).** - ::: +Tip
**All local variables are treated as strings in the app, when comparing their values, you can use `Tip
**`[account]` is an account alias defined in accounts file, for more info check out [accountlist](configuration.html#accountlist)** - ::: +Tip
**Some settings won't be reloaded since they are used before the client initialization. Also, settings provided by the command line paramteres will be overriden. This also does not reload the ReplayBot due to technical limitations.** - ::: +Tip
**`Tip
**`[account]` is an account alias defined in accounts file, for more info check out [accountlist](configuration.html#accountlist)** - ::: +Tip
**You need to have [Inventory Handling](configuration.md#inventoryhandling) enabled in order for this to work.** - ::: +Warning
**The [Inventory Handling](configuration.md#inventoryhandling) is currently not supported in `1.4.6 - 1.9`** - ::: +Tip
**You need to have [Inventory Handling](configuration.md#inventoryhandling) and [Terrain and Movements](configuration.md#terrainandmovements) enabled in order for this to work.** - ::: +Tip
**Not all inventories have a GUI representation in an ASCII art format.** - ::: +Warning
**The [Inventory Handling](configuration.md#inventoryhandling) is currently not supported in `1.4.6 - 1.9`.** - ::: +Tip
**This command is avaliable only with [Follow Player](chat-bots.md#follow-player) Chat Bot enabled.** - ::: +Tip
**You need to have [Inventory Handling](configuration.md#inventoryhandling) enabled in order for this to work.** - ::: +Tip
**You need to have [Enity Handling](configuration.md#entityhandling) enabled in order for this to work.** - ::: +Tip
**You need to have [Terrain and Movements](configuration.md#terrainandmovements) enabled in order for this to work.** - ::: +Warning
**The [Terrain and Movements](configuration.md#terrainandmovements) is currently not supported in `1.4.6 - 1.6`.** - ::: +Tip
**You need to have [Inventory Handling](configuration.md#inventoryhandling) enabled in order for this to work.** - ::: +Warning
**The [Inventory Handling](configuration.md#inventoryhandling) is currently not supported in `1.4.6 - 1.9`.** - ::: +Tip
**This command DOES NOT physically open a container (eg. chest), for that you need to use [`useblock`](#useblock) command first.** - ::: +Tip
**player and container can be simplified with p and c accordingly** - ::: +Tip
**The default click is left click** - ::: +Tip
**To drop all items from a slot, you can use: `all`** - ::: +Tip
**To find item types, check out [this list](https://github.com/MCCTeam/Minecraft-Console-Client/blob/master/MinecraftClient/Inventory/ItemType.cs)** - ::: +Tip
**To find item types, check out [this list](https://github.com/MCCTeam/Minecraft-Console-Client/blob/master/MinecraftClient/Inventory/ItemType.cs)** - ::: +Tip
**Use "/send /help" for server help** - ::: +