iracing-sdk
iracing-sdk copied to clipboard
Access driver info array
Thanks for providing a current golang implementation!
Is it possible to access these driver values somehow?
Accessing like this works, but only for the first driver, how to access the other drivers?
varlist := []string{"CarIdxClassPosition", "CarIdxLapDistPct", "CarIdxRPM", "CarIdxOnPitRoad", "CarIdxGear", "CarIdxTrackSurface"}
for {
sdk.WaitForData(1000 * time.Millisecond)
for _, variable := range varlist {
value, err := sdk.GetVar(variable)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%s: %s\n", variable, value)
}
time.Sleep(time.Second)
}