I noticed a small error when using in the editor, the right click: Code snippets/Flight Simulator/FS 2020 variable subscribe
The code pasted in the editor is I guess an old version:
Code: Select all
-- This function will be called when new data is available from FSX or Prepar3D
function new_altitude_callback(altitude)
-- Prints the altitude in the debug window
print("New altitude: " .. altitude)
end
-- subscribe to FSX / Prepar3D variables on the databus
fsx_variable_subscribe("INDICATED ALTITUDE", "Feet", new_altitude_callback)