WoW:USERAPI SlashCmdList AddSlashCommand (source)
Revision as of 23:55, 2 November 2009
, 2 November 2009Fixed 2 spelling errors.
m (New page: {{userfunc}} <!-- Leave this line in! --> Returns the scaled position of the cursor. SlashCmdList_AddSlashCommand(name, func, ...) == Function Parameters == === Arguments === ;name : Un...) |
m (Fixed 2 spelling errors.) |
||
| Line 6: | Line 6: | ||
== Function Parameters == | == Function Parameters == | ||
=== Arguments === | === Arguments === | ||
;name : Unique | ;name : Unique identifier (e.g. MYADDON_SLASHCMD) | ||
;func : The function (variable or actual function) | ;func : The function (variable or actual function) | ||
;... : A list of commands with or without the leading slash | ;... : A list of commands with or without the leading slash | ||
| Line 13: | Line 13: | ||
== Example == | == Example == | ||
The following | The following snippets do the same thing. | ||
SlashCmdList_AddSlashCommand('MYADDON_SLASHCMD', function(msg) | SlashCmdList_AddSlashCommand('MYADDON_SLASHCMD', function(msg) | ||
DEFAULT_CHAT_FRAME:AddMessage(msg or 'nil') | DEFAULT_CHAT_FRAME:AddMessage(msg or 'nil') | ||