Fsx event

From Sim Innovations Wiki
Jump to navigation Jump to search

Description

fsx_event(event,value)

fsx_event is used to send an event to FSX or Prepar3D. And can contain a value (this is optional).

You can find the available events for FSX here and the Prepar3D variables here (official).

Return value

This function won't return any value.

Arguments

# Argument Type Description
1 event String Reference to an event from Flight Simulator X or Prepar3D
2 value Number (Optional) Send a value with the event. Some events support setting a value.

Example

-- Toggle the Avionics Master switch
fsx_event("TOGGLE_AVIONICS_MASTER")

-- Set stobe lights on
fsx_event("STROBES_SET", 1)

PMDG example

-- Set the battery switch to on position 
fsx_event("PMDG 737NGX:EVT_OH_ELEC_BATTERY_SWITCH", 1)

-- Set the bell cutout switch to off position
fsx_event("PMDG 737NGX:EVT_FIRE_BELL_CUTOUT_SWITCH", 0)

-- Set the fasten belt light switch to on position
-- 0: OFF  1: AUTO   2: ON
fsx_event("PMDG 737NGX:EVT_OH_FASTEN_BELTS_LIGHT_SWITCH", 2)

Add-on aircraft and sources

Add-on Description
PMDG737NGX events Event list for the PMDG 737 NGX 800 and 900