I guess it's because I use opera that the forum cracks up then.
mongoarne
@mongoarne
Best posts made by mongoarne
Latest posts made by mongoarne
-
RE: World of Warcraft WTF?
-
World of Warcraft WTF?
From http://forums.worldofwarcraft.com/thread.html?topicId=11381238&sid=1 (sorry, no direct link to post seems to be possible)
Quote start:
How do I register a /slash command? Credit: Jamash
In my UI AddOn, what do I need to do to create a new "/slashcommand" that the user can type into the chat box?
Slash command information is stored in two places. The first is a global table named SlashCmdList. In order to add a new command, create a new function with one argument. That argument will contain whatever text the user typed after the name of your command.
MyAddon = {};
function MyAddon.SlashCommand(Argument)
DoSomethingWith(Argument);
end
Then create a new entry in the table for your new slash command.
SlashCmdList["My_AddOn_Slash_Command"] = MyAddon.SlashCommand;
The second place slash command information is stored is in a haphazard series of global variables. These variables' names all start with "SLASH_", then the name of an entry in SlashCmdList, and end with a digit. The value of each variable is the text the user types to active the command. It's important to note that while the names of the variables are case-sensitive, the command the user types is case-insensitive (so "/MASC", "/Masc" and "/masc" all do the same thing.
SLASH_My_AddOn_Slash_Command1 = "/MASC";
SLASH_My_AddOn_Slash_Command2 = "/MASlashCommand";
SLASH_My_AddOn_Slash_Command3 = "/MyAddonSlashCommand";
#End
Is this a wtf or is there some strange reason why not somehing like this is used instead:
AddSlashCmd({"/masc", "/MASlashCommand", ... }, MyAddon.SlashCommand);[edited by: mongoarne at 7:11 PM (GMT -5) on Mon, Jan 05 2009]
Wow.. I guess this forum is the real WTF... If someone wants to tell me how to make it behave, I'll fix it