iracing-sdk icon indicating copy to clipboard operation
iracing-sdk copied to clipboard

Access driver info array

Open OSHW-Rico opened this issue 2 years ago • 0 comments

Thanks for providing a current golang implementation!

Is it possible to access these driver values somehow?

image

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)
	}

OSHW-Rico avatar Apr 03 '22 10:04 OSHW-Rico