You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 20, 2025. It is now read-only.
func main() {
sc, err := simconnect.NewEasySimConnect()
if err != nil {
panic(err)
}
go connectToSimVars(sc)
time.Sleep(3 * time.Second)
event := sc.NewSimEvent(simconnect.KeyAutopilotOff)
event.Run()
for {
fmt.Println(sc.IsAlive())
time.Sleep(time.Second * 3)
}
}
func connectToSimVars(sc *simconnect.EasySimConnect) <-chan []simconnect.SimVar {
cSimVar, err := sc.ConnectToSimVar(
simconnect.SimVarPlaneAltitude(),
simconnect.SimVarAutopilotMaster(),
)
if err != nil {
panic(err)
}
for {
result := <-cSimVar
fmt.Println(result)
}
}
after i run this program i get updated sim data few time every second. After i send event to sc loop in connectToSimVars() stops. But i still get info that sc is alive (last loop)