A simple library to get WarThunder data provided by the localhost server
go get -u github.com/lucasvmx/WarTelemetry/telemetry
package main
import (
"log"
"time"
"github.com/lucasvmx/WarTelemetry/logger"
wartelemetry "github.com/lucasvmx/WarTelemetry/telemetry"
)
func main() {
// Use this to collect data from remote computer
wartelemetry.InitializeRemote("192.168.1.35")
// Enable internal debug logging (disabled by default)
logger.EnableDebug()
for {
data, err := wartelemetry.GetTelemetryData()
if err != nil {
log.Printf("failed to collect data: %v", err)
time.Sleep(time.Second * 3)
continue
} else {
log.Printf("Aircraft Name: %v", data.Indicators.AircraftName)
}
}
}
package main
import (
"log"
"time"
"github.com/lucasvmx/WarTelemetry/logger"
wartelemetry "github.com/lucasvmx/WarTelemetry/telemetry"
)
func main() {
// Use this for localhost
wartelemetry.InitializeLocalHost()
// Enable internal debug logging (disabled by default)
logger.EnableDebug()
for {
data, err := wartelemetry.GetTelemetryData()
if err != nil {
log.Printf("failed to collect data: %v", err)
time.Sleep(time.Second * 3)
continue
} else {
log.Printf("Aircraft Name: %v", data.Indicators.AircraftName)
}
}
}
go build