GithubHelp home page GithubHelp logo

terrariabot's Introduction

NuGet

TerrariaBot

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

Install it

The project is already on NuGet as a pre-release.

Install-Package TerrariaBot -Version 0.4.0-alpha

Connect to another player using Steam (coming soon)

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

Example

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
}

Projects using this library

Meina is a bot that have for goal to be able to play at Terraria

So how does it works?

If you want to understand better how Terraria client communicate you can check this repository: https://github.com/TheIndra55/terraria-research

Need more help?

Feel free to open an issue or come ask on Discord.

terrariabot's People

Contributors

xwilarg avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.