Buttplug.Net is a buttplug client library written in modern .Net
Stable and prerelease builds are available from Nuget:
- Buttplug.Net: Core buttplug client library
- Buttplug.Net.NewtonsoftJson: Buttplug JSON message converter based on Newtonsoft.Json
- Buttplug.Net.SystemTextJson: Buttplug JSON message converter based on System.Text.Json
var cancellationToken = CancellationToken.None;
//var converter = new ButtplugNewtonsoftJsonConverter();
var converter = new ButtplugSystemTextJsonConverter();
await using var client = new ButtplugClient("Buttplug.Net", converter);
await client.ConnectAsync(new Uri("ws://127.0.0.1:12345/"), cancellationToken);
Console.WriteLine("Connected");
await client.StartScanningAsync(cancellationToken);
await Task.Delay(2500);
foreach (var device in client.Devices)
await device.ScalarAsync(1, ActuatorType.Vibrate, cancellationToken);
await Task.Delay(1000);
await client.StopAllDevicesAsync(cancellationToken);
More samples available here