This article covers the following platforms
MSFS 2024
MSFS 2020
ATS
FSX
Prepar3D
script_message_rcv runs when another script sends this script a message with the this.$api.command.script_message_send API function.
script_message_rcv((caller_reference_name, message, reply_callback) => {
console.log('got a message from' + caller_reference_name, message);
reply_callback('I got your message!')
});caller_reference_name: The reference name of the script that sent the message.message: Can be a string, object, or array.reply_callback: (Optional) Call this to reply to the message. Its parameters depend on what the sender defined when sending the message.