A library to make Terraria bots in C#
This is currently a work in progress so a lot of things will change in the next days.
The documentation is available here: https://terrariabot.zirk.eu
The project is already on NuGet as a pre-release.
Install-Package TerrariaBot -Version 0.4.0-alpha
If you want to connect your bot using Steam you'll need TerrariaBot.Steam
Please make not that using it will use your Steam account and increase your hours played on Steam
Nuget package coming soon
The next step will be to add a dependency to Steamworks.NET
Then you'll need do add steam_api64.dll and Steamworks.NET.dll next to your executable
private static IPClient client;
private static AutoResetEvent autoEvent = new AutoResetEvent(false);
static void Main(string[] _)
{
try
{
client = new IPClient(); // We create a new Terraria Client
client.ServerJoined += Ai; // Function that will be called once the bot is connected
client.ConnectWithIP("localhost", PlayerInformation.GetRandomPlayer("MyName", PlayerDifficulty.Easy));
}
catch (SocketException se)
{ } // The bot wasn't able to connect to the server
autoEvent.WaitOne(); // We just wait indefinitly
}
private static void Ai(PlayerSelf me)
{
// Just do what you want here, you probably want to interract with your PlayerSelf to do stuffs
}
Meina is a bot that have for goal to be able to play at Terraria
If you want to understand better how Terraria client communicate you can check this repository: https://github.com/TheIndra55/terraria-research
Feel free to open an issue or come ask on Discord.