Page tree
Skip to end of metadata
Go to start of metadata




Introduced in

Version:3.6

Description

Description:IMPORTANT: This function only works when VBS is started with the -gateway switch.

Sends script commands as strings through the active adaptors to connected clients. If the Script Datum ID matches in the settings files, the script is executed by the other Gateway clients.
Note: Results may vary on other clients. If logging is turned on for Gateway, both incoming and outgoing commands are logged. Log Level needs to be at least Information to receive notifications in the log for the command. Log Level needs to be at Debug level to see incoming PDUs that are ignored because they do not have the datum ID the receiver is listening to.

Multiple script commands can be sent within a single string, or they can be separate arguments. The script command runs using the variables of the connected client (similar to publicExec).

Syntax

Syntax:[command, datumID] call Gateway_SendCommand
Parameters:
  • command: String - The command to send.
  • datum: Number - The datum ID which can be different than the one specified in the Gateway Settings. When no datum ID is given, the receiving datum ID from the Gateway Settings is used (optional). (V3.9.0)
Return Value:Nothing

Warning

When using functions in VBS versions older than 3.4, certain limitations and requirements should be kept in mind - the main ones being that capitalization of the function name is crucial, and that #include "\vbs2\headers\function_library.hpp" has to be included in every script that utilizes it. More Category VBS Scripting Functions.

Examples

Examples:
// Runs the hint script command to display 'hello world' on connected client
[ " hint 'hello world'; " ] call Gateway_SendCommand;
// Displays the position of the connected player, which should be different for each client
[ " hintC format[ '%1', position player ]; " ] call Gateway_SendCommand;
// Displays the position of the sending player
[ format[ "hintC %1", position player ] ] call Gateway_SendCommand;
// Displays the position of the sending player with datum ID 5
[ format[ "hintC %1", position player ], 5 ] call Gateway_SendCommand;

Additional Information

See also: 
Multiplayer:The function returns nil, if not used in multiplayer or when Gateway is not active (the -gateway start-up parameter is not used).
Problems: 

Notes






Known issues:
Gateway 1.2 only supports sending the first command. MAK RTI using RPR1 only supports sending the first command. There is no character limit, but network traffic may impose limitations.