Console

Summary

Methods

Method Returns
Register(name: string, description: string, callback: callable) ConsoleCommand
Register(name: string, description: string, context: any, callback: callable) ConsoleCommand
Deregister(name: string) bool
Deregister(command: ConsoleCommand) bool
DeregisterAll() void

Methods

Register

Register(name: string, description: string, callback: callable): ConsoleCommand

Parameters

Name Type Description
name string
description string
callback callable A callback in the form function(args: string{}): string | nil.

Returns

Type Description
ConsoleCommand

Example

Console:Register('SomeCommand', 'Incredible command description.', function(args)
  if #args == 1 and args[1] == 'hello' then
    return 'goodbye'
  end
end)

Register

Register(name: string, description: string, context: any, callback: callable): ConsoleCommand

Parameters

Name Type Description
name string
description string
context any
callback callable A callback in the form function(context: any, args: string{}): string | nil.

Returns

Type Description
ConsoleCommand

Deregister

Deregister(name: string): bool

Parameters

Name Type Description
name string

Returns

Type Description
bool

Deregister

Deregister(command: ConsoleCommand): bool

Parameters

Name Type Description
command ConsoleCommand

Returns

Type Description
bool

DeregisterAll

DeregisterAll()