get data from beamng drive code example
Example: get data from beamng drive
using System;
using InSimDotNet.Out;
class Program {
static void Main() {
TimeSpan timeout = TimeSpan.FromSeconds(10);
using (OutGauge outgauge = new OutGauge(timeout)) {
outgauge.PacketReceived += outgauge_PacketReceived;
outgauge.TimedOut += outgauge_TimedOut;
outgauge.Connect("127.0.0.1", 4444);
Console.ReadLine();
}
}
static void outgauge_TimedOut(object sender, EventArgs e) {
Console.WriteLine("OutGauge timed out!");
}
static void outgauge_PacketReceived(object sender, OutGaugeEventArgs e) {
Console.WriteLine(e.RPM);
}
}