Minecraft-Console-Client/MinecraftClient/config/README.md

424 lines
19 KiB
Markdown
Raw Normal View History

Minecraft Console Client User Manual
======
**Thanks for dowloading Minecraft Console Client!**
Minecraft Console Client is a lightweight app able to connect to any minecraft server,
both offline and online mode. It enables you to send commands and receive text messages
in a fast and easy way without having to open the main Minecraft game.
How to use
------
First, extract the archive if not already extracted.
On Windows, simply open MinecraftClient.exe by double-clicking on it.
On Mac or Linux you need to install the Mono Runtime:
- On Mac: http://www.mono-project.com/download/#download-mac
- On Linux: sudo apt-get install mono-runtime libmono-reflection-cil
Then, open a terminal in this folder and run "mono MinecraftClient.exe".
If you cannot authenticate on Mono, you'll need to run "mozroots --import --ask-remove" once.
If Mono crashes, retry with mono-complete instead of mono-runtime. Use at least Mono v4.0.
Using Configuration files & Enabling bots
------
Simply open the INI configuration file with a text editor and change the values.
To enable a bot change the "enabled" value in the INI file from "false" to "true".
You will still be able to send and receive chat messages when a bot is loaded.
You can remove or comment some lines from the INI file to use the default values instead.
You can have several INI files and drag & drop one of them over MinecraftClient.exe
Command-line usage
------
**MinecraftClient.exe username password server:**
This will automatically connect you to the chosen server.
To specify a server and ask password interactively, use "" as password.
To specify offline mode with no password, use "-" as password.
**MinecraftClient.exe username password server "/mycommand":**
This will automatically send "/mycommand" to the server and close.
To send several commands and maybe stay connected, use the Scripting bot instead.
**MinecraftClient.exe myconfig.ini:**
This will load the specified configuration file
If the file contains login / password / server ip, it will automatically connect.
**MinecraftClient.exe myconfig.ini othername otherpassword otherIP:**
Load the specified configuration file and override some settings from the file.
Internal commands
------
These commands can be performed from the chat prompt, scripts or remote control.
From chat prompt, commands must by default be prepended with a slash, eg. /quit
In scripts and remote control, no slash is needed to perform the command.
- quit or exit: disconnect from the server and close the application
- reco [account] : disconnect and reconnect to the server
- connect <server> [account] : go to the given server and resume the script
- script <script name\> : run a script containing a list of commands
- send <text> : send a message or a command to the server
- respawn : Use this to respawn if you are dead (like clicking "respawn" ingame)
- log <text> : display some text in the console (useful for scripts)
- list : list players logged in to the server (uses tab list info sent by server)
- set varname=value : set a value which can be used as %varname% in further commands
2015-01-31 11:21:06 +01:00
- wait <time> : wait X ticks (10 ticks = ~1 second. Only for scripts)
2016-03-21 10:22:05 +01:00
- move : used for moving when terrain and movements feature is enabled
- look : used for looking at direction when terrain and movements is enabled
- debug : toggle debug messages, useful for chatbot developers
- help : show command help. Tip: Use "/send /help" for server help
[account] is an account alias defined in accounts file, read more below.
<server> is either a server IP or a server alias defined in servers file
Servers and Accounts file
------
These two files can be used to store info about accounts and server, and give them aliases.
The purpose of this is to give them an easy-to-remember alias and to avoid typing account passwords.
As what you are typing can be read by the server admin if using the remote control feature,
using aliases is really important for privacy and for safely switching between accounts.
To use these files, simply take a look at sample-accounts.txt and sample-servers.txt.
Once you have created your files, fill the 'accountlist' and 'serverlist' fields in INI file.
Interacting with the Minecraft world
------
2016-03-21 10:22:05 +01:00
By default, Minecraft Console Client cannot interact with the world around you.
However for some versions of the game you can enable the terrainandmovements setting.
This feature will allow you to properly fall on ground, pickup items and move around.
There is a C# API for reading terrain data around the player and moving from C# scripts.
Please note that this requires much more RAM to store all the terrain data, a bit more CPU
to process all of this, and slightly more bandwidth as locations updates are
sent back to the server in a spammy way (that's how Minecraft works).
2016-03-21 10:22:05 +01:00
How to write a script file
------
A script file can be launched by using /script <filename> in the client's command prompt.
The client will automatically look for your script in the current directory or "scripts" subfolder.
If the file extension is .txt or .cs, you may omit it and the client will still find the script.
Regarding the script file, it is a text file with one instruction per line.
Any line beginning with "#" is ignored and treated as a comment.
Allowed instructions are given in "Internal commands" section.
Application variables defined using the 'set' command or [AppVars] INI section can be used.
2020-06-07 23:07:58 -04:00
The following read-only variables can also be used: %username%, %login%, %serverip%, %serverport%
How to write a C# script
------
2016-03-21 10:22:05 +01:00
If you are experienced with C#, you may also write a C# script.
That's a bit more involved, but way more powerful than regular scripts.
You can look at the provided sample C# scripts for getting started.
2016-03-21 10:22:05 +01:00
C# scripts can be used for creating your own ChatBot without recompiling the whole project.
2016-03-21 10:22:05 +01:00
These bots are embedded in a script file, which is compiled and loaded on the fly.
ChatBots can access plugin channels for communicating with some server plugins.
2016-03-21 10:22:05 +01:00
For knowing everything the API has to offer, you can look at CSharpRunner.cs and ChatBot.cs.
The latest version for these files can be found on the GitHub repository.
The structure of the C# file must be like this:
```csharp
//MCCScript 1.0
MCC.LoadBot(<instance of your class which extends the ChatBot class>);
//MCCScript Extensions
<your class code here>
```
The first line always needs to be "//MCCScript 1.0" comment, as the program requires it to determine the version of the script.
Everything between "//MCCScript 1.0" and "//MCCScript Extensions" comments will be treated as code, that part of the code will be inserted into the constructor during the compile time.
You can include C# libraries/namespaces using the following syntax: //using <name>;
Example: //using System.Net;
Using HTTP/Socks proxies
------
If you are on a restricted network you might want to use some HTTP or SOCKS proxies.
To do so, find a proxy, enable proxying in INI file and fill in the relevant settings.
Proxies with username/password authentication are supported but have not been tested.
Not every proxy will work for playing Minecraft, because of port 80/443 web browsing restrictions.
However you can choose to use a proxy for login only, most proxies should work in this mode.
Connecting to servers when ping is disabled
------
On some servers, the server list ping feature has been disabled, which prevents Minecraft Console Client
from pinging the server to determine the Minecraft version to use. To connect to this kind of servers,
find out which Minecraft version is running on the server, and fill in the 'mcversion' field in INI file.
This will disable the ping step while connecting, but requires you to manually provide the version to use.
Recent versions of Minecraft Console Client may also prompt you for MC version in case of ping failure.
About translation files
------
When connecting to 1.6+ servers, you will need a translation file to display properly some chat messages.
These files describe how some messages should be printed depending on your preferred language.
The client will automatically load en_GB.lang from your Minecraft folder if Minecraft is installed on your
computer, or download it from Mojang's servers. You may choose another language in the configuration file.
Detecting chat messages
------
Minecraft Console Client can parse messages from the server in order to detect private and public messages.
This is useful for reacting to messages eg when using the AutoRespond, Hangman game, or RemoteControl bots.
However, for unusual chat formats, so you may need to tinker with the ChatFormat section of the config file.
Building regular expressions can be a bit tricky, so you might want to try them out eg on regex101.com
About Replay Mod feature
------
Replay Mod is _A Minecraft Mod to record, relive and share your experience._ You can see more at https://www.replaymod.com/
MCC support recording and saving your game to a file which can be used by Replay Mod. You can simply enable ReplayMod in the `.ini` setting to use this feature. The only limitation is the client player (you) will not be shown in the replay. Please be reminded that you MUST exit MCC with `/quit` command or use `/replay stop` command before closing MCC. Your replay will be lost if you force-closed MCC (i.e. Ctrl+C).
Using the Alerts bot
------
Write in alerts.txt the words you want the console to beep/alert you on.
Write in alerts-exclude.txt the words you want NOT to be alerted on.
For example write Yourname in alerts and <Yourname> in alerts-exclude.txt
Using the AutoRelog bot
------
Write in kickmessages.txt some words, such as "Restarting" for example.
If the kick message contains one of them, you will automatically be re-connected.
A kick message "Connection has been lost." is generated by the console itself when connection is lost.
A kick message "Login failed." is generated the same way when it failed to login to the server.
A kick message "Failed to ping this IP." is generated when it failed to ping the server.
You can use them for reconnecting when connection is lost or the login failed.
If you want to always reconnect, set ignorekickmessage=true in MinecraftClient.ini. Use at own risk!
Using the Script Scheduler
------
The script scheduler allows you to perform scripts on various events.
Simply enable the ScriptScheduler bot and specify a tasks file in your INI file.
Please read sample-tasks.ini for learning how to make your own task file.
Using the hangman game
------
Use "/tell <bot username> start" to start the game.
Don't forget to add your username in botowners INI setting if you want it to obey.
Edit the provided configuration files to customize the words and the bot owners.
If it doesn't respond to bot owners, read the "Detecting chat messages" section.
Using the Remote Control
------
When the remote control bot is enabled, you can send commands to your bot using whispers.
Don't forget to add your username in botowners INI setting if you want it to obey.
If it doesn't respond to bot owners, read the "Detecting chat messages" section.
Please note that server admins can read what you type and output from the bot.
They can also impersonate bot owners with /nick. See [#1142](https://github.com/ORelio/Minecraft-Console-Client/issues/1142) for more info.
To perform a command simply do the following: /tell <yourbot> <thecommand>
Where <thecommand> is an internal command as described in "Internal commands" section.
You can remotely send chat messages or commands using /tell <yourbot> send <thetext>
Remote control system can by default auto-accept /tpa and /tpahere requests from the bot owners.
Auto-accept can be disabled or extended to requests from anyone in remote control configuration.
Using the AutoRespond feature
------
2015-10-11 19:55:26 +02:00
The AutoRespond bot allows you to automatically react on specific chat messages or server announcements.
You can use either a string to detect in chat messages, or an advanced regular expression.
For more information about how to define match rules, please refer to sample-matches.ini
2020-03-26 15:01:42 +08:00
Using the Auto Attack
------
2020-03-26 16:50:52 +08:00
The AutoAttack bot allows you to automatically attack mobs around you (precisely within radius of 4 block).
2020-03-26 15:01:42 +08:00
To use this bot, you will need to enable **Entity Handling** in the config file first.
Using the Auto Fishing
------
The AutoFish bot can automatically fish for you.
To use this bot, you will need to enable **Entity Handling** in the config file first.
If you want to get an alert message when the fishing rod was broken, enable **Inventory Handling** in the config file.
A fishing rod with **Mending enchantment** is strongly recommended.
Steps for using this bot:
1. Hold a fishing rod and aim towards the sea before login with MCC
2. Make sure AutoFish is enabled in config file
3. Login with MCC
4. Do `/useitem` and you should see "threw a fishing rod"
5. To stop fishing, do `/useitem` again
2020-03-26 15:01:42 +08:00
Add Mailer bot (#1108) * Update for the mail script. As requested, I added the synchronization between the config debugmessage bool and the one in the script. Furthermore, I added a way to send anonymous mails by writing "tellonym". The messages are saved as normal mails, which lets them count to the mail cap, due to the fact that the host knows the sender. I added the script to the chat bots because of the problems, that the scripts have with serialization. Instead of rewriting the whole serialization part, my idea was to add the script to the other chat bots, to avoid the compiling issues. Then the serialization would work perfectly fine. Then you could remove the option class at some point and move all the settings to the config file with the addition to activate the whole script. * Correction of debug message loading. The object was missing and the change would be overridden a few lines later. * Update McClient.cs * Add Mail to config file * Correcting the safe file. * Small correction of Settings.c * Update Mailscript Added a failsafe version of the path changing commands. If a path could not be found, an error will be created and the path will be reseted to standart, to avoid endless chains of errors. * Fix for the mail script Removed a wrong option call. Removed the debug_msg condition around the path functions. => Users are aware of what happened (if they see the error) although they turned off debug_msg. * Added some features. Added a try statement to all number changing commands. Added a command to list all moderators to the console. * Serialization Fix There was a chance, that if two bots work on one file, and two users send messages in a short time period, that one bot deserializes the message and then the other bot deserialize the same file, before the other one could save its changes. This would lead to one message disappearing, because one bot never deserialized this message. For this I changed the whole serialization process. All changes are now committed after the interval and not after an incoming mail command directly. All mails are safed temporarily in cache and get serialized after the interval. Due to this changes, you can determit when the individual bot changes the file (there are no more direct interactions with the file after a command, which lead to a certain randomness). Furthermore you can now set an interval of e.g. 2 mins and reset the interval of one bot with "resettimer" after one minute so that the bots won't disturb eachother and no files get lost. * My idea of a manual. This is my idea of a manual for the bot. Improvements of my language / further ideas are welcome! :D * addIgnored [NAME] and removeIgnored[NAME] Added an ignored list. Moderators can add players to the list. The bot won't react to them and just log to the console that they are ignored, everytime they are sending a message, to ensure that they are not accidently ignored. (Just if debug_msg is active.) Especially useful if there are other chat bots on the server, which spam many messages that aren't useful for the mail system. Or block spammers etc. * Add the three commands to the manual. Added addignored, removeignored and getignored to the manual. * Remove moderators. Implement Console Control. Due to security concerns, I converted all moderator commands to console internal commands. Thereby only the host can change crucial settings. Special thanks to ORelio for the hint! * Added empty statement check Added if to all commands, where the syntax is not already protected by a try, so that an incorrect syntax (Empty args[] due to missing statement) won't crash the script. * Changed the serialization fail If the programm can't safe the file, because of some strange character for instance, it first tries to change the path back to normal and if this not helps, it creates a new, file. * toggle mail sending/receiving Add an option to turn mailsending and the listening to commands in chat on/off. * Updated manual. - Removed moderator commands. - Removed moderator part in the network manual + added the two new commands + added a waring for nick plugins and minecraft renames + added a small syntax example * Updated the Settings.cs file. * Smaller fixes and additions + improved command reading of 'mail' & 'tellonym' + sorted internal commands alphabetically + host can set a maximum message length + host can accept commands from public chat + host can decide if 'self mailing' (mailing yourself) is accepted + new order makes 'getsettings' easier to read + new internal commands to toggle 'publiccommands' and 'selfmailing' as well as the maximum mail size - removed the old command interpreter * Small improvements and additions Added a few commands and settings * Completing getsettings + added 'publiccomands' * Completed getsettings + Added 'publiccommand' to 'getsettings' * Removed single bolean, added Dictionary - removed all boleans in the option class - removed all functions relating them + added Dictionary for the booleans + added a single function to set/toggle all booleans * Removed Commands, added interpreter - Removed all Register commands - removed all integer methods + added a single mail command + added integer dictionary + added integer handling similar like bool handling * Small fix + Changed the numbers in several methods to adjust them to the new syntax. - removed parameters in several methods, because they got unneccesary * Even smaller fix + Sorted 'getsettings' alphabetically + corrected a typo * New Serialization method. Now serializing through the .INI format! Thanks to ORelio, who helped me a lot! :) * Added different time Added the option to switch between utc and the time of the local machine for timestamps. * Made timeinutc serializable Added the bool to the serialization method. * Adding the INIFile.cs For Dictionary serialization. * Reworked ignore feature Ignored players are now serialized in a file and reloaded, after the bot enters a server. * Mailer bot refactoring Rename Mail to Mailer Move options to MinecraftClient.ini Make the bot much simpler by removing some settings Create specific MailDatabase and IgnoreList classes However the core functionality for users is the same Settings removed: - allow_sendmail: Cannot use Mailer if it's disabled - allow_receivemail: Cannot use Mailer if it's disabled - path_setting: Settings moved to MinecraftClient.ini - debug_msg: MCC already has a setting for that with LogDebugToConsole() - auto_respawn: MCC already has a built-in auto-respawn feature - allow_selfmail: Is it really necessary to block self mails? ;) - maxcharsinmsg: Automatically calculated based on max chat message length - timeinutc: DateTime is not show to the recipient so I think it's not absolutely necessary - interval_sendmail: Set to 10 seconds for now Internal Commands removed: - changemailpath: Now a static setting in config - changesettingspath: Now a static setting in config - updatemails: Already updated every 10 seconds - getsettings: Shown on startup with debugmessages=true - resettimer: Seems only useful for debugging - setbool: Settings are static in config file - setinteger: Settings are static in config file All user commands are retained: - mail - tellonym * Reload database for mailer network feature * Merge Mail documentation to Readme.md Co-authored-by: ORelio <oreliogitantispam.l0gin@spamgourmet.com>
2020-08-03 21:44:39 +02:00
Using the Mailer
------
The Mailer bot can store and relay mails much like Essential's /mail command.
* /tell <Bot> mail [RECIPIENT] [MESSAGE]: Save your message for future delivery
* /tell <Bot> tellonym [RECIPIENT] [MESSAGE]: Same, but the recipient will receive an anonymous mail
The bot will automatically deliver the mail when the recipient is online.
The bot also offers a /mailer command from the MCC command prompt:
* /mailer getmails: Show all mails in the console
* /mailer addignored [NAME]: Prevent a specific player from sending mails
* /mailer removeignored [NAME]: Lift the mailer restriction for this player
* /mailer getignored: Show all ignored players
**CAUTION:** 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!)
**Mailer Network:** The Mailer bot can relay messages between servers.
To set up a network of two or more bots, launch several instances with the bot activated and the same database.
If you launch two instances from one .exe they should syncronize automatically to the same file.
Using the AutoCraft bot
------
The AutoCraft bot can automatically craft items for you as long as you have defined the item recipe.
You can get the default config by running the bot at lease once.
Useful commands description:
* /autocraft reload: Reload the config from disk. You can load your edited AutoCraft config without restarting the client.
* /autocraft resetcfg: Reset your AutoCraft config back to default. Use with care!
* /autocraft list: List all loaded recipes.
* /autocraft start <name\>: Start the crafting process with the given recipe name you had defined.
* /autocraft stop: Stop the crafting process.
* /autocraft help: In-game help command.
How to define a recipe?
_Example_
```md
[Recipe]
name=whatever # name could be whatever you like. This field must be defined first
type=player # crafting table type: player or table
result=StoneButton # the resulting item
# define slots with their deserved item
slot1=stone # slot start with 1, count from left to right, top to bottom
# For the naming of the items, please see
# https://github.com/ORelio/Minecraft-Console-Client/blob/master/MinecraftClient/Inventory/ItemType.cs
```
1. You need to give your recipe a **name** so that you could start them later by name.
2. The size of crafting area needed for your recipe, 2x2(player inventory) or 3x3(crafting table). If you need to use the crafting table, make sure to set the **table coordinate** in the `[AutoCraft]` section.
3. The expected crafting result.
Then you need to define the position of each crafting materials.
Slots are indexed as follow:
2x2
```
╔═══╦═══╗
║ 1 ║ 2 
╠═══╬═══╣
║ 3 ║ 4 
╚═══╩═══╝
```
3x3
```
╔═══╦═══╦═══╗
║ 1 ║ 2 ║ 3 ║
╠═══╬═══╬═══╣
║ 4 ║ 5 ║ 6 ║
╠═══╬═══╬═══╣
║ 7 ║ 8 ║ 9 ║
╚═══╩═══╩═══╝
```
Simply use `slotIndex=MaterialName` to define material.
e.g. `slot1=coal` and `slot3=stick` will craft a torch.
For the naming of items, please see [ItemType.cs](https://github.com/ORelio/Minecraft-Console-Client/blob/master/MinecraftClient/Inventory/ItemType.cs).
After you finished writing your config, you can use `/autocraft start <recipe name>` to start crafting. Make sure to provide materials for your bot.
Disclaimer
------
Even if everything should work, We are not responsible for any damage this app could cause to your computer or your server.
This app does not steal your password. If you don't trust it, don't use it or check & compile from the source code.
Also, remember that when you connect to a server with this program, you will appear where you left the last time.
This means that **you can die if you log in in an unsafe place on a survival server!**
Use the script scheduler bot to send a teleport command after logging in.
We remind you that **you may get banned** by your server for using this program. Use accordingly with server rules.
License
------
Minecraft Console Client is a totally free of charge, open source project.
Source code is available at https://github.com/ORelio/Minecraft-Console-Client
Unless specifically stated, source code is from me or contributors, and available under CDDL-1.0.
More info about CDDL-1.0: http://qstuff.blogspot.fr/2007/04/why-cddl.html
Full license at http://opensource.org/licenses/CDDL-1.0
Credits
------
Even though I'm the main author of Minecraft Console Client, many features
would not have been possible without the help of talented contributors:
**Ideas:**
ambysdotnet, Awpocalypse, azoundria, bearbear12345, bSun0000, Cat7373, dagonzaros, Dids,
Elvang, fuckofftwice, GeorgH93, initsuj, JamieSinn, joshbean39, LehmusFIN, maski, medxo,
mobdon, MousePak, TNT-UP, TorchRJ, yayes2, Yoann166, ZizzyDizzyMC
**Bug Hunters:**
1092CQ, ambysdotnet, bearbear12345, c0dei, Cat7373, Chtholly, Darkaegis, dbear20,
DigitalSniperz, doranchak, drXor, FantomHD, gerik43, ibspa, iTzMrpitBull, JamieSinn,
k3ldon, KenXeiko, link3321, lyze237, mattman00000, Nicconyancat, Pokechu22, ridgewell,
Ryan6578, Solethia, TNT-UP, TorchRJ, TRTrident, WeedIsGood, xp9kus, Yoann166
**Code contributions:**
Allyoutoo, Aragas, Bancey, bearbear12345, corbanmailloux, dbear20, dogwatch, initsuj,
JamieSinn, justcool393, lokulin, maxpowa, medxo, milutinke, Pokechu22, ReinforceZwei,
repository, TheMeq, TheSnoozer, vkorn, v1RuX, yunusemregul, ZizzyDizzyMC
**Libraries:**
Minecraft Console Client also borrows code from the following libraries:
-----------------------------------------------------------------
Name Purpose Author License
Biko Proxy handling Benton Stark MIT
BouncyCastle CFB-8 AES on Mono The Legion MIT
Heijden.Dns DNS SRV Lookup Geoffrey Huntley MIT
DotNetZip Zlib compression Dino Chiesa MS-PL
-----------------------------------------------------------------
**Support:**
If you still have any question after reading this file, you can get support here:
- General Questions: http://www.minecraftforum.net/topic/1314800-/
- Bugs & Issues: https://github.com/ORelio/Minecraft-Console-Client/issues
Like Minecraft Console Client? You can buy me a coffee here:
- https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=EALHERGB9DQY8
Code contributions, bug reports and any kind of comments are also highly appreciated :)
2016-03-21 10:22:05 +01:00
+-----------------------------------+
| © 2012-2020 ORelio & Contributors |
2016-03-21 10:22:05 +01:00
+-----------------------------------+