Skip to main content
Version: 15.x (API 15) [Current]

Interface IConsole

Provides functions to register console commands and variables.

Assembly: Dalamud.dll​
Declaration
[Experimental("Dalamud001")]
public interface IConsole : IDalamudService

Properties​

Prefix​

Gets this plugin's namespace prefix, derived off its internal name. This is the prefix that all commands and variables registered by this plugin will have. If the internal name is "SamplePlugin", the prefix will be "sampleplugin.".

Declaration
string Prefix { get; }

Methods​

AddCommand(string, string, Func<bool>)​

Add a command to the console.

Declaration
IConsoleCommand AddCommand(string name, string description, Func<bool> func)
Returns​

Dalamud.Console.IConsoleCommand: The added command.

Parameters​
TypeNameDescription
System.StringnameThe name of the command.
System.StringdescriptionA description of the command.
System.Func<System.Boolean>funcFunction to invoke when the command has been called. Must return a System.Boolean indicating success.

AddCommand<T1>(string, string, Func<bool, T1>)​

Add a command to the console.

Declaration
IConsoleCommand AddCommand<T1>(string name, string description, Func<bool, T1> func)
Returns​

Dalamud.Console.IConsoleCommand: The added command.

Parameters​
TypeNameDescription
System.StringnameThe name of the command.
System.StringdescriptionA description of the command.
System.Func<System.Boolean,<T1>>funcFunction to invoke when the command has been called. Must return a System.Boolean indicating success.
Type Parameters​
NameDescription
T1The first argument to the command.

AddCommand<T1, T2>(string, string, Func<bool, T1, T2>)​

Add a command to the console.

Declaration
IConsoleCommand AddCommand<T1, T2>(string name, string description, Func<bool, T1, T2> func)
Returns​

Dalamud.Console.IConsoleCommand: The added command.

Parameters​
TypeNameDescription
System.StringnameThe name of the command.
System.StringdescriptionA description of the command.
System.Func<System.Boolean,<T1>,<T2>>funcFunction to invoke when the command has been called. Must return a System.Boolean indicating success.
Type Parameters​
NameDescription
T1The first argument to the command.
T2The second argument to the command.

AddCommand<T1, T2, T3>(string, string, Func<bool, T1, T2, T3>)​

Add a command to the console.

Declaration
IConsoleCommand AddCommand<T1, T2, T3>(string name, string description, Func<bool, T1, T2, T3> func)
Returns​

Dalamud.Console.IConsoleCommand: The added command.

Parameters​
TypeNameDescription
System.StringnameThe name of the command.
System.StringdescriptionA description of the command.
System.Func<System.Boolean,<T1>,<T2>,<T3>>funcFunction to invoke when the command has been called. Must return a System.Boolean indicating success.
Type Parameters​
NameDescription
T1The first argument to the command.
T2The second argument to the command.
T3The third argument to the command.

AddCommand<T1, T2, T3, T4>(string, string, Func<bool, T1, T2, T3, T4>)​

Add a command to the console.

Declaration
IConsoleCommand AddCommand<T1, T2, T3, T4>(string name, string description, Func<bool, T1, T2, T3, T4> func)
Returns​

Dalamud.Console.IConsoleCommand: The added command.

Parameters​
TypeNameDescription
System.StringnameThe name of the command.
System.StringdescriptionA description of the command.
System.Func<System.Boolean,<T1>,<T2>,<T3>,<T4>>funcFunction to invoke when the command has been called. Must return a System.Boolean indicating success.
Type Parameters​
NameDescription
T1The first argument to the command.
T2The second argument to the command.
T3The third argument to the command.
T4The fourth argument to the command.

AddCommand<T1, T2, T3, T4, T5>(string, string, Func<bool, T1, T2, T3, T4, T5>)​

Add a command to the console.

Declaration
IConsoleCommand AddCommand<T1, T2, T3, T4, T5>(string name, string description, Func<bool, T1, T2, T3, T4, T5> func)
Returns​

Dalamud.Console.IConsoleCommand: The added command.

Parameters​
TypeNameDescription
System.StringnameThe name of the command.
System.StringdescriptionA description of the command.
System.Func<System.Boolean,<T1>,<T2>,<T3>,<T4>,<T5>>funcFunction to invoke when the command has been called. Must return a System.Boolean indicating success.
Type Parameters​
NameDescription
T1The first argument to the command.
T2The second argument to the command.
T3The third argument to the command.
T4The fourth argument to the command.
T5The fifth argument to the command.

AddVariable<T>(string, string, T)​

Add a variable to the console.

Declaration
IConsoleVariable<T> AddVariable<T>(string name, string description, T defaultValue)
Returns​

Dalamud.Console.IConsoleVariable<T>: The added variable.

Parameters​
TypeNameDescription
System.StringnameThe name of the variable.
System.StringdescriptionA description of the variable.
<T>defaultValueThe default value of the variable.
Type Parameters​
NameDescription
TThe type of the variable.

AddAlias(string, string)​

Add an alias to a console entry.

Declaration
IConsoleEntry AddAlias(string name, string alias)
Returns​

Dalamud.Console.IConsoleEntry: The added alias.

Parameters​
TypeNameDescription
System.StringnameThe name of the entry to add an alias for.
System.StringaliasThe alias to use.

GetVariable<T>(string)​

Get the value of a variable.

Declaration
T GetVariable<T>(string name)
Returns​

<T>: The value of the variable.

Parameters​
TypeNameDescription
System.StringnameThe name of the variable.
Type Parameters​
NameDescription
TThe type of the variable.

SetVariable<T>(string, T)​

Set the value of a variable.

Declaration
void SetVariable<T>(string name, T value)
Parameters​
TypeNameDescription
System.StringnameThe name of the variable.
<T>valueThe value to set.
Type Parameters​
NameDescription
TThe type of the value to set.

RemoveEntry(IConsoleEntry)​

Remove an entry from the console.

Declaration
void RemoveEntry(IConsoleEntry entry)
Parameters​
TypeNameDescription
Dalamud.Console.IConsoleEntryentryThe entry to remove.