PixelPilot.Core 1.1.9

There is a newer version of this package available.
See the version list below for details.
dotnet add package PixelPilot.Core --version 1.1.9
NuGet\Install-Package PixelPilot.Core -Version 1.1.9
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="PixelPilot.Core" Version="1.1.9" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add PixelPilot.Core --version 1.1.9
#r "nuget: PixelPilot.Core, 1.1.9"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install PixelPilot.Core as a Cake Addin
#addin nuget:?package=PixelPilot.Core&version=1.1.9

// Install PixelPilot.Core as a Cake Tool
#tool nuget:?package=PixelPilot.Core&version=1.1.9

Pixel Pilot

NuGet Version GitHub Actions Workflow Status

A C# library for interacting with the game PixelWalker

Example bot

Features

  • Strongly typed packets.
  • PixelPilotCore has minor abstractions.
  • Split into multiple projects. Use only what you need.

Projects:

  • PixelPilotCore: The core of the project. Bare minimum client to interact with the game.
  • PixelPilotTests: All test related to the project.
  • PixelPilotExample: An example bot.

To-Do's:

  • Implement all packets.
  • Implement common World and Player abstractions (seperate package)

Example

using Microsoft.Extensions.Configuration;
using PixelPilot.PixelGameClient;
using PixelPilot.PixelGameClient.Messages.Received;
using PixelPilot.PixelGameClient.Messages.Send;
using PixelPilot.PixelGameClient.World;
using PixelPilotExample;

// Load the configuration. Don't store your account token in the code :)
var config = new ConfigurationBuilder()
    .AddJsonFile("config.json")
    .AddEnvironmentVariables()
    .Build().Get<BasicConfig>();

if (config == null)
{
    Console.WriteLine("The configuration file could not be loaded.");
    return;
}

// Create a client.
var client = new PixelPilotClient(config.AccountToken, false);

// Create a PixelWorld class and attach the client to it.
// Allow it to listen to client updates. Not required!
var world = new PixelWorld();
client.OnPacketReceived += world.HandlePacket;
world.OnBlockPlaced += (_, playerId, oldBlock, _) =>
{
    if (client.BotId == playerId) return;
    client.Send(oldBlock.AsPacketOut());
};


// Executed when the client receives a packet!
client.OnPacketReceived += (_, packet) =>
{
    switch (packet)
    {
        // Use strongly typed packets!
        case PlayerChatPacket { Message: ".stop" }:
            client.Disconnect();
            Environment.Exit(0);
            return;
        case PlayerChatPacket { Message: ".ping" } chat:
        {
            client.Send(new PlayerChatOutPacket($"Pong! ({chat.Id})"));
            break;
        }
        case PlayerJoinPacket join:
            client.Send(new PlayerChatOutPacket($"/giveedit {join.Username}"));
            break;
    }
};

// Executed once the client receives INIT
// Make a platform and do some silly loops.
client.OnClientConnected += (_) =>
{
    client.Send(new PlayerChatOutPacket("Hello world using the PixelPilot API."));
    Thread.Sleep(250);
    PlatformUtil.GetThread(client).Start();
    client.Send(new PlayerMoveOutPacket(592, 1056, 0, 0, 0, 0, 0, 0, false, false, 100)); 
};

// Connect to a room.
await client.Connect("r082b210d67df52");

// Don't terminate.
Thread.Sleep(-1);

Enjoy the library? Leave a ⭐

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on PixelPilot.Core:

Package Downloads
PixelPilot.Structures

Save and load structures. Easily paste them into your world.

PixelPilot.ChatCommands

Chat commands for PixelPilot

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.6.5 36 7/5/2024
1.6.4 110 6/20/2024
1.6.3 110 6/15/2024
1.6.2 105 6/15/2024
1.6.1 84 6/14/2024
1.6.0 83 6/14/2024
1.5.2 74 6/11/2024
1.5.1 69 6/11/2024
1.5.0 85 6/6/2024
1.4.1 89 6/5/2024
1.4.0 89 6/3/2024
1.3.0 89 5/29/2024
1.2.0 84 5/20/2024
1.1.9 102 5/4/2024
1.1.8 54 5/3/2024
1.1.7 49 5/3/2024
1.1.6 82 4/30/2024
1.1.5 88 4/30/2024
1.1.4 91 4/29/2024
1.1.3 75 4/29/2024
1.1.2 76 4/28/2024
1.1.1 84 4/28/2024
1.1.0 87 4/28/2024
1.0.2 76 4/28/2024
1.0.1 83 4/27/2024
1.0.0 105 4/27/2024

Included first iteration player management.