MSFS2020

MSFS2020

Contents

Outgoing channel : "MSFS2020_CHANNEL"

Description

This extension connects to Microsoft Flight Simulator using the simconnect system. It will allow the reading and writing of variables to the sim so that you can trigger on them or perfrom actions on them. ie you can change your obs settns/overlay/chat based on game variable and also setup chat commands etc to control parts of the game

Triggers/Actions

Note that there are thousands of options for MSFS2020. These will only appear if the game is running and the extension connected.

Triggers and actions below are updated when the automatic document generation system is run and only contain triggers actions relating to this specific extension.

Table last updated: Wed, 12 Mar 2025 05:38:02 GMT

Triggers

name trigger description
onRequest_PLANE LATITUDE LONGITUDE trigger_onRequest_PLANE LATITUDE LONGITUDE The current lat long in one message with separate variables

Actions

name trigger description
PLANE LATITUDE LONGITUDE_get action_PLANE LATITUDE LONGITUDE_get Get the current lat long in one message

"MSFS2020" Extension Details...

Game extension to allow access to control Microsoft Flight simulator and also receive data from on of ten's of thousands of sim variables
Source:

Methods

MSFS2020Disconnect()

disconnect from the MSFS2020 interface and callbacks
Source:

(async) MSFS2020RegisterSimvars(handle)

Registers with MSFS2020 for callbacks on simvars
Parameters:
Name Type Description
handle object simconnecnt handle
Source:

SaveConfigToServer()

Saves our config to the server
Source:

SaveDataToServer()

Saves our data to the server
Source:

SendSettingsWidgetLarge(to)

Creates and sends our large settings widget html code to the given extension
Parameters:
Name Type Description
to string
Source:

SendSettingsWidgetSmall(to)

Parses and sends out our small settings widget to the given extension
Parameters:
Name Type Description
to string
Source:

addToTriggersArray(name, indexopt)

Adds a simvar to our known list of names. A simvar may be an array and have an index (ie engines have an index for each engine) others may not have index's
Parameters:
Name Type Attributes Default Description
name string
index number <optional>
0
Source:

findtriggerByMessageType(messagetype)

Finds a specific trigger from the given name
Parameters:
Name Type Description
messagetype string
Source:

handleSettingsWidgetLargeData(modalcode)

Handles user submitted code from our large settings widget/page
Parameters:
Name Type Description
modalcode object
Source:

heartBeatCallback()

Sends out heartbeat messages so other extensions can see our status
Source:

initSimVarsandTriggers()

initialises our sim variables dynamically creates triggers and actions based on what is available. Note there can be thousands of possible options created here
Source:

initialise(app, host, port, heartbeat)

Starts the extension using the given data.
Parameters:
Name Type Description
app object:Express
host string
port number
heartbeat number
Source:

msfsapiconnect()

connect to the MSFS2020 api interface
Source:

onDataCenterConnect(socket)

Called when server connects
Parameters:
Name Type Description
socket object
Source:

onDataCenterDisconnect(reason)

Called when connection is lost to StreamRoller
Parameters:
Name Type Description
reason string
Source:

onDataCenterMessage(server_packet)

Called when we receive a message from the server
Parameters:
Name Type Description
server_packet object
Source:

performAction(data)

An action was received to set/change a simvar or retrieve some data A "trigger_onRequest_(simvarname)" will be fired on a request
Parameters:
Name Type Description
data object
Source:

performActionGetLatLong(data)

Special simvar just for streamroller :D Creates a simvar containing both lat and long rather than having to create two requests actions and getting two responses back
Parameters:
Name Type Description
data object
Source:

pollMSFS()

Poll MSFS for data we are monitoring for
Source:

(async) postTriggers()

posts a trigger out when a given symvar fires. Will also post a "changed" trigger if the value was previously different possible message types posted (NAME) is the simvar name and (INDEX) is the index if an indexed simvar trigger_(NAME) trigger_(NAME):(INDEX) trigger_onChange_(NAME) trigger_onChange_(NAME):(INDEX)
Source:

sendTriggersAndActions(to)

Sends a list of our current triggers/actions ot the given extension
Parameters:
Name Type Description
to string
Source: