GHI_SlashCmd

Pilus edited this page Aug 11, 2015 · 1 revision

Syntax

obj = GHI_SlashCmd(mainSlashPrefix) obj.function()

Arguments

mainSlashPrefix
''String''
The string for the slash command you wish to enter. (Example: "Boss" for /Boss)
## Functions ### SetDefaultFunc(func) #### Arguments
func
''Function''
This is the function to do when the slash command is entered.

RegisterSubPrefix(subPrefix, func)

Arguments

subPrefix
''String''
This is the argument to the slash command, (Example: "Fight" for /Boss Fight)
func
''Function''
This is the function to do when the slash command with argument is entered.

Example

local mainFunc = function()

print("Like A Boss!")

end

local subFunc = function()

local bossMan = GetUnitName("player")

print(bossMan.." slashes commands like a Boss.")

end

local likeA = GHI_SlashCmd("boss")

likeA.SetDefaultFunc(mainFunc)

likeA.RegisterSubPrefix("man", subFunc)

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.