Skip to main content

RunCommand

This function was added in DSL 4

Description

Process a command line string as if it was typed into the console.

function RunCommand(commandLine) --[[ ... ]] end

Parameters

  • commandLine: string - The command line string to process.

Return Values

  • ran: boolean - true if the command was successfully processed, false if it was not recognized or could not be executed.
info

DSL5 - An error is no longer raised if the command does not exist or an error occurs during parsing, and ran will indicate success or failure instead.

Example

RunCommand('greet John') -- Assuming 'greet' is a command that has been set up to greet the user.
RunCommand('restart MyMod')

See Also