The simulator object is a global interface to resources provided by the simulator, and properties of the simulator. Access to commands and datarefs is provided by this object, as well as common simulator events and properties.
simulator is available as a single global instance of the simulator interface; you should never need to instantiate a Simulator.
simulator.elapsed_time is the elapsed time in seconds since the simulator started.simulator.cycle_number is the number of simulator cycles since the simulator started.simulator.createCommand() creates a new command.simulator.createDataref() creates a new dataref.simulator.findCommand() finds an existing dataref by name.simulator.findDataref() finds an existing dataref by name.Listen to these events using simulator.addEventListener(). Remove your listener using simulator.removeEventListener().
beforeflightmodel is fired before the flight model is run.afterflightmodel is fired after the flight model is run.loadaircraft is fired when an aircraft is loaded.unloadaircraft is fired when an aircraft is unloaded.flightcrash is fired when the user's aircraft crashes.