No description
Find a file
2023-08-28 16:41:10 -04:00
.github/workflows Create .github/workflows/dotnet.yml 2023-04-10 18:06:18 -04:00
CollabVMSharp bump version 2023-08-28 16:41:10 -04:00
.gitignore update .gitignore 2023-08-28 16:06:32 -04:00
CollabVMSharp.sln Oops ! 2023-02-20 18:11:30 -05:00
global.json all the shit 2023-02-18 21:12:26 -05:00
LICENSE.md First of all, my name is not "dad", it's "GNU/dad" 2023-02-18 21:14:40 -05:00
README.md Update README.md 2023-03-09 15:42:10 -05:00

CollabVMSharp

CollabVM client library in C#.

Usage

The API is well documented with XML documentation, meaning hovering over a method or property in Visual Studio or another IDE should give a pretty good idea of how to do things. For a basic usage example, see below

Example

using System;
using CollabVMSharp;
// Instantiate the client
var cvm = new CollabVMClient("wss://computernewb.com/collab-vm/vm0", "cvmsharptest", "vm0b0t");
// Connect to the VM
await cvm.Connect();
// Send a chat
await cvm.SendChat("What hath god wrought?");
// Add a command
cvm.RegisterCommand("!test", (username, args) => {
    Console.WriteLine($"You said {String.Join(", ", args)}, {username}!");
});
// Queue a turn, wait until we get the turn
await cvm.GetTurn();
// Type a string into the VM
await cvm.TypeString("hey sexies");
// Login as an admin or mod
await cvm.Login("hunter2");
// Run a command in the QEMU monitor and get a response
Console.WriteLine(await cvm.QEMUMonitor("info block"));
// Send a message when someone takes a turn
cvm.TurnUpdate += async (_, e) => {
    await cvm.SendChat($"You have the turn, {e.Queue[0].Username}!");
};