m
WW:MOS
mNo edit summary |
m (WW:MOS) |
||
| Line 1: | Line 1: | ||
This HOWTO teaches the basics of creating | This [[HOWTO]] teaches the basics of '''creating a slash command''' for your [[AddOn]]. | ||
== Simple Example == | == Simple Example == | ||
Suppose you have: | Suppose you have: | ||
| Line 18: | Line 17: | ||
== Further Examples == | == Further Examples == | ||
'''OnLoad Function:''' | '''OnLoad Function:''' | ||
| Line 49: | Line 47: | ||
== The Details == | == The Details == | ||
<pre>SLASH_<CommandId><num> | <pre>SLASH_<CommandId><num> | ||
SlashCmdList["<CommandId>"] = <CodeToExecute></pre> | SlashCmdList["<CommandId>"] = <CodeToExecute></pre> | ||
| Line 64: | Line 61: | ||
== Conventions == | == Conventions == | ||
* Command ID's are generally all caps, with underscores if necessary. These can also contain lowercase characters. | * Command ID's are generally all caps, with underscores if necessary. These can also contain lowercase characters. | ||
* Pick a command ID that's going to be unique to your addon, a common convention is ADDONNAME_COMMANDNAME, or if you just have one, then ADDONNAME (Where ADDONNAME is the name of your addon). | * Pick a command ID that's going to be unique to your addon, a common convention is ADDONNAME_COMMANDNAME, or if you just have one, then ADDONNAME (Where ADDONNAME is the name of your addon). | ||