Create README.md

This commit is contained in:
Elijah R 2023-03-08 19:10:41 -05:00 committed by GitHub
parent 811fd766a9
commit 65c8d69434
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

27
README.md Normal file
View file

@ -0,0 +1,27 @@
# CollabVMSharp
CollabVM client library in C#.
## Usage Example
```cs
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?");
// 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
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}!");
};
```