Help with Slash Command implementation
I'm creating a simple addon that shows information like XP to level up on the chat. It's called by typing /minXP. I have the following code (using an .xml to be able to use OnLoad), but the game keeps throwing an unknown command error each time I call it.
Code:
local function cmdHandler(msg, editbox) |
Here is a basic outline of a pure Lua implementation of custom slash commands.
Note: The numbers go from 1 to n. Note: For this implementation, I have used an anonymous function, but you can certainly point to an already existing one (showXP in your case). Note: FUNCTIONNAME is arbitrary; make sure it is unique. I typically name them: "CLAMRAIDLOCKOUTS" or "CLAMXP", et cetera. Code:
SLASH_FUNCTIONNAME1 = "/command" |
Put it that way, still getting the error :(
Code:
SLASH_MINXP1= "/minXP"; |
Remove the () from your function name.
You need the function reference not a function call. |
Now working, thank you :)
|
All times are GMT -6. The time now is 09:57 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI